Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › How to limit the total number of items in shopping cart?
Tagged: limit cart, limit products, maximum cart, maximum number
- This topic has 10 replies, 3 voices, and was last updated 9 years, 8 months ago by Dan.
July 8, 2013 at 1:14 pm #9304
I’m offering 30+ free downloadable items and I don’t want users to download more than 3 (any combination) in a single order.
Can this be done?
ThanksJuly 8, 2013 at 2:06 pm #56475
Just found this related post. Is this what I need to do but edit it to 3 instead of 1?
https://support.tipsandtricks-hq.com/forums/topic/estore-allow-only-one-product-in-cartJuly 8, 2013 at 2:28 pm #56476
Actually yes, it did work.
But it’s not bringing up the correct error text “Shopping quantity limit exceeded! You cannot exceed the quantity limit of ” stated in wp-cart-for-digital-products/languages/eng.php
Instead, it brings up “ESTORE_CART_QTY_LIMIT_EXCEEDED3” on the frontend which is strange:
ThanksJuly 9, 2013 at 12:13 am #56477PeterMember
I’ve noticed that the global variable which is meant to represent the message for quantity limit appears to be incorrect, ie,
The correct string should be:
But you have a “3” added on the end, ie,
It appears that you have made a typo when you were modifying the code and I would suggest that you check your changes once again.July 9, 2013 at 12:16 am #56478wpCommerceModerator
Hi, please do the following:
1. install a fresh copy WP eStore plugin:
2. open the
eStore_advanced_configs.phpfile and search for the following line of code:
Once you find it, change it to the following:
Make this simple change and see how it goes.July 9, 2013 at 3:58 am #56479
Thanks for the replies.
I was very careful only to edit this line on the file and all I did was to change the 0 into a 3:
define(‘WP_ESTORE_CART_CHECKOUT_ITEM_LIMIT’, 3);//0 disables any limit (specifying a number here will enable a shopping cart item limit)
By the way, I also tested changing that to 1 but I get the same error:
Any other thoughts? ThanksJuly 9, 2013 at 4:06 am #56480
I figured it out. There was no spacing between the code and the notes on the text. Worth a quick look from your end. Thanks for the help anyways!July 10, 2013 at 12:39 pm #56481
Please ignore my previous post.
The same issue is still happening but I noticed that it’s a bit erratic. I’m doing a few tests and will post the results soon.July 10, 2013 at 1:39 pm #56482
The same issue continues (even if I just enter a number 1 instead of 3)
I now tested adding ” before and after the number and it does not show the incorrect error message anymore. It shows no error message at all but at least it works.
Here’s how it is now:
Any ideas on how I can get the correct error message to appear?
ThanksJuly 10, 2013 at 2:30 pm #56483
I’ve tested again and now the error message is back.
Can one of you guys please login and see what’s happening? If so where can I send the login details to?
Many thanksJuly 10, 2013 at 9:22 pm #56484
Glad to report that I finally solved the problem.
This line of code in languages.php was incorrect:
define(“ESTORE_QTY_LIMIT_EXCEEDED”, “Shopping quantity limit exceeded! You cannot exceed the quantity limit of “);
It was missing the word CART:
Now that I have fixed this it works like a charm.
Thanks for the help
- You must be logged in to reply to this topic.