Merge remote-tracking branch 'origin/development' into development

This commit is contained in:
Fabio Chelly
2013-07-05 17:18:50 +02:00
4 changed files with 20 additions and 39 deletions
+10 -24
View File
@@ -2543,6 +2543,7 @@ class CartCore extends ObjectModel
if (empty($id_carrier) && $this->isCarrierInRange((int)Configuration::get('PS_CARRIER_DEFAULT'), (int)$id_zone))
$id_carrier = (int)Configuration::get('PS_CARRIER_DEFAULT');
$total_package_without_shipping_tax_inc = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, $product_list);
if (empty($id_carrier))
{
if ((int)$this->id_customer)
@@ -2577,7 +2578,7 @@ class CartCore extends ObjectModel
{
$check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $this->getTotalWeight(), (int)$id_zone);
$total_order = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, $product_list);
$total_order = $total_package_without_shipping_tax_inc;
$check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $total_order, (int)$id_zone, (int)$this->id_currency);
// Get only carriers that have a range compatible with cart
@@ -2680,26 +2681,8 @@ class CartCore extends ObjectModel
$id_zone = (int)$default_country->id_zone;
}
$check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight((int)$carrier->id, $this->getTotalWeight(), (int)$id_zone);
// Code Review V&V TO FINISH
$check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice(
$carrier->id,
$this->getOrderTotal(
true,
Cart::BOTH_WITHOUT_SHIPPING,
$product_list
),
$id_zone,
(int)$this->id_currency
);
if ((
$carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT
&& !$check_delivery_price_by_weight
) || (
$carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE
&& !$check_delivery_price_by_price
if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT && !Carrier::checkDeliveryPriceByWeight($carrier->id, $this->getTotalWeight(), (int)$id_zone))
|| ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE && !Carrier::checkDeliveryPriceByPrice($carrier->id, $total_package_without_shipping_tax_inc, $id_zone, (int)$this->id_currency)
))
$shipping_cost += 0;
else
@@ -2846,7 +2829,10 @@ class CartCore extends ObjectModel
$formatted_addresses['delivery'] = AddressFormat::getFormattedLayoutData($delivery);
$formatted_addresses['invoice'] = AddressFormat::getFormattedLayoutData($invoice);
$total_tax = $this->getOrderTotal() - $this->getOrderTotal(false);
$base_total_tax_inc = $this->getOrderTotal(true);
$base_total_tax_exc = $this->getOrderTotal(false);
$total_tax = $base_total_tax_inc - $base_total_tax_exc;
if ($total_tax < 0)
$total_tax = 0;
@@ -2944,9 +2930,9 @@ class CartCore extends ObjectModel
'total_shipping_tax_exc' => $total_shipping_tax_exc,
'total_products_wt' => $total_products_wt,
'total_products' => $total_products,
'total_price' => $this->getOrderTotal(),
'total_price' => $base_total_tax_inc,
'total_tax' => $total_tax,
'total_price_without_tax' => $this->getOrderTotal(false),
'total_price_without_tax' => $base_total_tax_exc,
'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1),
'free_ship' => $total_shipping ? 0 : 1,
'carrier' => new Carrier($this->id_carrier, $id_lang),
+3 -2
View File
@@ -63,8 +63,9 @@ class BlockCart extends Module
$nbTotalProducts += (int)$product['cart_quantity'];
$cart_rules = $params['cart']->getCartRules();
$shipping_cost = Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_SHIPPING), $currency);
$shipping_cost_float = Tools::convertPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_SHIPPING), $currency);
$base_shipping = $params['cart']->getOrderTotal($useTax, Cart::ONLY_SHIPPING);
$shipping_cost = Tools::displayPrice($base_shipping, $currency);
$shipping_cost_float = Tools::convertPrice($base_shipping, $currency);
$wrappingCost = (float)($params['cart']->getOrderTotal($useTax, Cart::ONLY_WRAPPING));
$totalToPay = $params['cart']->getOrderTotal($useTax);
+2 -1
View File
@@ -326,7 +326,7 @@ function updateDisplay()
reduction = ps_round(reduction / tax, 6);
}
else if (product_specific_price && product_specific_price.reduction)
else if (product_specific_price && product_specific_price.reduction && !selectedCombination.specific_price)
{
if (product_specific_price.reduction_type == 'amount')
reduction_price = (specific_currency ? product_specific_price.reduction : product_specific_price.reduction * currencyRate);
@@ -387,6 +387,7 @@ function updateDisplay()
}
$('#our_price_display').text(our_price);
$('#old_price_display').text(formatCurrency(productPriceWithoutReductionDisplay, currencyFormat, currencySign, currencyBlank));
if (productPriceWithoutReductionDisplay > productPriceDisplay)
$('#old_price,#old_price_display,#old_price_display_taxes').show();
else
+5 -12
View File
@@ -410,19 +410,12 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
{/if}
</span>
</p>
{if $product->specificPrice AND $product->specificPrice.reduction && $product->specificPrice.reduction > 0}
<p id="old_price"><span class="bold">
{if $priceDisplay >= 0 && $priceDisplay <= 2}
{if $productPriceWithoutReduction > $productPrice}
<span id="old_price_display">{convertPrice price=$productPriceWithoutReduction}</span>
<!-- {if $tax_enabled && $display_tax_label == 1}
{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
{/if} -->
{/if}
{/if}
</span>
</p>
<p id="old_price"{if !$product->specificPrice || !$product->specificPrice.reduction} class="hidden"{/if}>
{if $priceDisplay >= 0 && $priceDisplay <= 2}
<span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
<!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} -->
{/if}
</p>
{if $packItems|@count && $productPrice < $product->getNoPackPrice()}
<p class="pack_price">{l s='Instead of'} <span style="text-decoration: line-through;">{convertPrice price=$product->getNoPackPrice()}</span></p>
<br class="clear" />