Jump to content

php warning on product page. prestashop 8.2 php 8.1


vincent

Recommended Posts

Does anyone know about this bug? and any fix?

 

PHP Warning: Undefined array key "cart_quantity" in /public_html/controllers/front/ProductController.php on line 1329

 

    /**
     * @param array $product
     *
     * @return int
     */
    protected function getRequiredQuantity($product)
    {
        $requiredQuantity = (int) Tools::getValue('quantity_wanted', $this->getProductMinimalQuantity($product));
        if ($requiredQuantity < $product['minimal_quantity']) {
            $requiredQuantity = $product['minimal_quantity'];
        }

        if ($product['cart_quantity'] >= $requiredQuantity) {
            return 0;
        }

        return $requiredQuantity;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...