From 74a262f2ed488948213bf12fc80ef03937d8466e Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Fri, 20 Sep 2013 10:29:32 +0200 Subject: [PATCH] // Shopping carts bootsrap design --- .../controllers/carts/helpers/view/view.tpl | 286 ++++++++++-------- controllers/admin/AdminCartsController.php | 1 + 2 files changed, 153 insertions(+), 134 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl index 514dcaa75..c2dd60105 100755 --- a/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl @@ -26,148 +26,168 @@ {extends file="helpers/view/view.tpl"} {block name="override_tpl"} - -
-

{if $customer->id}{$customer->firstname} {$customer->lastname}{else}{l s='Guest'}{/if} - {l s='Cart #'}{$cart->id|string_format:"%06d"}{l s='On'} {$cart->date_upd}

-
- -
-

{l s='Customer information'}

- - {if $customer->id} - {$customer->firstname} {$customer->lastname} - {l s='#'}{$customer->id}
- {$customer->email}

- {l s='Account registration date:'} {dateFormat date=$customer->date_add}
- {l s='Valid orders placed:'} {$customer_stats.nb_orders}
- {l s='Total spent since registration:'} {displayWtPriceWithCurrency price=$customer_stats.total_orders currency=$currency}
- {else} - {l s='Guest not registered'} - {/if} - +
+
+ {l s='Cart #%06d'|sprintf:$cart->id}
{if $customer->id}{$customer->firstname} {$customer->lastname}{else}{l s='Guest'}{/if} {l s='On'} {$cart->date_upd}
+ {displayWtPriceWithCurrency price=$total_price currency=$currency}
-
-

{l s='Order information'}

- - {if $order->id} - {l s='Order #%d' sprintf=$order->id|string_format:"%06d"} -

- {l s='Made on:'} {dateFormat date=$order->date_add}



- {else} - {l s='No order was created from this cart.'} - {if $customer->id}

{l s='Create an order from this cart.'}

{/if} - {/if} +
+
+
+
+

{l s='Customer information'}

+ {if $customer->id} + {$customer->email} +

+ {if $customer->id_gender == 1} + + {elseif $customer->id_gender == 2} + + {else} + + {/if} + {$customer->firstname} {$customer->lastname}

+
+
+ +

{dateFormat date=$customer->date_add}

+
+
+ +

{$customer_stats.nb_orders}

+
+
+ +

{displayWtPriceWithCurrency price=$customer_stats.total_orders currency=$currency}

+
+
+ {else} +

{l s='Guest not registered'}

+ {/if} +
-
-
- - -

{l s='Products:'}{l s='Cart summary'}

-
- - - - - - - - - - - - {foreach from=$products item='product'} - {if isset($customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery])} +
+
+

{l s='Order information'}

+ {if $order->id} +

{l s='Order #%d' sprintf=$order->id|string_format:"%06d"}

+ {l s='Made on:'} {dateFormat date=$order->date_add} + {else} +

{l s='No order was created from this cart.'}

+ {if $customer->id} + {l s='Create an order from this cart.'} + {/if} + {/if} +
+
+ +
+

{l s='Cart summary'}

+
 {l s='Product'}{l s='Unit price'}{l s='Quantity'}{l s='Stock'}{l s='Total'}
+ - - + + + + + + + + + {foreach from=$products item='product'} + {if isset($customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery])} + + + + + + + + + {foreach from=$customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery] item='customization'} + + + + + + + + {/foreach} + {/if} + + {if $product.cart_quantity > $product.customization_quantity} + + + - - - - - - {foreach from=$customized_datas[$product.id_product][$product.id_product_attribute][$product.id_address_delivery] item='customization'} - - - - - - - - {/foreach} - {/if} - - {if $product.cart_quantity > $product.customization_quantity} - - - - - - - - - {/if} - {/foreach} - - - - - - {if $total_discounts != 0} - + + + + + + + + {/if} + {/foreach} + + + + + {if $total_discounts != 0} + - + - {/if} - {if $total_wrapping > 0} - + {/if} + {if $total_wrapping > 0} + - + - {/if} - {if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0} - + {/if} + {if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0} + - + - {/if} - - - - + {/if} + + + + +
{$product.image} - {$product.name}{if isset($product.attributes)}
{$product.attributes}{/if}
+
 {l s='Product'}{l s='Unit price'}{l s='Quantity'}{l s='Stock'}{l s='Total'}
{$product.image} + {$product.name}{if isset($product.attributes)}
{$product.attributes}{/if}
+ {if $product.reference}{l s='Ref:'} {$product.reference}{/if} + {if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if} +
+
{displayWtPriceWithCurrency price=$product.price_wt currency=$currency}{$product.customization_quantity}{$product.qty_in_stock}{displayWtPriceWithCurrency price=$product.total_customization_wt currency=$currency}
+ {foreach from=$customization.datas key='type' item='datas'} + {if $type == constant('Product::CUSTOMIZE_FILE')} +
    + {foreach from=$datas key='index' item='data'} +
  • + + +
  • + {/foreach} +
