// Merge -> revision 8114
This commit is contained in:
+4
-4
@@ -956,8 +956,10 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
else
|
||||
{
|
||||
$price = Product::getPriceStatic((int)($product['id_product']), $withTaxes, (int)($product['id_product_attribute']), 2, NULL, false, true, $product['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL));
|
||||
$price = Product::getPriceStatic((int)($product['id_product']), true, (int)($product['id_product_attribute']), 2, NULL, false, true, $product['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL));
|
||||
$total_price = Tools::ps_round($price, 2) * (int)($product['cart_quantity']);
|
||||
if (!$withTaxes)
|
||||
$total_price = Tools::ps_round($total_price / (1 + ($product['rate'] / 100)), 2);
|
||||
}
|
||||
$order_total += $total_price;
|
||||
}
|
||||
@@ -976,7 +978,6 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
$wrapping_fees = Tools::convertPrice(Tools::ps_round($wrapping_fees, 2), Currency::getCurrencyInstance((int)($this->id_currency)));
|
||||
}
|
||||
|
||||
if ($type != Cart::ONLY_PRODUCTS)
|
||||
{
|
||||
$discounts = array();
|
||||
@@ -1366,7 +1367,7 @@ class CartCore extends ObjectModel
|
||||
if (Product::idIsOnCategoryId($product['id_product'], $categories))
|
||||
{
|
||||
if ((!$discountObj->cumulable_reduction AND !$product['reduction_applies'] AND !$product['on_sale']) OR $discountObj->cumulable_reduction)
|
||||
$total_cart += $product['total_wt'];
|
||||
$total_cart += $discountObj->include_tax ? $product['total_wt'] : $product['total'];
|
||||
$returnErrorNoProductCategory = false;
|
||||
}
|
||||
}
|
||||
@@ -1411,7 +1412,6 @@ class CartCore extends ObjectModel
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'delivery' => $delivery,
|
||||
'delivery_state' => State::getNameById($delivery->id_state),
|
||||
|
||||
@@ -314,7 +314,7 @@ class DiscountCore extends ObjectModel
|
||||
foreach ($products AS $product)
|
||||
if (Product::idIsOnCategoryId($product['id_product'], $categories))
|
||||
if ($this->cumulable_reduction OR (!$product['reduction_applies'] AND !$product['on_sale']))
|
||||
$amount += ($this->include_tax ? $product['total_wt'] : $product['total']) * $percentage;
|
||||
$amount += ($useTax? $product['total_wt'] : $product['total']) * $percentage;
|
||||
return $amount;
|
||||
|
||||
/* Absolute value */
|
||||
@@ -325,7 +325,7 @@ class DiscountCore extends ObjectModel
|
||||
return 0;
|
||||
|
||||
$taxDiscount = Cart::getTaxesAverageUsed((int)($cart->id));
|
||||
if (!$this->include_tax AND isset($taxDiscount) AND $taxDiscount != 1)
|
||||
if (!$useTax AND isset($taxDiscount) AND $taxDiscount != 1)
|
||||
$this->value = abs($this->value / (1 + $taxDiscount * 0.01));
|
||||
|
||||
// Main return
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ class MCachedCore extends Cache
|
||||
|
||||
public static function addServer($ip, $port, $weight)
|
||||
{
|
||||
return Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'memcached_servers (id_memcached_server, ip, port, weight) VALUES(\'\', \''.pSQL($ip).'\', '.(int)$port.', '.(int)$weight.')', false);
|
||||
return Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'memcached_servers (ip, port, weight) VALUES(\''.pSQL($ip).'\', '.(int)$port.', '.(int)$weight.')', false);
|
||||
}
|
||||
|
||||
public static function getMemcachedServers()
|
||||
|
||||
@@ -574,6 +574,26 @@ abstract class ModuleCore
|
||||
$modules_dir = self::getModulesDirOnDisk();
|
||||
foreach ($modules_dir AS $module)
|
||||
{
|
||||
// Memory usage checking
|
||||
if ($memory_limit = strtoupper(@ini_get('memory_limit')))
|
||||
{
|
||||
if (strpos($memory_limit, 'M'))
|
||||
{
|
||||
$memory_limit = str_replace('M', '', $memory_limit);
|
||||
$memory_limit *= 1024 * 1024;
|
||||
}
|
||||
elseif (strpos($memory_limit, 'K'))
|
||||
{
|
||||
$memory_limit = str_replace('K', '', $memory_limit);
|
||||
$memory_limit *= 1024;
|
||||
}
|
||||
|
||||
if ($memory_limit - memory_get_usage() <= (512 * 1024))
|
||||
{
|
||||
$errors[] = Tools::displayError('All modules cannot be loaded due to memory limit restriction reason, please increase your memory_limit value on your server configuration');
|
||||
break;
|
||||
}
|
||||
}
|
||||
$configFile = _PS_MODULE_DIR_.$module.'/config.xml';
|
||||
$xml_exist = file_exists($configFile);
|
||||
if ($xml_exist)
|
||||
|
||||
Reference in New Issue
Block a user