// fix little bug on AdminOrdersController
[~] Deprecated: Cart::getOrderShippingCost()
This commit is contained in:
+2
-2
@@ -563,8 +563,8 @@ class CarrierCore extends ObjectModel
|
||||
}
|
||||
|
||||
$row['name'] = (strval($row['name']) != '0' ? $row['name'] : Configuration::get('PS_SHOP_NAME'));
|
||||
$row['price'] = ($shipping_method == Carrier::SHIPPING_METHOD_FREE ? 0 : $cart->getOrderShippingCost((int)$row['id_carrier']));
|
||||
$row['price_tax_exc'] = ($shipping_method == Carrier::SHIPPING_METHOD_FREE ? 0 : $cart->getOrderShippingCost((int)$row['id_carrier'], false));
|
||||
$row['price'] = ($shipping_method == Carrier::SHIPPING_METHOD_FREE ? 0 : $cart->getPackageShippingCost((int)$row['id_carrier']));
|
||||
$row['price_tax_exc'] = ($shipping_method == Carrier::SHIPPING_METHOD_FREE ? 0 : $cart->getPackageShippingCost((int)$row['id_carrier'], false));
|
||||
$row['img'] = file_exists(_PS_SHIP_IMG_DIR_.(int)$row['id_carrier']).'.jpg' ? _THEME_SHIP_DIR_.(int)$row['id_carrier'].'.jpg' : '';
|
||||
|
||||
// If price is false, then the carrier is unavailable (carrier module)
|
||||
|
||||
+4
-3
@@ -275,8 +275,8 @@ class CartCore extends ObjectModel
|
||||
|
||||
$total_products_ti = $this->getOrderTotal(true, Cart::ONLY_PRODUCTS);
|
||||
$total_products_te = $this->getOrderTotal(false, Cart::ONLY_PRODUCTS);
|
||||
$shipping_ti = $this->getOrderShippingCost();
|
||||
$shipping_te = $this->getOrderShippingCost(NULL, false);
|
||||
$shipping_ti = $this->getPackageShippingCost();
|
||||
$shipping_te = $this->getPackageShippingCost(NULL, false);
|
||||
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
@@ -1630,6 +1630,7 @@ class CartCore extends ObjectModel
|
||||
*/
|
||||
public function getOrderShippingCost($id_carrier = null, $useTax = true, Country $default_country = null, $product_list = null)
|
||||
{
|
||||
Tools::displayAsDeprecated();
|
||||
return $this->getPackageShippingCost($id_carrier, $useTax, $default_country, $product_list);
|
||||
}
|
||||
|
||||
@@ -2526,7 +2527,7 @@ class CartCore extends ObjectModel
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return false is some product from the cart are out of stock
|
||||
*/
|
||||
|
||||
@@ -174,12 +174,12 @@ class CartRuleCore extends ObjectModel
|
||||
INSERT INTO `'._DB_PREFIX_.'cart_rule_combination` (`id_cart_rule_1`, `id_cart_rule_2`)
|
||||
(SELECT '.(int)$id_cart_rule_destination.', IF(id_cart_rule_1 != '.(int)$id_cart_rule_source.', id_cart_rule_1, id_cart_rule_2) FROM `'._DB_PREFIX_.'cart_rule_combination`
|
||||
WHERE `id_cart_rule_1` = '.(int)$id_cart_rule_source.' OR `id_cart_rule_2` = '.(int)$id_cart_rule_source.')');
|
||||
|
||||
|
||||
// Todo : should be changed soon, be must be copied too
|
||||
// Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cart_rule_product_rule` WHERE `id_cart_rule` = '.(int)$this->id);
|
||||
// Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'cart_rule_product_rule_value` WHERE `id_product_rule` NOT IN (SELECT `id_product_rule` FROM `'._DB_PREFIX_.'cart_rule_product_rule`)');
|
||||
}
|
||||
|
||||
|
||||
public static function getIdByCode($code)
|
||||
{
|
||||
if (!Validate::isDiscountName($code))
|
||||
@@ -452,7 +452,7 @@ class CartRuleCore extends ObjectModel
|
||||
if ($this->free_shipping)
|
||||
{
|
||||
if (!$this->carrier_restriction)
|
||||
$reductionValue += $context->cart->getOrderShippingCost($context->cart->id_carrier, $useTax = true, $context->country);
|
||||
$reductionValue += $context->cart->getPackageShippingCost($context->cart->id_carrier, $useTax = true, $context->country);
|
||||
elseif ($context->cart->id_carrier)
|
||||
{
|
||||
$id_cart_rule = (int)Db::getInstance()->getValue('
|
||||
@@ -461,7 +461,7 @@ class CartRuleCore extends ObjectModel
|
||||
WHERE crc.id_cart_rule = '.(int)$this->id.'
|
||||
AND crc.id_carrier = '.(int)$context->cart->id_carrier);
|
||||
if ($id_cart_rule)
|
||||
$reductionValue += $context->cart->getOrderShippingCost($context->cart->id_carrier, $useTax, $context->country);
|
||||
$reductionValue += $context->cart->getPackageShippingCost($context->cart->id_carrier, $useTax, $context->country);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ class CartRuleCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
// Discount (¤)
|
||||
// Discount (�)
|
||||
if ($this->reduction_amount)
|
||||
{
|
||||
$reduction_amount = $this->reduction_amount;
|
||||
@@ -529,7 +529,7 @@ class CartRuleCore extends ObjectModel
|
||||
$reductionValue += $reduction_amount * (1 + $product_vat_rate);
|
||||
}
|
||||
}
|
||||
// Discount (¤) on the whole order
|
||||
// Discount (�) on the whole order
|
||||
elseif ($this->reduction_product == 0)
|
||||
{
|
||||
$cart_amount_ti = $context->cart->getOrderTotal(true, Cart::ONLY_PRODUCTS);
|
||||
|
||||
@@ -344,7 +344,7 @@ class OrderCore extends ObjectModel
|
||||
$cart->update();
|
||||
|
||||
/* Update order */
|
||||
$shippingDiff = $this->total_shipping - $cart->getOrderShippingCost();
|
||||
$shippingDiff = $this->total_shipping - $cart->getPackageShippingCost();
|
||||
$this->total_products -= $productPriceWithoutTax;
|
||||
|
||||
// After upgrading from old version
|
||||
|
||||
Reference in New Issue
Block a user