Jump to content

cart.php "there is not enough product in stock"


cweeks
 Share

Recommended Posts

Hi,

Can anyone explain to me the conditions that need to occur to make the "there is not enough product in stock" error messages appear in this excert of code from cart.php. In particular the 2nd one ?

Cheers, Cam.

           /* Check the quantity availability */
           if ($idProductAttribute AND is_numeric($idProductAttribute))
           {
               if (!$delete AND !$producToAdd->isAvailableWhenOutOfStock($producToAdd->out_of_stock) AND !Attribute::checkAttributeQty(intval($idProductAttribute), intval($qty)))
                   $errors[] = Tools::displayError('there is not enough product in stock');
           }
           elseif ($producToAdd->hasAttributes() AND !$delete)
           {
               $idProductAttribute = Product::getDefaultAttribute(intval($producToAdd->id), intval($producToAdd->out_of_stock) == 2 ? !intval(Configuration::get('PS_ORDER_OUT_OF_STOCK')) : !intval($producToAdd->out_of_stock));
               if (!$idProductAttribute)
                   Tools::redirectAdmin($link->getProductLink($producToAdd));
               elseif (!$delete AND !$producToAdd->isAvailableWhenOutOfStock($producToAdd->out_of_stock) AND !Attribute::checkAttributeQty(intval($idProductAttribute), intval($qty)))
                   $errors[] = Tools::displayError('there is not enough product in stock');
           }
           elseif (!$delete AND !$producToAdd->checkQty(intval($qty)))
               $errors[] = Tools::displayError('there is not enough product in stock');

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More