Bug Report: Undefined array key "quantity"

  • Patrick Jackson
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 months 3 weeks ago #168575 by Patrick Jackson
Bug Report: Undefined array key "quantity" was created by Patrick Jackson
While turning on debug to look at another issue, I had this appear on the popup cart screen:

Warning: Undefined array key "quantity" in /components/com_eshop/helpers/cart.php on line 942

It's a warning and doesn't seem to be causing anything else to be impacted.

EShop Version 3.9.5
Joomla Version 5.1.4


This is the function in cart.php affected (from Line 926)
Code:
    /**      *      * Function to get real product data in cart based on product sku      */     public function getProductDataInCart()     {         $productData = [];                  foreach ($this->getCartData() as $product)         {             $productData[$product['product_sku']]['product_name'] = $product['product_name'];             $productData[$product['product_sku']]['minimum_quantity'] = $product['minimum_quantity'];             $productData[$product['product_sku']]['maximum_quantity'] = $product['maximum_quantity'];                          if (isset($productData[$product['product_sku']]))             { [b]                $productData[$product['product_sku']]['quantity'] += $product['quantity'];[/b]             }             else             {                 $productData[$product['product_sku']]['quantity'] = $product['quantity'];             }         }                  return $productData;     }

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
2 months 1 week ago #168741 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Bug Report: Undefined array key "quantity"
Hello Patrick,

Thank you for submitting the ticket here. The reason because you turn on debug mode. You just need to turn it off.

I will also check the source code to make it better.

Sincerely, Giang

Please Log in or Create an account to join the conversation.

Moderators: Giang Dinh Truong