0
votes

on Mage/Checkout/Helper/Cart

i put this code

Mage::app()->getRequest()->getParam('qty')

but the result is empty

1
Can I know the purpose of doing this?Jinesh
In which area you put this code Mage::app()->getRequest()->getParam('qty') in this file on Mage/Checkout/Helper/CartJinesh
i put it in getAddUrl functionboreman
You want all qty which is in cart am I right?Jinesh
I want to see product quantity of the user input.boreman

1 Answers

0
votes

if I get it right, you want to track the parameters passed to the cart from some page. Clicking on the "add to cart" button, 2 parameters will be passed, the Product and the Qty. You can do it with:

     $product = Mage::getModel('catalog/product')
                ->load(Mage::app()->getRequest()->getParam('product', 0));

doing so you will have a object product that is the one who you have passed as a param. So, now you can have all the products infos you need just doing:

     $name = $product->getName();
     $price = $product->getPrice();
     $qty =  Mage::app()->getRequest()->getParam('qty', 1),

EDIT:
if you want to change buttons instructions you should check the template file in question:

app/design/frontend/TEMPLATE_PKG/TEMPLATE/template/catalog/product/view/addtocart.phtml

But for best practice you should never modify the magento's files, so i suggest to override the template file and make your own changes. Here is a simple guide where you can get these infos: https://www.scommerce-mage.com/blog/override-phtml-or-layout-core-files-in-magento.html

in your specific case you would like to change the "onclick" function on the button, to point it whereever you want. And you can for sure add new custom buttons and so on. hope to solve your dubts.