cweeks Posted May 28, 2010 Share Posted May 28, 2010 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'); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now