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} @@ -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} + +   +   - - {l s='Edit'} - - - {l s='Delete'} - + {if ($can_edit && !$order->hasBeenDelivered())} + + {l s='Edit'} + + + {l s='Delete'} + + {/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)} @@ -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)