This is a common request in the UC forums and a feature of many ecommerce sites that I'd love to see, where you can easily add a menu item (often to simple text links in an upper right secondary menu) that shows a link to the cart and the number of items in the user's cart.

Features:
- Create a menu item that can be added to any menu that will display text followed by the number of items in the user's cart, ie. "Your cart (3)"
- Add '(#)' after text in menu item name, (ideally) so user can manage as usual menu item and adjust text

Comments

rszrama’s picture

Do you think it is necessary to allow multiple menu items? That would probably be a bit overcomplex for the simple feature... just curious.

rszrama’s picture

Issue tags: +dc2009 code sprint
stephthegeek’s picture

I think just one would be a million times better than none :)

rszrama’s picture

Version: 6.x-2.0-beta5 » 6.x-2.0-rc3
Assigned: Unassigned » rszrama
Issue tags: -dc2009 code sprint +ubercamp sprint
willvincent’s picture

This won't work with page caching, because the page cache and/or menu cache would have to be regenerated on each page load to ensure the number of items listed is always current -- which defeats the purpose of caching pages in the first place.

So while a menu item can certainly be added that links to the cart, the inclusion of the number of items in it can only really apply to authenticated users.

rszrama’s picture

Good call; will make sure to account for that - totally spaced on that when dreaming it up. : P

stephthegeek’s picture

Doh, this one too... what *is* the solution for getting around caching with these? It's bad enough with the cart block not working for anonymous users.

rszrama’s picture

For anonymous users on cached sites, you can use JS to update the menu item text and cart block contents. It would just require a simple AJAX callback that could return the appropriate info. The AJAX cart module is supposed to do this, but I don't believe it's fully working for 2.x yet.

NPC’s picture

Was this dropped or somehow implemented? Subscribing.

mertskeli’s picture

Status: Active » Closed (works as designed)

There is items_count which can be used for that. Check the cart block code.