Skip to content

Commit

Permalink
// Create cart if cart object does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jnadaud committed Apr 21, 2015
1 parent 37533f4 commit 394b257
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion classes/CartRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,12 @@ public function getContextualValue($use_tax, Context $context = null, $filter =
if ($filter != CartRule::FILTER_ACTION_ALL_NOCAP)
{
// Cart values
$cart_average_vat_rate = Context::getContext()->cart->getAverageProductsTaxRate();
$cart = Context::getContext()->cart;

if (!Validate::isLoadedObject($cart))
$cart = new Cart();

$cart_average_vat_rate = $cart->getAverageProductsTaxRate();
$current_cart_amount = $use_tax ? $cart_amount_ti : $cart_amount_te;

foreach ($all_cart_rules_ids as $current_cart_rule_id)
Expand Down

0 comments on commit 394b257

Please sign in to comment.