MODX Community

Help with Commerce Extra


Trying to get my head around Commerce. Finding the docs tricky to follow!
Currently I have This to show the number of items in my cart:
[[!commerce.get_cart? &toPlaceholders=cart]]
Is there a simple way to only populate the placeholder if there are items in the cart?
At the moment it always says ‘0’.


Please use the modmore forum or email for help with Commerce - I can’t guarantee I’ll always see questions posted here.

With the call you’re posting, you’ll have access to a bunch of placeholders you can use, for example:

   <a href="[[~[[++commerce.cart_resource]]]]">View your cart ([[!+cart.total_quantity]] items)</a>
   <!-- cart is empty -->

OK thanks - I can’t get that working - but I’ll email instead - thanks Mark!