// fix bug view.tpl in AdminCartsController PSFV-94

This commit is contained in:
lLefevre
2011-11-10 16:33:38 +00:00
parent 4d0719d8f7
commit 381eafdbc4
3 changed files with 176 additions and 167 deletions
+28 -23
View File
@@ -24,11 +24,15 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<h2>{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}</h2> {extends file="helper/view/view.tpl"}
<br /> {block name="override_tpl"}
<div style="float: left;">
<fieldset style="width: 400px"> <h2>{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}</h2>
<br />
<div style="float: left;">
<fieldset style="width: 400px">
<legend><img src="../img/admin/tab-customers.gif" />{l s='Customer information'}</legend> <legend><img src="../img/admin/tab-customers.gif" />{l s='Customer information'}</legend>
<span style="font-weight: bold; font-size: 14px;"> <span style="font-weight: bold; font-size: 14px;">
{if $customer->id} {if $customer->id}
@@ -41,10 +45,10 @@
{l s='Guest not registered'} {l s='Guest not registered'}
{/if} {/if}
</span> </span>
</fieldset> </fieldset>
</div> </div>
<div style="float: left; margin-left: 40px"> <div style="float: left; margin-left: 40px">
<fieldset style="width: 400px"> <fieldset style="width: 400px">
<legend><img src="../img/admin/cart.gif" /> {l s='Order information'}</legend> <legend><img src="../img/admin/cart.gif" /> {l s='Order information'}</legend>
<span style="font-weight: bold; font-size: 14px;"> <span style="font-weight: bold; font-size: 14px;">
{if $order->id} {if $order->id}
@@ -55,12 +59,12 @@
{l s='No order created from this cart'}</span> {l s='No order created from this cart'}</span>
<p><a href="{$link->getAdminLink('AdminOrders')}&id_cart={$cart->id}&addorder">{l s='Create an order with this cart'}</a></p> <p><a href="{$link->getAdminLink('AdminOrders')}&id_cart={$cart->id}&addorder">{l s='Create an order with this cart'}</a></p>
{/if} {/if}
</fieldset> </fieldset>
</div> </div>
<br style="clear:both;" /> <br style="clear:both;" />
<fieldset style="margin-top:25px; width: 715px; "> <fieldset style="margin-top:25px; width: 715px; ">
<legend><img src="../img/admin/cart.gif" alt="{l s='Products'}" />{l s='Cart summary'}</legend> <legend><img src="../img/admin/cart.gif" alt="{l s='Products'}" />{l s='Cart summary'}</legend>
<div style="float:left;"> <div style="float:left;">
<table style="width: 700px;" cellspacing="0" cellpadding="0" class="table" id="orderProducts"> <table style="width: 700px;" cellspacing="0" cellpadding="0" class="table" id="orderProducts">
<thead> <thead>
<tr> <tr>
@@ -161,9 +165,9 @@
<td colspan="5" class="bold">{l s='Total:'}</td> <td colspan="5" class="bold">{l s='Total:'}</td>
<td class="price bold right">{displayWtPriceWithCurrency price=$total_price currency=$currency}</td> <td class="price bold right">{displayWtPriceWithCurrency price=$total_price currency=$currency}</td>
</tr> </tr>
</table> </table>
{if $discounts} {if $discounts}
<table cellspacing="0" cellpadding="0" class="table" style="width:280px; margin:15px 0px 0px 420px;"> <table cellspacing="0" cellpadding="0" class="table" style="width:280px; margin:15px 0px 0px 420px;">
<tr> <tr>
<th><img src="../img/admin/coupon.gif" alt="{l s='Discounts'}" />{l s='Discount name'}</th> <th><img src="../img/admin/coupon.gif" alt="{l s='Discounts'}" />{l s='Discount name'}</th>
@@ -175,11 +179,12 @@
<td align="center">- {displayWtPriceWithCurrency price=$discount.value_real currency=$currency}</td> <td align="center">- {displayWtPriceWithCurrency price=$discount.value_real currency=$currency}</td>
</tr> </tr>
{/foreach} {/foreach}
</table> </table>
{/if} {/if}
<div style="float:left; margin-top:15px;"> <div style="float:left; margin-top:15px;">
{l s='According to the group of this customer, prices are printed:'} <b>{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC}{l s='tax excluded'}{else}{l s='tax included'}{/if}</b> {l s='According to the group of this customer, prices are printed:'} <b>{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC}{l s='tax excluded'}{else}{l s='tax included'}{/if}</b>
</div></div> </div></div>
</fieldset> </fieldset>
<div class="clear" style="height:20px;">&nbsp;</div> <div class="clear" style="height:20px;">&nbsp;</div>
{/block}
+2 -1
View File
@@ -54,7 +54,8 @@ class HelperViewCore extends Helper
'table' => $this->table, 'table' => $this->table,
'show_toolbar' => $this->show_toolbar, 'show_toolbar' => $this->show_toolbar,
'toolbar_fix' => $this->toolbar_fix, 'toolbar_fix' => $this->toolbar_fix,
'toolbar_btn' => $this->toolbar_btn 'toolbar_btn' => $this->toolbar_btn,
'link' => $this->context->link
)); ));
return parent::generate(); return parent::generate();
+6 -3
View File
@@ -99,7 +99,7 @@ class AdminCartsController extends AdminController
parent::__construct(); parent::__construct();
} }
public function viewCart() public function initView()
{ {
if (!($cart = $this->loadObject(true))) if (!($cart = $this->loadObject(true)))
return; return;
@@ -157,7 +157,8 @@ class AdminCartsController extends AdminController
$imageProduct = new Image($image['id_image']); $imageProduct = new Image($image['id_image']);
$product['image'] = (isset($image['id_image']) ? cacheImage(_PS_IMG_DIR_.'p/'.$imageProduct->getExistingImgPath().'.jpg', 'product_mini_'.(int)($product['id_product']).(isset($product['id_product_attribute']) ? '_'.(int)($product['id_product_attribute']) : '').'.jpg', 45, 'jpg') : '--'); $product['image'] = (isset($image['id_image']) ? cacheImage(_PS_IMG_DIR_.'p/'.$imageProduct->getExistingImgPath().'.jpg', 'product_mini_'.(int)($product['id_product']).(isset($product['id_product_attribute']) ? '_'.(int)($product['id_product_attribute']) : '').'.jpg', 45, 'jpg') : '--');
} }
$this->context->smarty->assign(array('products' => $products, $this->tpl_view_vars = array(
'products' => $products,
'discounts' => $cart->getCartRules(), 'discounts' => $cart->getCartRules(),
'order' => $order, 'order' => $order,
'cart' => $cart, 'cart' => $cart,
@@ -170,7 +171,9 @@ class AdminCartsController extends AdminController
'total_price' => $total_price, 'total_price' => $total_price,
'total_shipping' => $total_shipping, 'total_shipping' => $total_shipping,
'customized_datas' => $customized_datas 'customized_datas' => $customized_datas
)); );
return parent::initView();
} }
public function ajaxPreProcess() public function ajaxPreProcess()