PageRenderTime 49ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/themes/default/order-detail.tpl

https://bitbucket.org/marcenuc/prestashop
Smarty Template | 423 lines | 391 code | 7 blank | 25 comment | 39 complexity | e0e329fb6eebfe62132a065546de1685 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0
  1. {*
  2. * 2007-2012 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-2012 PrestaShop SA
  22. * @version Release: $Revision: 6594 $
  23. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  24. * International Registered Trademark & Property of PrestaShop SA
  25. *}
  26. <form action="{if isset($opc) && $opc}{$link->getPageLink('order-opc', true)}{else}{$link->getPageLink('order', true)}{/if}" method="post" class="submit">
  27. <div>
  28. <input type="hidden" value="{$order->id}" name="id_order"/>
  29. <h4>
  30. <input type="submit" value="{l s='Reorder'}" name="submitReorder" class="button exclusive" />
  31. {l s='Order Reference %s - placed on' sprintf=$order->getUniqReference()} {dateFormat date=$order->date_add full=0}
  32. </h4>
  33. </div>
  34. </form>
  35. <div class="info-order">
  36. {if $carrier->id}<p><strong>{l s='Carrier:'}</strong> {if $carrier->name == "0"}{$shop_name|escape:'htmlall':'UTF-8'}{else}{$carrier->name|escape:'htmlall':'UTF-8'}{/if}</p>{/if}
  37. <p><strong>{l s='Payment method:'}</strong> <span class="color-myaccount">{$order->payment|escape:'htmlall':'UTF-8'}</span></p>
  38. {if $invoice AND $invoiceAllowed}
  39. <p>
  40. <img src="{$img_dir}icon/pdf.gif" alt="" class="icon" />
  41. <a target="_blank" href="{$link->getPageLink('pdf-invoice', true)}?id_order={$order->id|intval}{if $is_guest}&secure_key={$order->secure_key}{/if}">{l s='Download your invoice as a PDF file'}</a>
  42. </p>
  43. {/if}
  44. {if $order->recyclable}
  45. <p><img src="{$img_dir}icon/recyclable.gif" alt="" class="icon" />&nbsp;{l s='You have given permission to receive your order in recycled packaging.'}</p>
  46. {/if}
  47. {if $order->gift}
  48. <p><img src="{$img_dir}icon/gift.gif" alt="" class="icon" />&nbsp;{l s='You requested gift-wrapping for your order.'}</p>
  49. <p>{l s='Message:'} {$order->gift_message|nl2br}</p>
  50. {/if}
  51. </div>
  52. {if count($order_history)}
  53. <h3>{l s='Follow your order step-by-step'}</h3>
  54. <div class="table_block">
  55. <table class="detail_step_by_step std">
  56. <thead>
  57. <tr>
  58. <th class="first_item">{l s='Date'}</th>
  59. <th class="last_item">{l s='Status'}</th>
  60. </tr>
  61. </thead>
  62. <tbody>
  63. {foreach from=$order_history item=state name="orderStates"}
  64. <tr class="{if $smarty.foreach.orderStates.first}first_item{elseif $smarty.foreach.orderStates.last}last_item{/if} {if $smarty.foreach.orderStates.index % 2}alternate_item{else}item{/if}">
  65. <td>{dateFormat date=$state.date_add full=1}</td>
  66. <td>{$state.ostate_name|escape:'htmlall':'UTF-8'}</td>
  67. </tr>
  68. {/foreach}
  69. </tbody>
  70. </table>
  71. </div>
  72. {/if}
  73. {if isset($followup)}
  74. <p class="bold">{l s='Click the following link to track the delivery of your order'}</p>
  75. <a href="{$followup|escape:'htmlall':'UTF-8'}">{$followup|escape:'htmlall':'UTF-8'}</a>
  76. {/if}
  77. <div class="adresses_bloc clearfix">
  78. <br />
  79. <ul class="address item {if $order->isVirtual()}full_width{/if}">
  80. <li class="address_title">{l s='Billing'}</li>
  81. {foreach from=$inv_adr_fields name=inv_loop item=field_item}
  82. {if $field_item eq "company" && isset($address_invoice->company)}<li class="address_company">{$address_invoice->company|escape:'htmlall':'UTF-8'}</li>
  83. {elseif $field_item eq "address2" && $address_invoice->address2}<li class="address_address2">{$address_invoice->address2|escape:'htmlall':'UTF-8'}</li>
  84. {elseif $field_item eq "phone_mobile" && $address_invoice->phone_mobile}<li class="address_phone_mobile">{$address_invoice->phone_mobile|escape:'htmlall':'UTF-8'}</li>
  85. {else}
  86. {assign var=address_words value=" "|explode:$field_item}
  87. <li>{foreach from=$address_words item=word_item name="word_loop"}{if !$smarty.foreach.word_loop.first} {/if}<span class="address_{$word_item|replace:',':''}">{$invoiceAddressFormatedValues[$word_item|replace:',':'']|escape:'htmlall':'UTF-8'}</span>{/foreach}</li>
  88. {/if}
  89. {/foreach}
  90. </ul>
  91. <ul class="address alternate_item" {if $order->isVirtual()}style="display:none;"{/if}>
  92. <li class="address_title">{l s='Delivery'}</li>
  93. {foreach from=$dlv_adr_fields name=dlv_loop item=field_item}
  94. {if $field_item eq "company" && isset($address_delivery->company)}<li class="address_company">{$address_delivery->company|escape:'htmlall':'UTF-8'}</li>
  95. {elseif $field_item eq "address2" && $address_delivery->address2}<li class="address_address2">{$address_delivery->address2|escape:'htmlall':'UTF-8'}</li>
  96. {elseif $field_item eq "phone_mobile" && $address_delivery->phone_mobile}<li class="address_phone_mobile">{$address_delivery->phone_mobile|escape:'htmlall':'UTF-8'}</li>
  97. {else}
  98. {assign var=address_words value=" "|explode:$field_item}
  99. <li>{foreach from=$address_words item=word_item name="word_loop"}{if !$smarty.foreach.word_loop.first} {/if}<span class="address_{$word_item|replace:',':''}">{$deliveryAddressFormatedValues[$word_item|replace:',':'']|escape:'htmlall':'UTF-8'}</span>{/foreach}</li>
  100. {/if}
  101. {/foreach}
  102. </ul>
  103. </div>
  104. {$HOOK_ORDERDETAILDISPLAYED}
  105. {if !$is_guest}<form action="{$link->getPageLink('order-follow', true)}" method="post">{/if}
  106. <div id="order-detail-content" class="table_block">
  107. <table class="std">
  108. <thead>
  109. <tr>
  110. {if $return_allowed}<th class="first_item"><input type="checkbox" /></th>{/if}
  111. <th class="{if $return_allowed}item{else}first_item{/if}">{l s='Reference'}</th>
  112. <th class="item">{l s='Product'}</th>
  113. <th class="item">{l s='Quantity'}</th>
  114. {if $order->hasProductReturned()}
  115. <th class="item">{l s='Returned'}</th>
  116. {/if}
  117. <th class="item">{l s='Unit price'}</th>
  118. <th class="last_item">{l s='Total price'}</th>
  119. </tr>
  120. </thead>
  121. <tfoot>
  122. {if $priceDisplay && $use_tax}
  123. <tr class="item">
  124. <td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
  125. {l s='Total products (tax excl.):'} <span class="price">{displayWtPriceWithCurrency price=$order->getTotalProductsWithoutTaxes() currency=$currency}</span>
  126. </td>
  127. </tr>
  128. {/if}
  129. <tr class="item">
  130. <td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
  131. {l s='Total products'} {if $use_tax}{l s='(tax incl.)'}{/if}: <span class="price">{displayWtPriceWithCurrency price=$order->getTotalProductsWithTaxes() currency=$currency}</span>
  132. </td>
  133. </tr>
  134. {if $order->total_discounts > 0}
  135. <tr class="item">
  136. <td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
  137. {l s='Total vouchers:'} <span class="price-discount">{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1}</span>
  138. </td>
  139. </tr>
  140. {/if}
  141. {if $order->total_wrapping > 0}
  142. <tr class="item">
  143. <td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
  144. {l s='Total gift-wrapping:'} <span class="price-wrapping">{displayWtPriceWithCurrency price=$order->total_wrapping currency=$currency}</span>
  145. </td>
  146. </tr>
  147. {/if}
  148. <tr class="item">
  149. <td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
  150. {l s='Total shipping'} {if $use_tax}{l s='(tax incl.)'}{/if}: <span class="price-shipping">{displayWtPriceWithCurrency price=$order->total_shipping currency=$currency}</span>
  151. </td>
  152. </tr>
  153. <tr class="totalprice item">
  154. <td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
  155. {l s='Total:'} <span class="price">{displayWtPriceWithCurrency price=$order->total_paid currency=$currency}</span>
  156. </td>
  157. </tr>
  158. </tfoot>
  159. <tbody>
  160. {foreach from=$products item=product name=products}
  161. {if !isset($product.deleted)}
  162. {assign var='productId' value=$product.product_id}
  163. {assign var='productAttributeId' value=$product.product_attribute_id}
  164. {if isset($product.customizedDatas)}
  165. {assign var='productQuantity' value=$product.product_quantity-$product.customizationQuantityTotal}
  166. {else}
  167. {assign var='productQuantity' value=$product.product_quantity}
  168. {/if}
  169. <!-- Customized products -->
  170. {if isset($product.customizedDatas)}
  171. <tr class="item">
  172. {if $return_allowed}<td class="order_cb"></td>{/if}
  173. <td><label for="cb_{$product.id_order_detail|intval}">{if $product.product_reference}{$product.product_reference|escape:'htmlall':'UTF-8'}{else}--{/if}</label></td>
  174. <td class="bold">
  175. <label for="cb_{$product.id_order_detail|intval}">{$product.product_name|escape:'htmlall':'UTF-8'}</label>
  176. </td>
  177. <td><input class="order_qte_input" name="order_qte_input[{$smarty.foreach.products.index}]" type="text" size="2" value="{$product.customizationQuantityTotal|intval}" /><label for="cb_{$product.id_order_detail|intval}"><span class="order_qte_span editable">{$product.customizationQuantityTotal|intval}</span></label></td>
  178. {if $order->hasProductReturned()}
  179. <td>
  180. {$product['qty_returned']}
  181. </td>
  182. {/if}
  183. <td>
  184. <label for="cb_{$product.id_order_detail|intval}">
  185. {if $group_use_tax}
  186. {convertPriceWithCurrency price=$product.unit_price_tax_incl currency=$currency}
  187. {else}
  188. {convertPriceWithCurrency price=$product.unit_price_tax_excl currency=$currency}
  189. {/if}
  190. </label>
  191. </td>
  192. <td>
  193. <label for="cb_{$product.id_order_detail|intval}">
  194. {if isset($customizedDatas.$productId.$productAttributeId)}
  195. {if $group_use_tax}
  196. {convertPriceWithCurrency price=$product.total_customization_wt currency=$currency}
  197. {else}
  198. {convertPriceWithCurrency price=$product.total_customization currency=$currency}
  199. {/if}
  200. {else}
  201. {if $group_use_tax}
  202. {convertPriceWithCurrency price=$product.total_price_tax_incl currency=$currency}
  203. {else}
  204. {convertPriceWithCurrency price=$product.total_price_tax_excl currency=$currency}
  205. {/if}
  206. {/if}
  207. </label>
  208. </td>
  209. </tr>
  210. {foreach $product.customizedDatas as $customizationPerAddress}
  211. {foreach $customizationPerAddress as $customizationId => $customization}
  212. <tr class="alternate_item">
  213. {if $return_allowed}<td class="order_cb"><input type="checkbox" id="cb_{$product.id_order_detail|intval}" name="customization_ids[{$product.id_order_detail|intval}][]" value="{$customizationId|intval}" /></td>{/if}
  214. <td colspan="2">
  215. {foreach from=$customization.datas key='type' item='datas'}
  216. {if $type == $CUSTOMIZE_FILE}
  217. <ul class="customizationUploaded">
  218. {foreach from=$datas item='data'}
  219. <li><img src="{$pic_dir}{$data.value}_small" alt="" class="customizationUploaded" /></li>
  220. {/foreach}
  221. </ul>
  222. {elseif $type == $CUSTOMIZE_TEXTFIELD}
  223. <ul class="typedText">{counter start=0 print=false}
  224. {foreach from=$datas item='data'}
  225. {assign var='customizationFieldName' value="Text #"|cat:$data.id_customization_field}
  226. <li>{$data.name|default:$customizationFieldName} : {$data.value}</li>
  227. {/foreach}
  228. </ul>
  229. {/if}
  230. {/foreach}
  231. </td>
  232. <td>
  233. <input class="order_qte_input" name="customization_qty_input[{$customizationId|intval}]" type="text" size="2" value="{$customization.quantity|intval}" /><label for="cb_{$product.id_order_detail|intval}"><span class="order_qte_span editable">{$customization.quantity|intval}</span></label>
  234. </td>
  235. <td colspan="2"></td>
  236. </tr>
  237. {/foreach}
  238. {/foreach}
  239. {/if}
  240. <!-- Classic products -->
  241. {if $product.product_quantity > $product.customizationQuantityTotal}
  242. <tr class="item">
  243. {if $return_allowed}<td class="order_cb"><input type="checkbox" id="cb_{$product.id_order_detail|intval}" name="ids_order_detail[{$product.id_order_detail|intval}]" value="{$product.id_order_detail|intval}" /></td>{/if}
  244. <td><label for="cb_{$product.id_order_detail|intval}">{if $product.product_reference}{$product.product_reference|escape:'htmlall':'UTF-8'}{else}--{/if}</label></td>
  245. <td class="bold">
  246. <label for="cb_{$product.id_order_detail|intval}">
  247. {if $product.download_hash && $invoice && $product.display_filename != '' && $product.product_quantity_refunded == 0 && $product.product_quantity_return == 0}
  248. {if isset($is_guest) && $is_guest}
  249. <a href="{$link->getPageLink('get-file', true, NULL, "key={$product.filename|escape:'htmlall':'UTF-8'}-{$product.download_hash|escape:'htmlall':'UTF-8'}&amp;id_order={$order->id}&secure_key={$order->secure_key}")}" title="{l s='download this product'}">
  250. {else}
  251. <a href="{$link->getPageLink('get-file', true, NULL, "key={$product.filename|escape:'htmlall':'UTF-8'}-{$product.download_hash|escape:'htmlall':'UTF-8'}")}" title="{l s='download this product'}">
  252. {/if}
  253. <img src="{$img_dir}icon/download_product.gif" class="icon" alt="{l s='Download product'}" />
  254. </a>
  255. {if isset($is_guest) && $is_guest}
  256. <a href="{$link->getPageLink('get-file', true, NULL, "key={$product.filename|escape:'htmlall':'UTF-8'}-{$product.download_hash|escape:'htmlall':'UTF-8'}&id_order={$order->id}&secure_key={$order->secure_key}")}" title="{l s='download this product'}"> {$product.product_name|escape:'htmlall':'UTF-8'} </a>
  257. {else}
  258. <a href="{$link->getPageLink('get-file', true, NULL, "key={$product.filename|escape:'htmlall':'UTF-8'}-{$product.download_hash|escape:'htmlall':'UTF-8'}")}" title="{l s='download this product'}"> {$product.product_name|escape:'htmlall':'UTF-8'} </a>
  259. {/if}
  260. {else}
  261. {$product.product_name|escape:'htmlall':'UTF-8'}
  262. {/if}
  263. </label>
  264. </td>
  265. <td><input class="order_qte_input" name="order_qte_input[{$product.id_order_detail|intval}]" type="text" size="2" value="{$productQuantity|intval}" /><label for="cb_{$product.id_order_detail|intval}"><span class="order_qte_span editable">{$productQuantity|intval}</span></label></td>
  266. {if $order->hasProductReturned()}
  267. <td>
  268. {$product['qty_returned']}
  269. </td>
  270. {/if}
  271. <td>
  272. <label for="cb_{$product.id_order_detail|intval}">
  273. {if $group_use_tax}
  274. {convertPriceWithCurrency price=$product.unit_price_tax_incl currency=$currency}
  275. {else}
  276. {convertPriceWithCurrency price=$product.unit_price_tax_excl currency=$currency}
  277. {/if}
  278. </label>
  279. </td>
  280. <td>
  281. <label for="cb_{$product.id_order_detail|intval}">
  282. {if $group_use_tax}
  283. {convertPriceWithCurrency price=$product.total_price_tax_incl currency=$currency}
  284. {else}
  285. {convertPriceWithCurrency price=$product.total_price_tax_excl currency=$currency}
  286. {/if}
  287. </label>
  288. </td>
  289. </tr>
  290. {/if}
  291. {/if}
  292. {/foreach}
  293. {foreach from=$discounts item=discount}
  294. <tr class="item">
  295. <td>{$discount.name|escape:'htmlall':'UTF-8'}</td>
  296. <td>{l s='Voucher:'} {$discount.name|escape:'htmlall':'UTF-8'}</td>
  297. <td><span class="order_qte_span editable">1</span></td>
  298. <td>&nbsp;</td>
  299. <td>{if $discount.value != 0.00}-{/if}{convertPriceWithCurrency price=$discount.value currency=$currency}</td>
  300. {if $return_allowed}
  301. <td>&nbsp;</td>
  302. {/if}
  303. </tr>
  304. {/foreach}
  305. </tbody>
  306. </table>
  307. </div>
  308. <div class="table_block">
  309. {if $order->getShipping()|count > 0}
  310. <table class="std">
  311. <thead>
  312. <tr>
  313. <th class="first_item">{l s='Date'}</th>
  314. <th class="item">{l s='Carrier'}</th>
  315. <th class="item">{l s='Weight'}</th>
  316. <th class="item">{l s='Shipping cost'}</th>
  317. <th class="last_item">{l s='Tracking number'}</th>
  318. </tr>
  319. </thead>
  320. <tbody>
  321. {foreach from=$order->getShipping() item=line}
  322. <tr class="item">
  323. <td>{$line.date_add}</td>
  324. <td>{$line.state_name}</td>
  325. <td>{if $line.weight > 0}{$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')}{else}-{/if}</td>
  326. <td>{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}{displayPrice price=$line.shipping_cost_tax_incl currency=$currency->id}{else}{displayPrice price=$line.shipping_cost_tax_excl currency=$currency->id}{/if}</td>
  327. <td>
  328. <span id="shipping_number_show">{if $line.tracking_number}{if $line.url && $line.tracking_number}<a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>{else}{$line.tracking_number}{/if}{else}-{/if}</span>
  329. </td>
  330. </tr>
  331. {/foreach}
  332. </tbody>
  333. </table>
  334. {/if}
  335. </div>
  336. <br />
  337. {if !$is_guest}
  338. {if $return_allowed}
  339. <div id="returnOrderMessage">
  340. <h3>{l s='Merchandise return'}</h3>
  341. <p>{l s='If you wish to return one or more products, please mark the corresponding boxes and provide an explanation for the return. Then click the button below.'}</p>
  342. <p class="textarea">
  343. <textarea cols="67" rows="3" name="returnText"></textarea>
  344. </p>
  345. <p class="submit">
  346. <input type="submit" value="{l s='Make an RMA slip'}" name="submitReturnMerchandise" class="button_large" />
  347. <input type="hidden" class="hidden" value="{$order->id|intval}" name="id_order" />
  348. </p>
  349. </div>
  350. <br />
  351. {/if}
  352. </form>
  353. {if count($messages)}
  354. <h3>{l s='Messages'}</h3>
  355. <div class="table_block">
  356. <table class="detail_step_by_step std">
  357. <thead>
  358. <tr>
  359. <th class="first_item" style="width:150px;">{l s='From'}</th>
  360. <th class="last_item">{l s='Message'}</th>
  361. </tr>
  362. </thead>
  363. <tbody>
  364. {foreach from=$messages item=message name="messageList"}
  365. <tr class="{if $smarty.foreach.messageList.first}first_item{elseif $smarty.foreach.messageList.last}last_item{/if} {if $smarty.foreach.messageList.index % 2}alternate_item{else}item{/if}">
  366. <td>
  367. {if isset($message.elastname) && $message.elastname}
  368. {$message.efirstname|escape:'htmlall':'UTF-8'} {$message.elastname|escape:'htmlall':'UTF-8'}
  369. {elseif $message.clastname}
  370. {$message.cfirstname|escape:'htmlall':'UTF-8'} {$message.clastname|escape:'htmlall':'UTF-8'}
  371. {else}
  372. <b>{$shop_name|escape:'htmlall':'UTF-8'}</b>
  373. {/if}
  374. <br />
  375. {dateFormat date=$message.date_add full=1}
  376. </td>
  377. <td>{$message.message|escape:'htmlall':'UTF-8'|nl2br}</td>
  378. </tr>
  379. {/foreach}
  380. </tbody>
  381. </table>
  382. </div>
  383. {/if}
  384. {if isset($errors) && $errors}
  385. <div class="error">
  386. <p>{if $errors|@count > 1}{l s='There are %d errors' sprintf=$errors|@count}{else}{l s='There is %d error' sprintf=$errors|@count}{/if}</p>
  387. <ol>
  388. {foreach from=$errors key=k item=error}
  389. <li>{$error}</li>
  390. {/foreach}
  391. </ol>
  392. </div>
  393. {/if}
  394. <form action="{$link->getPageLink('order-detail', true)}" method="post" class="std" id="sendOrderMessage">
  395. <h3>{l s='Add a message:'}</h3>
  396. <p>{l s='If you would like to add a comment about your order, please write it below.'}</p>
  397. <p>
  398. <label for="id_product">{l s='Product'}</label>
  399. <select name="id_product" style="width:300px;">
  400. <option value="0">{l s='-- Choose --'}</option>
  401. {foreach from=$products item=product name=products}
  402. <option value="{$product.product_id}">{$product.product_name}</option>
  403. {/foreach}
  404. </select>
  405. </p>
  406. <p class="textarea">
  407. <textarea cols="67" rows="3" name="msgText"></textarea>
  408. </p>
  409. <p class="submit">
  410. <input type="hidden" name="id_order" value="{$order->id|intval}" />
  411. <input type="submit" class="button" name="submitMessage" value="{l s='Send'}"/>
  412. </p>
  413. </form>
  414. {else}
  415. <p><img src="{$img_dir}icon/infos.gif" alt="" class="icon" />&nbsp;{l s='You cannot make a merchandise return with a guest account'}</p>
  416. {/if}