Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

GetShopped (wp-ecommerce): if() test is shopping cart empty? WordPress

  • SOLVED

I've built an e-commerce site and I'm using the plugin from GetShopped to manage the shopping cart. I've placed the shopping cart in the template with this it of code:

<?php echo nzshpcrt_shopping_basket(); ?>

However, I actually want this only to appear if there is something in shopping cart. In pseudo code, what I want looks like this:

<?php if (!shopping_cart_is_empty()): ?>

<?php echo nzshpcrt_shopping_basket(); ?>

<?php endif ?>


How can I achieve this?

Answers (1)

2011-03-25

yves vu answers:

Hi,
you should use code:

<?php
if (isset($_SESSION['wpsc_cart']) && !empty($_SESSION['wpsc_cart']))
{
echo nzshpcrt_shopping_basket();
}
?>

cheers.