Get number of items in cart?
Is it possible to get the number of items in the shopping cart on the cart.php page?
Is it possible to get the number of items in the shopping cart on the cart.php page?
Use the following code to show the Total number of items:
<?php echo $WA_Store_Cart->TotalColumn("Quantity"); ?>
Thanks, Jason - looks like that gives me all the items, including multiple quantities of an item. What I'm really looking for is the total number of unique items. So if someone order 1 widget, 2 wodgets, and 1 gadget, the answer would be 3 instead of 4. Is it possible to get that value?
Thanks - Joe
OK, for Unique items use:
<?php echo(sizeof($WA_Store_Cart->Items)); ?>
Is it possible to put this on all the pages, somewhere, once a user logs in? And where would it go?
Thanks
Yes, you could use that wherever you would like to display the number of items in the cart.
How would I set it up to show "only" if the person is logged in?
Thanks
<?php if(WA_Auth_RulePasses("Logged in to users")){ // Begin Show Region ?>
<?php echo(sizeof($WA_Store_Cart->Items)); ?>
<?php } // End Show Region ?>
I'm getting this error:
PHP Notice: Undefined index: CategoryName in C:\Inetpub\wwwroot\hcprivate\AcalaMed\acalamedical.com\www\Products_Detail.php on line 469 PHP Fatal error: Call to undefined function WA_Auth_RulePasses() in C:\Inetpub\wwwroot\hcprivate\AcalaMed\acalamedical.com\www\Products_Detail.php on line 486
The code you gave me is what is on line 486.
Line 469 is: <p>Category: <?php echo $row_WADAProducts["CategoryName"]; ?></p>
Thanks
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.