In my magento application created a phtml page in template/page/ folder..

Here displayed a products...Then there is a need for displaying


But it return null value...that means no value returned it.

How can i get it in my phtml page?

This is the html code:

<input id="url_<?php echo $_iterator;?>" name="url_$_iterator;" type="text" value="<?php echo $this->getAddToCartUrl($product) ?>">

2 Answers 2


Try calling this instead:

  • thanku so much....its working....
    – Kichu
    Mar 27, 2013 at 7:19

Using the helper 'checkout/cart' with get link but it want solve the problem as you will run with similar issues with the price.

I think it is better to change if you can change the template type definition in your xml, something like this:

<block type="catalog/product_list" template="your-template.phtml" name="your-name" as="your-name" />

Like that you will have in $this not only the link but the price with out calling the magento helper directly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.