Skip to content

Commit

Permalink
move id attribute check before calling getProductProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Rolland committed Mar 4, 2024
1 parent 946eeaf commit 13aa4d7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions classes/Hook/HookActionCartUpdateQuantityBefore.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,14 @@ public function run()
// Format product and standardize ID
$product = (array) $this->params['product'];
$product['id_product'] = $product['id'];
$product['id_product_attribute'] = $this->params['id_product_attribute'];

// Get some basic information
$product = Product::getProductProperties($this->context->language->id, $product);

// Add information about attribute
if (!empty($this->params['id_product_attribute'])) {
$product['id_product_attribute'] = (int) $this->params['id_product_attribute'];
}

// Get some basic information
$product = Product::getProductProperties($this->context->language->id, $product);

// Add information about quantity difference
$product['quantity'] = (int) $this->params['quantity'];

Expand Down

0 comments on commit 13aa4d7

Please sign in to comment.