Display number of items in ecart5 on template page?
Hi, is there a way to display number of items in ecart5 on template page? I use php.
Thank you for your help,
Dave
Hi, is there a way to display number of items in ecart5 on template page? I use php.
Thank you for your help,
Dave
I think this is what you are looking for. This will display the total itemsin the cart:
<?php echo WA_eCart_DisplayNumber($WA_Store_Cart, $WA_Store_Cart->TotalColumn("Quantity")); ?>
Replace WA_Store_Cart with the name of your shopping cart.
Hope that helps!
It works!
Thank you very much!
Hi,
When I tested more pages, I found that the function of "display number of items in ecart5" worked only for the the page haveing Add To Cart Button. For the pages without the Add to Cart button, error below occured,
My Cart:
Fatal error: Call to undefined function WA_eCart_DisplayNumber() in XXXXX on line 51.
Anybody can help?
Thanks,
Dave
Yes - make sure your shopping cart include is at the top of the page.
Should look something like this:
<?php
//WA eCart Include
require_once("WA_eCart/WA_Store_Cart_PHP.php");
?>
<?php
$WA_Store_Cart->GetContent();
?>
Again, replace WA_Store_Cart with you cart name.
You should see this code at the top of the add to cart page. You can copy and paste it to the other pages.
Hope that helps.
Hi,
I copied and pasted those codes on the top, but still got the the follwoing warning,
Warning: require_once(../../WA_eCart/ACart_PHP.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\xxxx\xxxxxxx.php on line 3
Fatal error: require_once() [function.require]: Failed opening required '../../WA_eCart/ACart_PHP.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\xxxx\xxxxxxx.php on line 3.
Any suggestion?
Thanks,
Dave
Yes - that error means that either the file name is incorrect or the path to the file is incorrect. My guess is it's the path.
From the top menu in Dreamweaver click on Insert, then click on Server-Side Include.
Navigate to the WA_eCart folder and choose file ACart_PHP.php. Double click on the file to insert it into the page. You will want to have your cursor positioned at the line of code where you want this inserted.
This should insert the file with the correct path.
You are right. The path is not right.
Thanks a lot for your help.
Dave
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.