Magento Forum

   
Put ‘add to cart’ inside .pricebox
 
kdigennaro
Member
 
Total Posts:  47
Joined:  2012-05-20
 

I seem to be struggling with this but I want to add the ‘add to cart’ button inside the .pricebox class inside price.phtml so far I’ve tried this;

<span class="cart"><button type="button" title="<?php echo $this->__('') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__(''?></span></span></button></span>

But it does not appear on my page. I’m not how else to call this button, any suggestions?

Thanks,
Kevin DiGennaro

 
Magento Community Magento Community
Magento Community
Magento Community
 
kmHelms
Sr. Member
 
Total Posts:  221
Joined:  2012-03-05
 

Kevin, sorry this isn’t specifically an answer but why do you want it inside the price box? It would be pretty sloppy to put it there. If you are just after positioning, it would be better to use css to get the button to show where you want, or rearrange the contents of list.phtml to get things where you want. Magento does a great (almost too great) job of keeping all the files organized and separated. You’d be taking a backwards step if you go putting things in other files where they don’t belong.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top