Shopping cart summary on all website pages
I want to add a block with a shopping cart summary in my website.
T So I basically need to retrieve the shopping cart informations and display a brief summary of it. See picture: http://dl.dropbox.com/u/72686/cartSummary.png
How can I implement this ?
Of course, I still have a complete static page with the shopping cart items and full details. But I also want开发者_高级运维 this small block with a small version of the shopping cart.
thanks
Ubercart has its own api for this kind of stuff, create a module with a block using hook_block, then use uc_cart_get_contents to get the cart's contents. This returns an array with all the information in your shopping cart, you can print it out with var_dump or var_export to see what you want from the array.
For Drupal's Ubercart Module
You can use the Cart Block and enable the "Make the shopping cart block collapsible by clicking the name or arrow." feature.
To do this: Go to /admin/build/block/ find the "Shopping Cart" block and move it where you want it. Then click the configure link and scroll down until you see a check box with the "Make the shopping cart block collapsible by clicking the name or arrow." Check the box and you're good to go. This will display a list of all the products you have in your cart.
Hope this helps.
There is a ugly, but a working solution (it can be easily customized with a simple CSS coding):
http://www.phpwebcommerce.com/
If you want, I can search for more fancier solutions?
精彩评论