Community store total products in cart

Permalink
Hi all,

I have a community store up and running nicely but the client has requested that a minimum order of 10+ items be introduced. I can see that this can be achieved in the shipping method easily but I was hoping to try to stop customers from getting that far in the process before being told to turn back.

My thinking is if I can find the total number of items in the cart (both products and quantities of those products), if they equal 10 or more, show the checkout button, else hide the checkout button.

My issue is, I can't seem to determine the total number of products/quantities in the cart.

I have tried pulling this info from the community_utility_links block where I have <?= $itemCount ?> but this doesn't show anything when placed in singlepages/cart.php

Any help would be greatly appreciated.

 
mnakalay replied on at Permalink Reply
mnakalay
in your code, I think you should be able to do
$totalItemsInCart = \Concrete\Package\CommunityStore\Src\CommunityStore\Cart\Cart::getTotalItemsInCart();