Hi guys, go to \app\design\frontend\default\themename\template\checkout\cart\item\default.phtml. This should be an example of the path, replace themename with yours. Another location this file might reside in is app\design\frontend\base.... followed by a similar structure to the one mentioned above.
Around line 208, you should find the 'input' tag with the name something like "cart....".
If you are certain that it is the place where your quantity gets pulled to, add the following after the input tag, replacing "gift card" with what text the title should contain for the quantity to be readonly.
if (strpos(strtolower($this->htmlEscape($this->getProductName())),"gift card") !== false) { echo 'readonly="readonly"' }
I hope this makes sense. The example I used depended on the product name in the cart, which if it gets a certain string, makes that certain product's quantity readonly.
To limit the quantity of a given product, so that you cannot add it twice, go to your product's page on the Magento side, inventory and add your amount at Maximum Qty Allowed in Shopping Bag . This should solve problem
No comments:
Post a Comment