[-] FO: Fix #PSCFV-4992
This commit is contained in:
@@ -496,7 +496,8 @@ class AddressFormatCore extends ObjectModel
|
|||||||
$reflect = new ReflectionObject($address);
|
$reflect = new ReflectionObject($address);
|
||||||
$public_properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
|
$public_properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
|
||||||
foreach ($public_properties as $property)
|
foreach ($public_properties as $property)
|
||||||
$layoutData['object'][$property->getName()] = $address->{$property->getName()};
|
if (isset($address->{$property->getName()}))
|
||||||
|
$layoutData['object'][$property->getName()] = $address->{$property->getName()};
|
||||||
}
|
}
|
||||||
return $layoutData;
|
return $layoutData;
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-5
@@ -518,11 +518,12 @@ class CartCore extends ObjectModel
|
|||||||
// Reset the cache before the following return, or else an empty cart will add dozens of queries
|
// Reset the cache before the following return, or else an empty cart will add dozens of queries
|
||||||
$products_ids = array();
|
$products_ids = array();
|
||||||
$pa_ids = array();
|
$pa_ids = array();
|
||||||
foreach ($result as $row)
|
if ($result)
|
||||||
{
|
foreach ($result as $row)
|
||||||
$products_ids[] = $row['id_product'];
|
{
|
||||||
$pa_ids[] = $row['id_product_attribute'];
|
$products_ids[] = $row['id_product'];
|
||||||
}
|
$pa_ids[] = $row['id_product_attribute'];
|
||||||
|
}
|
||||||
// Thus you can avoid one query per product, because there will be only one query for all the products of the cart
|
// Thus you can avoid one query per product, because there will be only one query for all the products of the cart
|
||||||
Product::cacheProductsFeatures($products_ids);
|
Product::cacheProductsFeatures($products_ids);
|
||||||
Cart::cacheSomeAttributesLists($pa_ids, $this->id_lang);
|
Cart::cacheSomeAttributesLists($pa_ids, $this->id_lang);
|
||||||
|
|||||||
@@ -1096,11 +1096,14 @@ class CartRuleCore extends ObjectModel
|
|||||||
AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.')
|
AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.')
|
||||||
ORDER BY priority');
|
ORDER BY priority');
|
||||||
|
|
||||||
$cartRules = ObjectModel::hydrateCollection('CartRule', $result);
|
if ($result)
|
||||||
|
{
|
||||||
foreach ($cartRules as $cartRule)
|
$cart_rules = ObjectModel::hydrateCollection('CartRule', $result);
|
||||||
if ($cartRule->checkValidity($context, false, false))
|
if ($cart_rules)
|
||||||
$context->cart->addCartRule($cartRule->id);
|
foreach ($cart_rules as $cart_rule)
|
||||||
|
if ($cart_rule->checkValidity($context, false, false))
|
||||||
|
$context->cart->addCartRule($cart_rule->id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user