From 1f4170b5a00a7c340fa23db6fd9edfb7221e9f74 Mon Sep 17 00:00:00 2001 From: rGaillard Date: Fri, 28 Oct 2011 15:31:58 +0000 Subject: [PATCH] // Update AdminCartsController --- admin-dev/themes/template/carts/view.tpl | 185 +++++++++++++++++++++++ classes/AdminController.php | 6 +- classes/Controller.php | 5 + 3 files changed, 195 insertions(+), 1 deletion(-) create mode 100755 admin-dev/themes/template/carts/view.tpl diff --git a/admin-dev/themes/template/carts/view.tpl b/admin-dev/themes/template/carts/view.tpl new file mode 100755 index 000000000..c4c590ce2 --- /dev/null +++ b/admin-dev/themes/template/carts/view.tpl @@ -0,0 +1,185 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9596 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

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

+ +
+
+
+ {l s='Customer information'} + + {if $customer->id} + getAdminLink('AdminCustomers')}&id_customer={$customer->id}&viewcustomer">{$customer->firstname} {$customer->lastname} {l s='#'}{$customer->id}
+ {$customer->email}

+ {l s='Account registered:'} {dateFormat date=$customer->date_add}
+ {l s='Valid orders placed:'} {$customer_stats.nb_orders}
+ {l s='Total paid since registration:'} {displayWtPriceWithCurrency price=$customer_stats.total_orders currency=$currency}
+ {else} + {l s='Guest not registered'} + {/if} + +
+
+
+
+ {l s='Order information'} + + {if $order->id} + {l s='Order #'}{$order->id|string_format:"%06d"} +

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



+ {else} + {l s='No order created from this cart'} +

{l s='Create an order with this cart'}

+ {/if} +
+
+
+
+{l s='Products'}{l s='Cart summary'} +
+ + + + + + + + + + + + {foreach from=$products item='product'} + {if isset($customized_datas[$product.id_product][$product.id_product_attribute])} + + + + + + + + + {foreach from=$customized_datas[$product.id_product][$product.id_product_attribute] item='customization'} + + + + + + + + {/foreach} + {/if} + + {if $product.cart_quantity > $product.customizationQuantityTotal} + + + + + + + + + {/if} + {/foreach} + + + + + + {if $total_discounts != 0} + + + + + {/if} + {if $total_wrapping > 0} + + + + + {/if} + {if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0} + + + + + {/if} + + + + +
 {l s='Product'}{l s='UP'}{l s='Qty'}{l s='Stock'}{l s='Total'}
{$product.image} + {$product.name}{if isset($product.attributes)}
{$product.attributes}{/if}
+ {if $product.reference}$this->l('Ref:') {$product.reference}{/if} + {if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if} +
+
{displayWtPriceWithCurrency price=$product.price_wt currency=$currency}{$product.customizationQuantityTotal}{$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 #'}{$smarty.foreach.count.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.customizationQuantityTotal}{$product.qty_in_stock}{displayWtPriceWithCurrency price=$product.product_total currency=$currency}
{l s='Total products:'}{displayWtPriceWithCurrency price=$total_products currency=$currency}
{l s='Total vouchers:'}{displayWtPriceWithCurrency price=$total_discounts currency=$currency}
{l s='Total gift-wrapping:'}{displayWtPriceWithCurrency price=$total_wrapping currency=$currency}
{l s='Total shipping:'}{displayWtPriceWithCurrency price=$total_shipping currency=$currency}
{l s='Total:'}{displayWtPriceWithCurrency price=$total_price currency=$currency}
+ +{if $discounts} + + + + + + {foreach from=$discounts item='discount'} + + + + + {/foreach} +
{l s='Discounts'}{l s='Discount name'}{l s='Value'}
{$discount.name}- {displayWtPriceWithCurrency price=$discount.value_real currency=$currency}
+{/if} +
+{l s='According to the group of this customer, prices are printed:'} {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC}{l s='tax excluded'}{else}{l s='tax included'}{/if} +
+ +
+
 
diff --git a/classes/AdminController.php b/classes/AdminController.php index 5059bc38b..e698cd76f 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -38,7 +38,6 @@ class AdminControllerCore extends Controller public $default_form_language; public $allow_employee_form_lang; - public $content_only = false; public $layout = 'layout.tpl'; public $meta_title = 'Administration panel'; @@ -825,7 +824,11 @@ class AdminControllerCore extends Controller // new smarty : template_dir is an array. // @todo : add override path to the smarty config, and checking all array item if (file_exists($this->context->smarty->template_dir[0].'/'.$tpl_action)) + { + if (method_exists($this, $this->display.Tools::toCamelCase($this->className))) + $this->{$this->display.Tools::toCamelCase($this->className)}(); $this->context->smarty->assign('content', $this->context->smarty->fetch($tpl_action)); + } // Check if content template has been override if (file_exists($this->context->smarty->template_dir[0].'/'.$tpl)) @@ -1324,6 +1327,7 @@ class AdminControllerCore extends Controller { $this->display_header = false; $this->display_footer = false; + $this->content_only = true; } $this->context->currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); diff --git a/classes/Controller.php b/classes/Controller.php index ea5e46a79..5497ae2de 100644 --- a/classes/Controller.php +++ b/classes/Controller.php @@ -59,6 +59,11 @@ abstract class ControllerCore * @var string check if footer will be displayed */ protected $display_footer; + + /** + * @var string check if only content will be displayed + */ + protected $content_only = false; /** * @var bool If ajax parameter is detected in request, set this flag to true