News:

Support the VirtueMart project and become a member

Main Menu

Get N of product in cart

Started by maegras, December 26, 2011, 02:31:21 AM

Previous topic - Next topic

maegras

Hi everyone,

I'd like to have into the homepage, a box (not the cart module) displaying the current number of products in cart.

Eg:
1x product_a
3x product_b
---------------
Products on cart = 4

How can I do that?

Stephen Roberts

Sounds to me like you might need to develop a module for this. Couldn't you override the template for the cart module to get the output you want?
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

maegras

thank for you great idea :)
I've modified the default mod_virtuemart_cart such to obtain output I wish :)


Stephen Roberts

Cool. You do understand how to do template overrides work right? You shouldn't modify the module itself, but override the template instead.
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

maegras

I couldn't override because I need also the original cart module. So I created a new module called `product-number` starting from the original cart module. I've modified this module such to obtain output I need.

:)