// merge 1.4 (5397)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -42,7 +42,7 @@ class BlockCart extends Module
|
||||
$this->displayName = $this->l('Cart block');
|
||||
$this->description = $this->l('Adds a block containing the customer\'s shopping cart.');
|
||||
}
|
||||
|
||||
|
||||
public function smartyAssigns(&$smarty, &$params)
|
||||
{
|
||||
global $errors, $cookie;
|
||||
@@ -62,7 +62,7 @@ class BlockCart extends Module
|
||||
}
|
||||
else
|
||||
$taxCalculationMethod = Group::getDefaultPriceDisplayMethod();
|
||||
|
||||
|
||||
$useTax = !($taxCalculationMethod == PS_TAX_EXC);
|
||||
|
||||
$products = $params['cart']->getProducts(true);
|
||||
@@ -72,13 +72,13 @@ class BlockCart extends Module
|
||||
|
||||
$wrappingCost = (float)($params['cart']->getOrderTotal($useTax, Cart::ONLY_WRAPPING));
|
||||
$totalToPay = $params['cart']->getOrderTotal($useTax);
|
||||
|
||||
|
||||
if ($useTax AND Configuration::get('PS_TAX_DISPLAY') == 1)
|
||||
{
|
||||
$totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false);
|
||||
$smarty->assign('tax_cost', Tools::displayPrice($totalToPay - $totalToPayWithoutTaxes, $currency));
|
||||
}
|
||||
|
||||
|
||||
$smarty->assign(array(
|
||||
'products' => $products,
|
||||
'customizedDatas' => Product::getAllCustomizedDatas((int)($params['cart']->id)),
|
||||
@@ -88,7 +88,7 @@ class BlockCart extends Module
|
||||
'nb_total_products' => (int)($nbTotalProducts),
|
||||
'shipping_cost' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_SHIPPING), $currency),
|
||||
'show_wrapping' => $wrappingCost > 0 ? true : false,
|
||||
'show_tax' => (int)(Configuration::get('PS_TAX_DISPLAY')) == 1 ? true : false,
|
||||
'show_tax' => (int)(Configuration::get('PS_TAX_DISPLAY') == 1 && $smarty->getConfigVars('use_taxes')),
|
||||
'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency),
|
||||
'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::BOTH_WITHOUT_SHIPPING), $currency),
|
||||
'total' => Tools::displayPrice($totalToPay, $currency),
|
||||
@@ -125,7 +125,7 @@ class BlockCart extends Module
|
||||
<form action="'.$_SERVER['REQUEST_URI'].'" method="post">
|
||||
<fieldset>
|
||||
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
|
||||
|
||||
|
||||
<label>'.$this->l('Ajax cart').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="radio" name="ajax" id="ajax_on" value="1" '.(Tools::getValue('ajax', Configuration::get('PS_BLOCK_CART_AJAX')) ? 'checked="checked" ' : '').'/>
|
||||
@@ -134,7 +134,7 @@ class BlockCart extends Module
|
||||
<label class="t" for="ajax_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||
<p class="clear">'.$this->l('Activate AJAX mode for cart (compatible with the default theme)').'</p>
|
||||
</div>
|
||||
|
||||
|
||||
<center><input type="submit" name="submitBlockCart" value="'.$this->l('Save').'" class="button" /></center>
|
||||
</fieldset>
|
||||
</form>';
|
||||
@@ -157,11 +157,10 @@ class BlockCart extends Module
|
||||
{
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return;
|
||||
|
||||
|
||||
global $smarty;
|
||||
$smarty->assign('order_page', strpos($_SERVER['PHP_SELF'], 'order') !== false);
|
||||
$this->smartyAssigns($smarty, $params);
|
||||
|
||||
return $this->display(__FILE__, 'blockcart.tpl');
|
||||
}
|
||||
|
||||
@@ -174,20 +173,21 @@ class BlockCart extends Module
|
||||
{
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return;
|
||||
|
||||
|
||||
global $smarty;
|
||||
$this->smartyAssigns($smarty, $params);
|
||||
$res = $this->display(__FILE__, 'blockcart-json.tpl');
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
public function hookHeader()
|
||||
{
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return;
|
||||
|
||||
|
||||
Tools::addCSS(($this->_path).'blockcart.css', 'all');
|
||||
if ((int)(Configuration::get('PS_BLOCK_CART_AJAX')))
|
||||
Tools::addJS(($this->_path).'ajax-cart.js');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,13 +40,13 @@ var removingLinkText = '{l s='remove this product from my cart' mod='blockcart'
|
||||
<h4>
|
||||
<a href="{$link->getPageLink("$order_process.php", true)}">{l s='Cart' mod='blockcart'}</a>
|
||||
{if $ajax_allowed}
|
||||
<span id="block_cart_expand" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded'}class="hidden"{/if}> </span>
|
||||
<span id="block_cart_collapse" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'collapsed' || !isset($colapseExpandStatus)}class="hidden"{/if}> </span>
|
||||
<span id="block_cart_expand" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !isset($colapseExpandStatus)}class="hidden"{/if}> </span>
|
||||
<span id="block_cart_collapse" {if isset($colapseExpandStatus) && $colapseExpandStatus eq 'collapsed'}class="hidden"{/if}> </span>
|
||||
{/if}
|
||||
</h4>
|
||||
<div class="block_content">
|
||||
<!-- block summary -->
|
||||
<div id="cart_block_summary" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed}collapsed{else}expanded{/if}">
|
||||
<div id="cart_block_summary" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed || !isset($colapseExpandStatus)}collapsed{else}expanded{/if}">
|
||||
<span class="ajax_cart_quantity" {if $cart_qties <= 0}style="display:none;"{/if}>{$cart_qties}</span>
|
||||
<span class="ajax_cart_product_txt_s" {if $cart_qties <= 1}style="display:none"{/if}>{l s='products' mod='blockcart'}</span>
|
||||
<span class="ajax_cart_product_txt" {if $cart_qties > 1}style="display:none"{/if}>{l s='product' mod='blockcart'}</span>
|
||||
@@ -54,7 +54,7 @@ var removingLinkText = '{l s='remove this product from my cart' mod='blockcart'
|
||||
<span class="ajax_cart_no_product" {if $cart_qties != 0}style="display:none"{/if}>{l s='(empty)' mod='blockcart'}</span>
|
||||
</div>
|
||||
<!-- block list of products -->
|
||||
<div id="cart_block_list" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed}expanded{else}collapsed{/if}">
|
||||
<div id="cart_block_list" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed || !isset($colapseExpandStatus)}expanded{else}collapsed{/if}">
|
||||
{if $products}
|
||||
<dl class="products">
|
||||
{foreach from=$products item='product' name='myLoop'}
|
||||
@@ -126,7 +126,7 @@ var removingLinkText = '{l s='remove this product from my cart' mod='blockcart'
|
||||
<span>{l s='Total' mod='blockcart'}</span>
|
||||
<span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>
|
||||
</p>
|
||||
{if $use_taxes}
|
||||
{if $use_taxes && $display_tax_label == 1}
|
||||
{if $priceDisplay == 0}
|
||||
<p id="cart-price-precisions">
|
||||
{l s='Prices are tax included' mod='blockcart'}
|
||||
|
||||
@@ -8,4 +8,5 @@
|
||||
<tab>front_office_features</tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
Reference in New Issue
Block a user