Advertisement
mastonando

_product_line.tpl - PS v1.6.1.5

Jul 25th, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 11.69 KB | None | 0 0
  1. {*
  2. * 2007-2016 PrestaShop
  3. *
  4. * NOTICE OF LICENSE
  5. *
  6. * This source file is subject to the Academic Free License (AFL 3.0)
  7. * that is bundled with this package in the file LICENSE.txt.
  8. * It is also available through the world-wide-web at this URL:
  9. * http://opensource.org/licenses/afl-3.0.php
  10. * If you did not receive a copy of the license and are unable to
  11. * obtain it through the world-wide-web, please send an email
  12. * to license@prestashop.com so we can send you a copy immediately.
  13. *
  14. * DISCLAIMER
  15. *
  16. * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
  17. * versions in the future. If you wish to customize PrestaShop for your
  18. * needs please refer to http://www.prestashop.com for more information.
  19. *
  20. *  @author PrestaShop SA <contact@prestashop.com>
  21. *  @copyright  2007-2016 PrestaShop SA
  22. *  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
  23. *  International Registered Trademark & Property of PrestaShop SA
  24. *}
  25.  
  26. {* Assign product price *}
  27. {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
  28.     {assign var=product_price value=($product['unit_price_tax_excl'] + $product['ecotax'])}
  29. {else}
  30.     {assign var=product_price value=$product['unit_price_tax_incl']}
  31. {/if}
  32.  
  33. {if ($product['product_quantity'] > $product['customized_product_quantity'])}
  34. <tr class="product-line-row">
  35.     <td>{if isset($product.image) && $product.image->id}{$product.image_tag}{/if}</td>
  36.     <td>
  37.         <a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&amp;id_product={$product['product_id']|intval}&amp;updateproduct&amp;token={getAdminToken tab='AdminProducts'}">
  38.             <span class="productName">{$product['product_name']}</span><br />
  39.             {if $product.product_reference}{l s='Reference number:'} {$product.product_reference}<br />{/if}
  40.             {if $product.product_supplier_reference}{l s='Supplier reference:'} {$product.product_supplier_reference}{/if}
  41.         </a>
  42.         <div class="row-editing-warning" style="display:none;">
  43.             <div class="alert alert-warning">
  44.                 <strong>{l s='Editing this product line will remove the reduction and base price.'}</strong>
  45.             </div>
  46.         </div>
  47.     </td>
  48.     {if ($order->getTaxCalculationMethod() != $smarty.const.PS_TAX_EXC)}
  49.     <td class="unit_price_tax_excl">
  50.         <span>{displayPrice price=$product.unit_price_tax_excl currency=$currency->id}</span>
  51.     </td>
  52.     {/if}
  53.     <td>
  54.         <span class="product_price_show">{displayPrice price=$product_price currency=$currency->id}</span>
  55.         {if $can_edit}
  56.         <div class="product_price_edit" style="display:none;">
  57.             <input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']}" />
  58.             <div class="form-group">
  59.                 <div class="fixed-width-xl">
  60.                     <div class="input-group">
  61.                         {if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
  62.                         <input type="text" name="product_price_tax_excl" class="edit_product_price_tax_excl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_excl'], 2)}"/>
  63.                         {if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
  64.                     </div>
  65.                 </div>
  66.                 <br/>
  67.                 <div class="fixed-width-xl">
  68.                     <div class="input-group">
  69.                         {if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
  70.                         <input type="text" name="product_price_tax_incl" class="edit_product_price_tax_incl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_incl'], 2)}"/>
  71.                         {if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
  72.                     </div>
  73.                 </div>
  74.             </div>
  75.         </div>
  76.         {/if}
  77.     </td>
  78.     <td class="productQuantity text-center">
  79.         <span class="product_quantity_show{if (int)$product['product_quantity'] - (int)$product['customized_product_quantity'] > 1} badge{/if}">{(int)$product['product_quantity'] - (int)$product['customized_product_quantity']}</span>
  80.         {if $can_edit}
  81.         <span class="product_quantity_edit" style="display:none;">
  82.             <input type="text" name="product_quantity" class="edit_product_quantity" value="{$product['product_quantity']|htmlentities}"/>
  83.         </span>
  84.         {/if}
  85.     </td>
  86.     {if $display_warehouse}
  87.         <td>
  88.             {$product.warehouse_name|escape:'html':'UTF-8'}
  89.             {if $product.warehouse_location}
  90.                 <br>{l s='Location'}: <strong>{$product.warehouse_location|escape:'html':'UTF-8'}</strong>
  91.             {/if}
  92.         </td>
  93.     {/if}
  94.     {if ($order->hasBeenPaid())}
  95.         <td class="productQuantity text-center">
  96.             {if !empty($product['amount_refund'])}
  97.                 {l s='%s (%s refund)' sprintf=[$product['product_quantity_refunded'], $product['amount_refund']]}
  98.             {/if}
  99.             <input type="hidden" value="{$product['quantity_refundable']}" class="partialRefundProductQuantity" />
  100.             <input type="hidden" value="{(Tools::ps_round($product_price, 2) * ($product['product_quantity'] - $product['customizationQuantityTotal']))}" class="partialRefundProductAmount" />
  101.             {if count($product['refund_history'])}
  102.                 <span class="tooltip">
  103.                     <span class="tooltip_label tooltip_button">+</span>
  104.                     <span class="tooltip_content">
  105.                     <span class="title">{l s='Refund history'}</span>
  106.                     {foreach $product['refund_history'] as $refund}
  107.                         {l s='%1s - %2s' sprintf=[{dateFormat date=$refund.date_add}, {displayPrice price=$refund.amount_tax_incl}]}<br />
  108.                     {/foreach}
  109.                     </span>
  110.                 </span>
  111.             {/if}
  112.         </td>
  113.     {/if}
  114.     {if $order->hasBeenDelivered() || $order->hasProductReturned()}
  115.         <td class="productQuantity text-center">
  116.             {$product['product_quantity_return']}
  117.             {if count($product['return_history'])}
  118.                 <span class="tooltip">
  119.                     <span class="tooltip_label tooltip_button">+</span>
  120.                     <span class="tooltip_content">
  121.                     <span class="title">{l s='Return history'}</span>
  122.                     {foreach $product['return_history'] as $return}
  123.                         {l s='%1s - %2s - %3s' sprintf=[{dateFormat date=$return.date_add}, $return.product_quantity, $return.state]}<br />
  124.                     {/foreach}
  125.                     </span>
  126.                 </span>
  127.             {/if}
  128.         </td>
  129.     {/if}
  130.     {if $stock_management}<td class="productQuantity product_stock text-center">{$product['current_stock']}</td>{/if}
  131.     <td class="total_product">
  132.         {displayPrice price=(Tools::ps_round($product_price, 2) * ($product['product_quantity'] - $product['customizationQuantityTotal'])) currency=$currency->id}
  133.     </td>
  134.     <td colspan="2" style="display: none;" class="add_product_fields">&nbsp;</td>
  135.     <td class="cancelCheck standard_refund_fields current-edit" style="display:none">
  136.         <input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="{$product['product_quantity_return']}" />
  137.         <input type="hidden" name="totalQty" id="totalQty" value="{$product['product_quantity']}" />
  138.         <input type="hidden" name="productName" id="productName" value="{$product['product_name']}" />
  139.     {if ((!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN')) AND (int)($product['product_quantity_return']) < (int)($product['product_quantity']))}
  140.         <input type="checkbox" name="id_order_detail[{$product['id_order_detail']}]" id="id_order_detail[{$product['id_order_detail']}]" value="{$product['id_order_detail']}" onchange="setCancelQuantity(this, {$product['id_order_detail']}, {$product['product_quantity'] - $product['customizationQuantityTotal'] - $product['product_quantity_return'] - $product['product_quantity_refunded']})" {if ($product['product_quantity_return'] + $product['product_quantity_refunded'] >= $product['product_quantity'])}disabled="disabled" {/if}/>
  141.     {else}
  142.         --
  143.     {/if}
  144.     </td>
  145.     <td class="cancelQuantity standard_refund_fields current-edit" style="display:none">
  146.     {if ($product['product_quantity_return'] + $product['product_quantity_refunded'] >= $product['product_quantity'])}
  147.         <input type="hidden" name="cancelQuantity[{$product['id_order_detail']}]" value="0" />
  148.     {elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))}
  149.         <input type="text" id="cancelQuantity_{$product['id_order_detail']}" name="cancelQuantity[{$product['id_order_detail']}]" onchange="checkTotalRefundProductQuantity(this)" value="" />
  150.     {/if}
  151.  
  152.     {if $product['customizationQuantityTotal']}
  153.         {assign var=productQuantity value=($product['product_quantity']-$product['customizationQuantityTotal'])}
  154.     {else}
  155.         {assign var=productQuantity value=$product['product_quantity']}
  156.     {/if}
  157.  
  158.     {if ($order->hasBeenDelivered())}
  159.         {$product['product_quantity_refunded']}/{$productQuantity-$product['product_quantity_refunded']}
  160.     {elseif ($order->hasBeenPaid())}
  161.         {$product['product_quantity_return']}/{$productQuantity}
  162.     {else}
  163.         0/{$productQuantity}
  164.     {/if}
  165.     </td>
  166.     <td class="partial_refund_fields current-edit" colspan="2" style="display:none; width: 250px;">
  167.         {if $product['quantity_refundable'] > 0}
  168.         {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
  169.             {assign var='amount_refundable' value=$product['amount_refundable']}
  170.         {else}
  171.             {assign var='amount_refundable' value=$product['amount_refundable_tax_incl']}
  172.         {/if}
  173.         <div class="form-group">
  174.             <div class="{if $product['amount_refundable'] > 0}col-lg-4{else}col-lg-12{/if}">
  175.                 <label class="control-label">
  176.                     {l s='Quantity:'}
  177.                 </label>
  178.                 <div class="input-group">
  179.                     <input onchange="checkPartialRefundProductQuantity(this)" type="text" name="partialRefundProductQuantity[{{$product['id_order_detail']}}]" value="0" />
  180.                     <div class="input-group-addon">/ {$product['quantity_refundable']}</div>
  181.                 </div>
  182.             </div>
  183.             <div class="{if $product['quantity_refundable'] > 0}col-lg-8{else}col-lg-12{/if}">
  184.                 <label class="control-label">
  185.                     <span class="title_box ">{l s='Amount:'}</span>
  186.                     <small class="text-muted">({$smarty.capture.TaxMethod})</small>
  187.                 </label>
  188.                 <div class="input-group">
  189.                     {if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
  190.                     <input onchange="checkPartialRefundProductAmount(this)" type="text" name="partialRefundProduct[{$product['id_order_detail']}]" />
  191.                     {if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign}</div>{/if}
  192.                 </div>
  193.                 <p class="help-block"><i class="icon-warning-sign"></i> {l s='(Max %s %s)' sprintf=[Tools::displayPrice(Tools::ps_round($amount_refundable, 2), $currency->id) , $smarty.capture.TaxMethod]}</p>
  194.             </div>
  195.         </div>
  196.         {/if}
  197.     </td>
  198.     {if ($can_edit && !$order->hasBeenDelivered())}
  199.     <td class="product_invoice" style="display: none;">
  200.         {if sizeof($invoices_collection)}
  201.         <select name="product_invoice" class="edit_product_invoice">
  202.             {foreach from=$invoices_collection item=invoice}
  203.             <option value="{$invoice->id}" {if $invoice->id == $product['id_order_invoice']}selected="selected"{/if}>
  204.                 #{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}
  205.             </option>
  206.             {/foreach}
  207.         </select>
  208.         {else}
  209.         &nbsp;
  210.         {/if}
  211.     </td>
  212.     <td class="product_action text-right">
  213.         {* edit/delete controls *}
  214.         <div class="btn-group">
  215.             <button type="button" class="btn btn-default edit_product_change_link">
  216.                 <i class="icon-pencil"></i>
  217.                 {l s='Edit'}
  218.             </button>
  219.             <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  220.                 <span class="caret"></span>
  221.             </button>
  222.             <ul class="dropdown-menu" role="menu">
  223.                 <li>
  224.                     <a href="#" class="delete_product_line">
  225.                         <i class="icon-trash"></i>
  226.                         {l s='Delete'}
  227.                     </a>
  228.                 </li>
  229.             </ul>
  230.         </div>
  231.         {* Update controls *}
  232.         <button type="button" class="btn btn-default submitProductChange" style="display: none;">
  233.             <i class="icon-ok"></i>
  234.             {l s='Update'}
  235.         </button>
  236.         <button type="button" class="btn btn-default cancel_product_change_link" style="display: none;">
  237.             <i class="icon-remove"></i>
  238.             {l s='Cancel'}
  239.         </button>
  240.     </td>
  241.     {/if}
  242. </tr>
  243. {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement