[-] FO : #PSCFV-2746 - Improve product return errors
This commit is contained in:
@@ -41,7 +41,6 @@ class OrderFollowControllerCore extends FrontController
|
||||
if (Tools::isSubmit('submitReturnMerchandise'))
|
||||
{
|
||||
$customizationQtyInput = Tools::getValue('customization_qty_input');
|
||||
|
||||
if (!$id_order = (int)(Tools::getValue('id_order')))
|
||||
Tools::redirect('index.php?controller=history');
|
||||
if (!$order_qte_input = Tools::getValue('order_qte_input'))
|
||||
@@ -60,7 +59,12 @@ class OrderFollowControllerCore extends FrontController
|
||||
$orderReturn->id_order = $id_order;
|
||||
$orderReturn->question = strval(Tools::getValue('returnText'));
|
||||
if (empty($orderReturn->question))
|
||||
Tools::redirect('index.php?controller=order-follow&errorMsg');
|
||||
Tools::redirect('index.php?controller=order-follow&errorMsg&'.
|
||||
http_build_query(array(
|
||||
'ids_order_detail' => $ids_order_detail,
|
||||
'order_qte_input' => $order_qte_input,
|
||||
'id_order' => Tools::getValue('id_order'),
|
||||
)));
|
||||
|
||||
if (!$orderReturn->checkEnoughProduct($ids_order_detail, $order_qte_input, $customizationIds, $customizationQtyInput))
|
||||
Tools::redirect('index.php?controller=order-follow&errorQuantity');
|
||||
@@ -85,7 +89,14 @@ class OrderFollowControllerCore extends FrontController
|
||||
if (Tools::isSubmit('errorQuantity'))
|
||||
$this->context->smarty->assign('errorQuantity', true);
|
||||
elseif (Tools::isSubmit('errorMsg'))
|
||||
$this->context->smarty->assign('errorMsg', true);
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'errorMsg' => true,
|
||||
'ids_order_detail' => Tools::getValue('ids_order_detail', array()),
|
||||
'order_qte_input' => Tools::getValue('order_qte_input', array()),
|
||||
'id_order' => Tools::getValue('id_order'),
|
||||
)
|
||||
);
|
||||
elseif (Tools::isSubmit('errorDetail1'))
|
||||
$this->context->smarty->assign('errorDetail1', true);
|
||||
elseif (Tools::isSubmit('errorDetail2'))
|
||||
|
||||
@@ -401,9 +401,11 @@ $_LANG['order-detail_fdfac28b5ad628f25649d9c2eb4fc62e'] = 'Retourné';
|
||||
$_LANG['order-follow_01abfc750a0c942167651c40d088531d'] = 'n°';
|
||||
$_LANG['order-follow_0d3cfc2fe56119651ee7848f3e32d84d'] = 'Etiquette de retour';
|
||||
$_LANG['order-follow_229ca46a5d762e19a428f59449c916ad'] = 'Veuillez spécifier un motif de retour !';
|
||||
$_LANG['order-follow_25e93b63e91b5555bd458c89b1916678'] = 'Générer un retour';
|
||||
$_LANG['order-follow_2e99578f8bd14385bc5bcc2608e7b938'] = 'Vous n\'avez pas un nombre suffisant de produits pour générer un autre retour !';
|
||||
$_LANG['order-follow_3976e0f730b236b1cf619dc80f78488e'] = 'Vous n\'avez aucun retour de marchandise créé.';
|
||||
$_LANG['order-follow_446faa7da2d42ba4ffeda73cb119dd91'] = 'Date d\'émission';
|
||||
$_LANG['order-follow_558a57a100d0232908d28ac4bc1c35b5'] = 'Merci de spécifier le motif de votre retour :';
|
||||
$_LANG['order-follow_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil';
|
||||
$_LANG['order-follow_93d4be62cede66eb788f5ca8046bac7f'] = 'Veuillez indiquer la quantité voulue pour chaque produit coché.';
|
||||
$_LANG['order-follow_988fd738de9c6d177440c5dcf69e73ce'] = 'Retour';
|
||||
|
||||
@@ -29,7 +29,27 @@
|
||||
|
||||
<h1>{l s='Return Merchandise Authorization (RMA)'}</h1>
|
||||
{if isset($errorQuantity) && $errorQuantity}<p class="error">{l s='You do not have enough products to request another merchandise return.'}</p>{/if}
|
||||
{if isset($errorMsg) && $errorMsg}<p class="error">{l s='Please provide an explanation for your RMA.'}</p>{/if}
|
||||
{if isset($errorMsg) && $errorMsg}
|
||||
<p class="error">
|
||||
{l s='Please provide an explanation for your RMA.'}
|
||||
</p>
|
||||
<p>
|
||||
<h2>{l s='Please specify an explanation for your RMA:'}</h2>
|
||||
<form method="POST" id="returnOrderMessage"/>
|
||||
<p class="textarea">
|
||||
<textarea name="returnText"></textarea>
|
||||
</p>
|
||||
{foreach $ids_order_detail as $id_order_detail}
|
||||
<input type="hidden" name="ids_order_detail[{$id_order_detail}]" value="{$id_order_detail}"/>
|
||||
{/foreach}
|
||||
{foreach $order_qte_input as $key => $value}
|
||||
<input type="hidden" name="order_qte_input[{$key}]" value="{$value}"/>
|
||||
{/foreach}
|
||||
<input type="hidden" name="id_order" value="{$id_order}"/>
|
||||
<input class="button_large" type="submit" name="submitReturnMerchandise" value="{l s='Make an RMA slip'}"/>
|
||||
</form>
|
||||
</p>
|
||||
{/if}
|
||||
{if isset($errorDetail1) && $errorDetail1}<p class="error">{l s='Please check at least one product you would like to return.'}</p>{/if}
|
||||
{if isset($errorDetail2) && $errorDetail2}<p class="error">{l s='Please provide a quantity for the product you checked.'}</p>{/if}
|
||||
{if isset($errorNotReturnable) && $errorNotReturnable}<p class="error">{l s='This order cannot be returned.'}</p>{/if}
|
||||
|
||||
Reference in New Issue
Block a user