Magento Forum

   
How limit the maximum number of items per order
 
Piovrolo
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2008-07-09
 

Hi all,
i just set the “Maximum Qty Allowed in Shopping Cart” to 3 in CONFIGURATION => CATALOG => INVENTORY menu.This because i want limit the maximum number of products/item per order to 3.

The problem is that i found that this limitation seems be applied only to single products in the cart (ie. max 3 items for product A, max 3 item for product B, etc) gulp

Is there a way to limit the the total number of items (this because impact my shipping costs)?

Thank you in advance to who can help me

 
Magento Community Magento Community
Magento Community
Magento Community
 
CVinson86
Member
 
Avatar
Total Posts:  40
Joined:  2008-06-18
 

I know this post is kinda old, but *bump*.  Has anyone figured out a way to go about this?  Maybe overload the cart controller?
-CV

 
Magento Community Magento Community
Magento Community
Magento Community
 
szotyi
Sr. Member
 
Total Posts:  153
Joined:  2008-11-29
 

yeah you can do it many ways…

1. way:
http://www.magentocommerce.com/boards/viewthread/23238/
here you can see how you can display the number of items in the checkout page…

your sidebar2.phtml should look something like this:
if $_cartQty>3 then redirect me back to the cart page…
im not sure it works because the redirect works only nothing printed out yet.. then your sidebar2.phtml should look like this:
if $_cartQty>3 then
<div class="page-head">
<h3><?php echo $this->__('') ?>Maximum amount has reached</h3>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<p><?php echo $this->__('You can order maximum of three items per order') ?></p>
<p><?php echo $this->__('Please <a href="%s">continue shopping</a>.', $this->getContinueShoppingUrl()) ?></p>
<style>
#checkoutSteps {display:none;}
</style>

2. way..
you check with javascript when he click an the add cart button:
/app/design/frontend/default/default/template/checkout/cart/sidebar.phtml

find this: <h4><?php echo $this->__('My Cart') ?></h4>
after that insert this: <input id="sz_cartQty" value="<?=$_cartQty?>" type="hidden">

now search in your entire website’s file (on local) for the word: add to cart.. look for the phtml files.. you will find ca. 13-15 (if you have no compare, wishlist etc.. you do not have to worry about them)
and then you look for the onclick event of the buttom and you check first that the typed amount plusz value of the sz_cartQty larger then 3 or not… if not oyu just let the script run.. if not stop the script with a alert

 
Magento Community Magento Community
Magento Community
Magento Community
 
azzurro
Jr. Member
 
Total Posts:  3
Joined:  2009-11-25
 

Hi there,
I need to limit the maximum quantity of item per order in a whole cart (to 3) as well. However I didn’t find clear solution on the entire website.
Can anyone help?
Tried one of the solution suggested above (second one) but this way I could only hide the sidebar output. Actually the code doesn’t stops putting goods in the cart (e.g. number of items included in the cart is shown in the top menu as “My cart (4)” as well as in recently added items).
Is there other way not to process cart with exceeding amount of items at all ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
azzurro
Jr. Member
 
Total Posts:  3
Joined:  2009-11-25
 

sorry, I meant first solution (with sidebar2.phtml),,

azzurro - 25 November 2009 09:13 PM

Hi there,
I need to limit the maximum quantity of item per order in a whole cart (to 3) as well. However I didn’t find clear solution on the entire website.
Can anyone help?
Tried one of the solution suggested above (second one) but this way I could only hide the sidebar output. Actually the code doesn’t stops putting goods in the cart (e.g. number of items included in the cart is shown in the top menu as “My cart (4)” as well as in recently added items).
Is there other way not to process cart with exceeding amount of items at all ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
vsnetfreak
Member
 
Avatar
Total Posts:  32
Joined:  2009-12-17
Bhilai, Chhattisgarh
 

Any one got the solution for this one ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
gavankun
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2009-04-08
 

I\’m also looking for solution where\’s to limit item in shopping cart.

Cannot find tips inside this support forum

Magento show add this option into feature release.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top