Commit 3751fd2f authored by Rémi Gaillard's avatar Rémi Gaillard

[-] FO: Fix #PSCFV-4992

parent af8d26c1
......@@ -496,6 +496,7 @@ class AddressFormatCore extends ObjectModel
$reflect = new ReflectionObject($address);
$public_properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
foreach ($public_properties as $property)
if (isset($address->{$property->getName()}))
$layoutData['object'][$property->getName()] = $address->{$property->getName()};
}
return $layoutData;
......
......@@ -518,6 +518,7 @@ class CartCore extends ObjectModel
// Reset the cache before the following return, or else an empty cart will add dozens of queries
$products_ids = array();
$pa_ids = array();
if ($result)
foreach ($result as $row)
{
$products_ids[] = $row['id_product'];
......
......@@ -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.')
ORDER BY priority');
$cartRules = ObjectModel::hydrateCollection('CartRule', $result);
foreach ($cartRules as $cartRule)
if ($cartRule->checkValidity($context, false, false))
$context->cart->addCartRule($cartRule->id);
if ($result)
{
$cart_rules = ObjectModel::hydrateCollection('CartRule', $result);
if ($cart_rules)
foreach ($cart_rules as $cart_rule)
if ($cart_rule->checkValidity($context, false, false))
$context->cart->addCartRule($cart_rule->id);
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment