diff --git a/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl b/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl
index d6ca1cf6f..7e5b10b7e 100755
--- a/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl
+++ b/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl
@@ -22,22 +22,23 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
-{if $product.customizedDatas}
-
-
- | {if isset($product.image) && $product.image->id}{$product.image_tag}{else}--{/if} |
+{if $product['customizedDatas']}
+
+ |
+
+ {if isset($product['image']) && $product['image']->id|intval}{$product['image_tag']}{else}--{/if} |
-
+
{$product['product_name']} - {l s='Customized'}
{if ($product['product_reference'])}{l s='Ref:'} {$product['product_reference']} {/if}
{if ($product['product_supplier_reference'])}{l s='Ref Supplier:'} {$product['product_supplier_reference']}{/if}
|
- {displayPrice price=$product['product_price_wt'] currency=$currency->id}
+ {displayPrice price=$product['product_price_wt'] currency=$currency->id|intval}
{if $can_edit}
-
+
{if $currency->sign % 2}{$currency->sign}{/if} {if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax excl.'}
{if $currency->sign % 2}{$currency->sign}{/if} {if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax incl.'}
@@ -49,32 +50,37 @@
{if $stock_management} | - | {/if}
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
- {displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id}
+ {displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval}
{else}
- {displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id}
+ {displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval}
{/if}
|
+
+
+ |
|
|
-
-
-
-
-
- |
+ {if ($can_edit && !$order->hasBeenDelivered())}
+
+
+
+
+
+ |
+ {/if}
- {foreach $product.customizedDatas as $customizationPerAddress}
+ {foreach $product['customizedDatas'] as $customizationPerAddress}
{foreach $customizationPerAddress as $customizationId => $customization}
-
-
+
+
{foreach $customization.datas as $type => $datas}
{if ($type == Product::CUSTOMIZE_FILE)}
{foreach from=$datas item=data}
-
{if $data['name']}{$data['name']}{else}{l s='Picture #'}{$data@iteration}{/if}{l s=':'}
-
+
{/foreach}
@@ -93,7 +99,7 @@
{$customization['quantity']}
{if $can_edit}
-
+
{/if}
|
@@ -104,36 +110,38 @@
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
- {displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id}
+ {displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id|intval}
{else}
- {displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id}
+ {displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id|intval}
{/if}
|
-
-
+
+
{if ((!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN')) AND (int)($customization['quantity_returned']) < (int)($customization['quantity']))}
- = $product['product_quantity'])}disabled="disabled" {/if}/>
+ = $product['product_quantity'])}disabled="disabled" {/if}/>
{else}
--
{/if}
|
{if ($customization['quantity_returned'] + $customization['quantity_refunded'] >= $customization['quantity'])}
-
+
{elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))}
- 0/{$customization['quantity']-$customization['quantity_refunded']}
+ 0/{$customization['quantity']-$customization['quantity_refunded']}
{/if}
|
- {l s='Quantity:'}
+ {l s='Quantity:'}
0/{$customization['quantity']-$customization['quantity_refunded']}
- {l s='Amount:'} {$currency->prefix}{$currency->suffix}
- |
-
+ {l s='Amount:'} {$currency->prefix}{$currency->suffix}
|
+ {if ($can_edit && !$order->hasBeenDelivered())}
+ |
+ |
+ {/if}
|
{/foreach}
{/foreach}
diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php
index 9bc9be699..67e8fd9a1 100755
--- a/controllers/admin/AdminOrdersController.php
+++ b/controllers/admin/AdminOrdersController.php
@@ -568,9 +568,9 @@ class AdminOrdersControllerCore extends AdminController
{
if ($this->tabAccess['delete'] === '1')
{
- if (!Tools::isSubmit('id_order_detail'))
+ if (!Tools::isSubmit('id_order_detail') && !Tools::isSubmit('id_customization'))
$this->errors[] = Tools::displayError('You must select a product.');
- elseif (!Tools::isSubmit('cancelQuantity'))
+ elseif (!Tools::isSubmit('cancelQuantity') && !Tools::isSubmit('cancelCustomizationQuantity'))
$this->errors[] = Tools::displayError('You must enter a quantity.');
else
{
@@ -597,7 +597,8 @@ class AdminOrdersControllerCore extends AdminController
foreach ($customizationList as $key => $id_order_detail)
{
$full_product_list[(int)$id_order_detail] = $id_order_detail;
- $full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key];
+ if (isset($customizationQtyList[$key]))
+ $full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key];
}
if ($productList || $customizationList)