// Shopping carts bootsrap design

This commit is contained in:
Jerome Nadaud committed 2013-09-20 10:29:32 +02:00
1 parent 724ab12122
commit 74a262f2ed
2 files changed
+86 -67

No files matched your search

@@ -26,69 +26,89 @@
{extends file="helpers/view/view.tpl"} {extends file="helpers/view/view.tpl"}
{block name="override_tpl"} {block name="override_tpl"}
<fieldset>
<div id="container-customer"> <div class="col-lg-3 box-stats color1">
<h2><img src="../img/admin/basket.png" /><span>{if $customer->id}{$customer->firstname} {$customer->lastname}{else}{l s='Guest'}{/if} - {l s='Cart #'}{$cart->id|string_format:"%06d"}</span><span style="color:#585A69;padding-left:10px;">{l s='On'} {$cart->date_upd}</span></h2> <i class="icon-shopping-cart"></i><span class="title">{l s='Cart #%06d'|sprintf:$cart->id}<br/><small>{if $customer->id}{$customer->firstname} {$customer->lastname}{else}{l s='Guest'}{/if} {l s='On'} {$cart->date_upd}</small></span>
<div class="separation"></div> <span class="value">{displayWtPriceWithCurrency price=$total_price currency=$currency}</span>
</div>
<div class="info-customer-left"> </fieldset>
<h2><img src="../img/admin/vcard.png" />{l s='Customer information'}</h2> <div class="row">
<span style="font-size: 14px;"> <div class="col-lg-6">
<fieldset>
<h3><i class="icon-user"></i> {l s='Customer information'}</h3>
{if $customer->id} {if $customer->id}
<a href="{$link->getAdminLink('AdminCustomers')|escape:'htmlall':'UTF-8'}&id_customer={$customer->id}&viewcustomer">{$customer->firstname} {$customer->lastname}</a></span> <a class="btn btn-default pull-right" href="mailto:{$customer->email}"><i class="icon-envelope"></i> {$customer->email}</a>
{l s='#'}{$customer->id}<br /> <h2>
<a style="text-decoration: underline; color:#268CCD;" href="mailto:{$customer->email}">{$customer->email}</a> <br /><br /> {if $customer->id_gender == 1}
{l s='Account registration date:'} {dateFormat date=$customer->date_add}<br /> <i class="icon-male"></i>
{l s='Valid orders placed:'} <b>{$customer_stats.nb_orders}</b><br /> {elseif $customer->id_gender == 2}
{l s='Total spent since registration:'} <b>{displayWtPriceWithCurrency price=$customer_stats.total_orders currency=$currency}</b><br /> <i class="icon-female"></i>
{else} {else}
{l s='Guest not registered'} <i class="icon-question"></i>
{/if} {/if}
</span> <a href="{$link->getAdminLink('AdminCustomers')|escape:'htmlall':'UTF-8'}&id_customer={$customer->id}&viewcustomer">{$customer->firstname} {$customer->lastname}</a></h2>
<div class="form-horizontal">
<div class="form-group">
<label class="col-lg-3 control-label">{l s='Account registration date:'}</label>
<div class="col-lg-3"><p class="form-control-static">{dateFormat date=$customer->date_add}</p></div>
</div> </div>
<div class="info-customer-right"> <div class="form-group">
<h2><img src="../img/admin/cart.gif" /> {l s='Order information'}</h2> <label class="col-lg-3 control-label">{l s='Valid orders placed:'}</label>
<span> <div class="col-lg-3"><p class="form-control-static">{$customer_stats.nb_orders}</p></div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">{l s='Total spent since registration:'}</label>
<div class="col-lg-3"><p class="form-control-static">{displayWtPriceWithCurrency price=$customer_stats.total_orders currency=$currency}</p></div>
</div>
</div>
{else}
<h2>{l s='Guest not registered'}</h2>
{/if}
</fieldset>
</div>
<div class="col-lg-6">
<fieldset>
<h3><i class="icon-shopping-cart"></i> {l s='Order information'}</h3>
{if $order->id} {if $order->id}
<a href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&id_order={$order->id}&vieworder"> {l s='Order #%d' sprintf=$order->id|string_format:"%06d"}</a></span> <h2><a href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&id_order={$order->id}&vieworder"> {l s='Order #%d' sprintf=$order->id|string_format:"%06d"}</a></h2>
<br /><br /> {l s='Made on:'} {dateFormat date=$order->date_add}
{l s='Made on:'} {dateFormat date=$order->date_add}<br /><br /><br /><br />
{else} {else}
{l s='No order was created from this cart.'}</span> <h2>{l s='No order was created from this cart.'}</h2>
{if $customer->id}<p><a class="button" href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&id_cart={$cart->id}&addorder">{l s='Create an order from this cart.'}</a></p>{/if} {if $customer->id}
<a class="btn btn-default" href="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&id_cart={$cart->id}&addorder"><i class="icon-shopping-cart"></i> {l s='Create an order from this cart.'}</a>
{/if} {/if}
{/if}
</fieldset>
</div> </div>
<br style="clear:both;" /> </div>
<div class="separation"></div> <fieldset>
<h3><i class="icon-archive"></i> {l s='Cart summary'}</h3>
<table class="table" id="orderProducts">
<h2><img src="../img/admin/cart.gif" alt="{l s='Products:'}" />{l s='Cart summary'}</h2>
<br/>
<table style="width:100%;" cellspacing="0" cellpadding="0" class="table" id="orderProducts">
<thead> <thead>
<tr> <tr>
<th height="39" align="center" style="width: 60px">&nbsp;</th> <th class="fixed-width-xs">&nbsp;</th>
<th>{l s='Product'}</th> <th><span class="title_box">{l s='Product'}</span></th>
<th style="width: 80px; text-align: center">{l s='Unit price'}</th> <th class="text-right fixed-width-md"><span class="title_box">{l s='Unit price'}</span></th>
<th style="width: 20px; text-align: center">{l s='Quantity'}</th> <th class="text-center fixed-width-md"><span class="title_box">{l s='Quantity'}</span></th>
<th style="width: 30px; text-align: center">{l s='Stock'}</th> <th class="text-center fixed-width-sm"><span class="title_box">{l s='Stock'}</span></th>
<th style="width: 90px; text-align: right; font-weight:bold;">{l s='Total'}</th> <th class="text-right fixed-width-sm"><span class="title_box">{l s='Total'}</span></th>
</tr> </tr>
</thead>
<tbody> <tbody>
{foreach from=$products item='product'} {foreach from=$products item='product'}
{if isset($customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery])} {if isset($customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery])}
<tr> <tr>
<td align="center">{$product.image}</td> <td>{$product.image}</td>
<td><a href="{$link->getAdminLink('AdminProducts')|escape:'htmlall':'UTF-8'}&id_product={$product.id_product}&updateproduct"> <td><a href="{$link->getAdminLink('AdminProducts')|escape:'htmlall':'UTF-8'}&id_product={$product.id_product}&updateproduct">
<span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br /> <span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br />
{if $product.reference}{l s='Ref:'} {$product.reference}{/if} {if $product.reference}{l s='Ref:'} {$product.reference}{/if}
{if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if} {if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if}
</a> </a>
</td> </td>
<td align="center">{displayWtPriceWithCurrency price=$product.price_wt currency=$currency}</td> <td class="text-right">{displayWtPriceWithCurrency price=$product.price_wt currency=$currency}</td>
<td align="center" class="productQuantity">{$product.customization_quantity}</td> <td class="text-center">{$product.customization_quantity}</td>
<td align="center" class="productQuantity">{$product.qty_in_stock}</td> <td class="text-center">{$product.qty_in_stock}</td>
<td align="right">{displayWtPriceWithCurrency price=$product.total_customization_wt currency=$currency}</td> <td class="text-right">{displayWtPriceWithCurrency price=$product.total_customization_wt currency=$currency}</td>
</tr> </tr>
{foreach from=$customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery] item='customization'} {foreach from=$customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery] item='customization'}
<tr> <tr>
@@ -112,17 +132,17 @@
{/if} {/if}
{/foreach} {/foreach}
</td> </td>
<td align="center"></td> <td></td>
<td align="center" class="productQuantity">{$customization.quantity}</td> <td class="text-center">{$customization.quantity}</td>
<td align="center" class="productQuantity"></td> <td></td>
<td align="center"></td> <td></td>
</tr> </tr>
{/foreach} {/foreach}
{/if} {/if}
{if $product.cart_quantity > $product.customization_quantity} {if $product.cart_quantity > $product.customization_quantity}
<tr> <tr>
<td align="center">{$product.image}</td> <td>{$product.image}</td>
<td> <td>
<a href="{$link->getAdminLink('AdminProducts')|escape:'htmlall':'UTF-8'}&id_product={$product.id_product}&updateproduct"> <a href="{$link->getAdminLink('AdminProducts')|escape:'htmlall':'UTF-8'}&id_product={$product.id_product}&updateproduct">
<span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br /> <span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br />
@@ -130,40 +150,40 @@
{if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if} {if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if}
</a> </a>
</td> </td>
<td align="center">{displayWtPriceWithCurrency price=$product.product_price currency=$currency}</td> <td class="text-right">{displayWtPriceWithCurrency price=$product.product_price currency=$currency}</td>
<td align="center" class="productQuantity">{math equation='x - y' x=$product.cart_quantity y=$product.customization_quantity|intval}</td> <td class="text-center">{math equation='x - y' x=$product.cart_quantity y=$product.customization_quantity|intval}</td>
<td align="center" class="productQuantity">{$product.qty_in_stock}</td> <td class="text-center">{$product.qty_in_stock}</td>
<td align="right">{displayWtPriceWithCurrency price=$product.product_total currency=$currency}</td> <td class="text-right">{displayWtPriceWithCurrency price=$product.product_total currency=$currency}</td>
</tr> </tr>
{/if} {/if}
{/foreach} {/foreach}
<tr class="cart_total_product"> <tr>
<td colspan="5">{l s='Total cost of products:'}</td> <td colspan="5">{l s='Total cost of products:'}</td>
<td class="price bold right">{displayWtPriceWithCurrency price=$total_products currency=$currency}</td> <td class="text-right">{displayWtPriceWithCurrency price=$total_products currency=$currency}</td>
</tr> </tr>
{if $total_discounts != 0} {if $total_discounts != 0}
<tr class="cart_total_voucher"> <tr>
<td colspan="5">{l s='Total value of vouchers:'}</td> <td colspan="5">{l s='Total value of vouchers:'}</td>
<td class="price-discount bold right">{displayWtPriceWithCurrency price=$total_discounts currency=$currency}</td> <td class="text-right">{displayWtPriceWithCurrency price=$total_discounts currency=$currency}</td>
</tr> </tr>
{/if} {/if}
{if $total_wrapping > 0} {if $total_wrapping > 0}
<tr class="cart_total_voucher"> <tr>
<td colspan="5">{l s='Total cost of gift wrapping:'}</td> <td colspan="5">{l s='Total cost of gift wrapping:'}</td>
<td class="price-discount bold right">{displayWtPriceWithCurrency price=$total_wrapping currency=$currency}</td> <td class="text-right">{displayWtPriceWithCurrency price=$total_wrapping currency=$currency}</td>
</tr> </tr>
{/if} {/if}
{if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0} {if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0}
<tr class="cart_total_delivery"> <tr>
<td colspan="5">{l s='Total cost of shipping:'}</td> <td colspan="5">{l s='Total cost of shipping:'}</td>
<td class="price bold right">{displayWtPriceWithCurrency price=$total_shipping currency=$currency}</td> <td class="text-right">{displayWtPriceWithCurrency price=$total_shipping currency=$currency}</td>
</tr> </tr>
{/if} {/if}
<tr class="cart_total_price"> <tr>
<td colspan="5" class="bold">{l s='Total:'}</td> <td colspan="5" class=" success"><strong>{l s='Total:'}</strong></td>
<td class="price bold right">{displayWtPriceWithCurrency price=$total_price currency=$currency}</td> <td class="text-right success"><strong>{displayWtPriceWithCurrency price=$total_price currency=$currency}</strong></td>
</tr> </tr>
</tbody>
</table> </table>
{if $discounts} {if $discounts}
@@ -180,11 +200,9 @@
{/foreach} {/foreach}
</table> </table>
{/if} {/if}
<div style="float:left; margin-top:15px;"> <div class="alert alert-warning">
{l s='For this particular customer group, prices are displayed as:'} <b>{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC}{l s='Tax excluded'}{else}{l s='Tax included'}{/if}</b> {l s='For this particular customer group, prices are displayed as:'} <b>{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC}{l s='Tax excluded'}{else}{l s='Tax included'}{/if}</b>
</div> </div>
<div class="clear" style="height:20px;">&nbsp;</div> <div class="clear" style="height:20px;">&nbsp;</div>
{/block} {/block}
</fieldset>
</div>
@@ -115,6 +115,7 @@ class AdminCartsControllerCore extends AdminController
$this->context->cart = $cart; $this->context->cart = $cart;
$this->context->currency = $currency; $this->context->currency = $currency;
$this->context->customer = $customer; $this->context->customer = $customer;
$this->toolbar_title = sprintf($this->l('Cart #%06d'), $this->context->cart->id);
$products = $cart->getProducts(); $products = $cart->getProducts();
$customized_datas = Product::getAllCustomizedDatas((int)$cart->id); $customized_datas = Product::getAllCustomizedDatas((int)$cart->id);
Product::addCustomizationPrice($products, $customized_datas); Product::addCustomizationPrice($products, $customized_datas);