php - show/hide magento cart in wordpress -


i'm working on site based on wordpress uses magento deal e-commerce (not choice, it's how site setup).

when product selected, links through magento shopping cart. have site wide "view cart" link in head of site links magento cart. i'd hide link if cart empty.

working soley in magento use hide link:

<?php $_cartqty = $this->getsummarycount() ?> <?php if ($_cartqty >0): ?> <a href="link">link cart</a> <?php endif ?> 

but doesn't work wordpress... there way cart count magento wp use along lines of...

<?php if (sizeof($cart) > 1)) : ?> <a href="link">link cart</a> <?php endif ?> 

<?php require_once '../app/mage.php'; //root app/mage.php of magento mage::app(); //run mage::getsingleton('core/session', array('name'=>'frontend')); //load session $count = mage::helper('checkout/cart')->getsummarycount(); //read count itemes in cart $total = mage::helper('checkout/cart')->getquote()->getgrandtotal(); //read total in cart if($count==0){     echo '<a href="'.mage::getbaseurl("web").'checkout/cart">cart empty</a>'; } else {     echo '<a href="'.mage::getbaseurl("web").'checkout/cart">'.$count.' item(s) total '.mage::helper('core')->formatprice($total, false).'</a>'; } 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -