diff --git a/controllers/front/OrderReturnController.php b/controllers/front/OrderReturnController.php index 633bc3c7c..f35650e34 100644 --- a/controllers/front/OrderReturnController.php +++ b/controllers/front/OrderReturnController.php @@ -32,22 +32,19 @@ class OrderReturnControllerCore extends FrontController public $authRedirection = 'order-follow'; public $ssl = true; - public function __construct() + public function init() { - parent::__construct(); + parent::init(); - header("Cache-Control: no-cache, must-revalidate"); - header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); - } + header('Cache-Control: no-cache, must-revalidate'); + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); - public function process() - { - if (!isset($_GET['id_order_return']) OR !Validate::isUnsignedId($_GET['id_order_return'])) + if (!isset($_GET['id_order_return']) || !Validate::isUnsignedId($_GET['id_order_return'])) $this->errors[] = Tools::displayError('Order ID required'); else { $orderRet = new OrderReturn((int)($_GET['id_order_return'])); - if (Validate::isLoadedObject($orderRet) AND $orderRet->id_customer == $this->context->cookie->id_customer) + if (Validate::isLoadedObject($orderRet) && $orderRet->id_customer == $this->context->cookie->id_customer) { $order = new Order((int)($orderRet->id_order)); if (Validate::isLoadedObject($order)) @@ -69,12 +66,19 @@ class OrderReturnControllerCore extends FrontController else $this->errors[] = Tools::displayError('Cannot find this order return'); } - + } + + /** + * Assign template vars related to page content + * @see FrontController::process() + */ + public function process() + { + parent::process(); $this->context->smarty->assign(array( 'errors' => $this->errors, 'nbdaysreturn' => (int)(Configuration::get('PS_ORDER_RETURN_NB_DAYS')) )); - $this->setTemplate(_PS_THEME_DIR_.'order-return.tpl'); } diff --git a/themes/prestashop/order-return.tpl b/themes/prestashop/order-return.tpl index 64606f28c..05ea722b4 100644 --- a/themes/prestashop/order-return.tpl +++ b/themes/prestashop/order-return.tpl @@ -23,84 +23,86 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - -

{l s='RE#'}{$orderRet->id|string_format:"%06d"} {l s='on'} {dateFormat date=$order->date_add full=0}

-
-

{l s='We have logged your return request.'}

-

{l s='Your package must be returned to us within'} {$nbdaysreturn} {l s='days of receiving your order.'}

-

{l s='Current status of your merchandise return:'} {$state_name|escape:'htmlall':'UTF-8'}

-

{l s='List of items marked as returned:'}

-
-
- - - - - - - - - - {foreach from=$products item=product name=products} - - {assign var='quantityDisplayed' value=0} - {foreach from=$returnedCustomizations item='customization' name=products} - {if $customization.product_id == $product.product_id} - - - - - - {assign var='productId' value=$customization.product_id} - {assign var='productAttributeId' value=$customization.product_attribute_id} - {assign var='customizationId' value=$customization.id_customization} - {foreach from=$customizedDatas.$productId.$productAttributeId.$customizationId.datas key='type' item='datas'} - - +{include file="$tpl_dir./errors.tpl"} +{if isset($orderRe)} +

{l s='RE#'}{$orderRet->id|string_format:"%06d"} {l s='on'} {dateFormat date=$order->date_add full=0}

+
+

{l s='We have logged your return request.'}

+

{l s='Your package must be returned to us within'} {$nbdaysreturn} {l s='days of receiving your order.'}

+

{l s='Current status of your merchandise return:'} {$state_name|escape:'htmlall':'UTF-8'}

+

{l s='List of items marked as returned:'}

+
+
+
{l s='Reference'}{l s='Product'}{l s='Quantity'}
{if $customization.reference}{$customization.reference|escape:'htmlall':'UTF-8'}{else}--{/if}{$customization.name|escape:'htmlall':'UTF-8'}{$customization.product_quantity|intval}
- {if $type == $smarty.const._CUSTOMIZE_FILE_} -
    - {foreach from=$datas item='data'} -
  • WAHOU
  • - {/foreach} -
- {elseif $type == $smarty.const._CUSTOMIZE_TEXTFIELD_} -
    {counter start=0 print=false} - {foreach from=$datas item='data'} - {assign var='customizationFieldName' value="Text #"|cat:$data.id_customization_field} -
  • {$data.name|default:$customizationFieldName}{l s=':'} {$data.value}
  • - {/foreach} -
- {/if} -
+ + + + + + + + + {foreach from=$products item=product name=products} + + {assign var='quantityDisplayed' value=0} + {foreach from=$returnedCustomizations item='customization' name=products} + {if $customization.product_id == $product.product_id} + + + + - {/foreach} - {assign var='quantityDisplayed' value=$quantityDisplayed+$customization.product_quantity} + {assign var='productId' value=$customization.product_id} + {assign var='productAttributeId' value=$customization.product_attribute_id} + {assign var='customizationId' value=$customization.id_customization} + {foreach from=$customizedDatas.$productId.$productAttributeId.$customizationId.datas key='type' item='datas'} + + + + {/foreach} + {assign var='quantityDisplayed' value=$quantityDisplayed+$customization.product_quantity} + {/if} + {/foreach} + + {if $product.product_quantity > $quantityDisplayed} + + + + + {/if} {/foreach} - - {if $product.product_quantity > $quantityDisplayed} - - - - - - {/if} - {/foreach} - -
{l s='Reference'}{l s='Product'}{l s='Quantity'}
{if $customization.reference}{$customization.reference|escape:'htmlall':'UTF-8'}{else}--{/if}{$customization.name|escape:'htmlall':'UTF-8'}{$customization.product_quantity|intval}
+ {if $type == $smarty.const._CUSTOMIZE_FILE_} +
    + {foreach from=$datas item='data'} +
  • WAHOU
  • + {/foreach} +
+ {elseif $type == $smarty.const._CUSTOMIZE_TEXTFIELD_} +
    {counter start=0 print=false} + {foreach from=$datas item='data'} + {assign var='customizationFieldName' value="Text #"|cat:$data.id_customization_field} +
  • {$data.name|default:$customizationFieldName}{l s=':'} {$data.value}
  • + {/foreach} +
+ {/if} +
{if $product.product_reference}{$product.product_reference|escape:'htmlall':'UTF-8'}{else}--{/if}{$product.product_name|escape:'htmlall':'UTF-8'}{$product.product_quantity|intval}
{if $product.product_reference}{$product.product_reference|escape:'htmlall':'UTF-8'}{else}--{/if}{$product.product_name|escape:'htmlall':'UTF-8'}{$product.product_quantity|intval}
-
-{if $orderRet->state == 2} -

{l s='REMINDER:'}

-
- - {l s='All products must be returned in their original packaging without damage or wear.'} -
- {l s='Please print out the'} id|intval}")}">{l s='PDF document'} {l s='and slip it into your package.'} -
- {l s='Please see PDF document'} (id|intval}")}">{l s='for the correct address'}) -

- {l s='Upon receiving your package, you will be notified by e-mail. We will then begin processing the reimbursement of your order total.'} -

{l s='Let us know if you have any questions.'} -
-

{l s='If the conditions of return listed above are not respected, we reserve the right to refuse your package and/or reimbursement.'}

-
-{elseif $orderRet->state == 1} -

{l s='You must wait for our confirmation before returning any merchandise.'}

-{/if} + + + + {if $orderRet->state == 2} +

{l s='REMINDER:'}

+
+ - {l s='All products must be returned in their original packaging without damage or wear.'} +
- {l s='Please print out the'} id|intval}")}">{l s='PDF document'} {l s='and slip it into your package.'} +
- {l s='Please see PDF document'} (id|intval}")}">{l s='for the correct address'}) +

+ {l s='Upon receiving your package, you will be notified by e-mail. We will then begin processing the reimbursement of your order total.'} +

{l s='Let us know if you have any questions.'} +
+

{l s='If the conditions of return listed above are not respected, we reserve the right to refuse your package and/or reimbursement.'}

+
+ {elseif $orderRet->state == 1} +

{l s='You must wait for our confirmation before returning any merchandise.'}

+ {/if} +{/if} \ No newline at end of file