+ {elseif $type == constant('Product::CUSTOMIZE_TEXTFIELD')} +
    + {foreach from=$datas key='index' item='data'} +
  • {if $data.name}{$data.name}{else}{l s='Text #'}{$index}{/if}{l s=':'}{$data.value}
  • + {/foreach} +
+ {/if} + {/foreach} +
{$customization.quantity}
{$product.image} + + {$product.name}{if isset($product.attributes)}
{$product.attributes}{/if}
{if $product.reference}{l s='Ref:'} {$product.reference}{/if} {if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if} -
-
{displayWtPriceWithCurrency price=$product.price_wt currency=$currency}{$product.customization_quantity}{$product.qty_in_stock}{displayWtPriceWithCurrency price=$product.total_customization_wt currency=$currency}
- {foreach from=$customization.datas key='type' item='datas'} - {if $type == constant('Product::CUSTOMIZE_FILE')} -
    - {foreach from=$datas key='index' item='data'} -
  • - - -
  • - {/foreach} -
- {elseif $type == constant('Product::CUSTOMIZE_TEXTFIELD')} -
    - {foreach from=$datas key='index' item='data'} -
  • {if $data.name}{$data.name}{else}{l s='Text #'}{$index}{/if}{l s=':'}{$data.value}
  • - {/foreach} -
- {/if} - {/foreach} -
{$customization.quantity}
{$product.image} - - {$product.name}{if isset($product.attributes)}
{$product.attributes}{/if}
- {if $product.reference}{l s='Ref:'} {$product.reference}{/if} - {if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if} -
-
{displayWtPriceWithCurrency price=$product.product_price currency=$currency}{math equation='x - y' x=$product.cart_quantity y=$product.customization_quantity|intval}{$product.qty_in_stock}{displayWtPriceWithCurrency price=$product.product_total currency=$currency}
{l s='Total cost of products:'}{displayWtPriceWithCurrency price=$total_products currency=$currency}
{displayWtPriceWithCurrency price=$product.product_price currency=$currency}{math equation='x - y' x=$product.cart_quantity y=$product.customization_quantity|intval}{$product.qty_in_stock}{displayWtPriceWithCurrency price=$product.product_total currency=$currency}
{l s='Total cost of products:'}{displayWtPriceWithCurrency price=$total_products currency=$currency}
{l s='Total value of vouchers:'}{displayWtPriceWithCurrency price=$total_discounts currency=$currency}{displayWtPriceWithCurrency price=$total_discounts currency=$currency}
{l s='Total cost of gift wrapping:'}{displayWtPriceWithCurrency price=$total_wrapping currency=$currency}{displayWtPriceWithCurrency price=$total_wrapping currency=$currency}
{l s='Total cost of shipping:'}{displayWtPriceWithCurrency price=$total_shipping currency=$currency}{displayWtPriceWithCurrency price=$total_shipping currency=$currency}
{l s='Total:'}{displayWtPriceWithCurrency price=$total_price currency=$currency}
{l s='Total:'}{displayWtPriceWithCurrency price=$total_price currency=$currency}
{if $discounts} - +
@@ -180,11 +200,9 @@ {/foreach}
{l s='Discounts'}{l s='Discount name'} {l s='Value'}
{/if} -
- {l s='For this particular customer group, prices are displayed as:'} {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC}{l s='Tax excluded'}{else}{l s='Tax included'}{/if} -
- +
+ {l s='For this particular customer group, prices are displayed as:'} {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC}{l s='Tax excluded'}{else}{l s='Tax included'}{/if} +
 
{/block} - -
\ No newline at end of file + \ No newline at end of file diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index 13ae6ac5c..4c09dd3df 100755 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -115,6 +115,7 @@ class AdminCartsControllerCore extends AdminController $this->context->cart = $cart; $this->context->currency = $currency; $this->context->customer = $customer; + $this->toolbar_title = sprintf($this->l('Cart #%06d'), $this->context->cart->id); $products = $cart->getProducts(); $customized_datas = Product::getAllCustomizedDatas((int)$cart->id); Product::addCustomizationPrice($products, $customized_datas);