Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Echo Subtotal / Add to cart button
 
Kerry Hatcher
Sr. Member
 
Avatar
Total Posts:  96
Joined:  2008-07-15
Macon, GA
 

what would be the correct code to echo the current cart subtotal on a product page?

<?php echo Mage::helper('checkout/cart')->getCart()->getItemsCount(); ?> works for getting total number of items but I need the subtotal price.

My master plan is to only show the “add to card” if subtotal >= $presetamount.

Basicly:

$_cartsubtotal Mage::helper('checkout/cart')->getCart()->getSubTotal();

<?php if ($_cartsubtotal >= 550): ?>

          
//code to show "add to cart" here

<?php endif ?>

Thanks,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Discovery
Enthusiast
 
Total Posts:  767
Joined:  2007-12-29
 

catalog/product/view.phtml calls the add to cart box, you could put your if in there.

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