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 11 years, 4 months ago by Dan.
-
AuthorPosts
-
July 8, 2013 at 1:14 pm #9304DanMember
Hi,
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?
Thanks
July 8, 2013 at 2:06 pm #56475DanMemberJust 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-cart
July 8, 2013 at 2:28 pm #56476DanMemberActually 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
[http://awesomescreenshot.com/0da1hd63d5]
Instead, it brings up “ESTORE_CART_QTY_LIMIT_EXCEEDED3” on the frontend which is strange:
[http://awesomescreenshot.com/0e21hd6icd]
Please help.
Thanks
July 9, 2013 at 12:13 am #56477PeterMemberI’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:
“ESTORE_CART_QTY_LIMIT_EXCEEDED”
But you have a “3” added on the end, ie,
“ESTORE_CART_QTY_LIMIT_EXCEEDED3“
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 #56478wpCommerceModeratorHi, please do the following:
1. install a fresh copy WP eStore plugin:
2. open the
eStore_advanced_configs.php
file and search for the following line of code:define('WP_ESTORE_CART_CHECKOUT_ITEM_LIMIT', 0);
Once you find it, change it to the following:
define('WP_ESTORE_CART_CHECKOUT_ITEM_LIMIT', 1);
Make this simple change and see how it goes.
July 9, 2013 at 3:58 am #56479DanMemberThanks 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:
ESTORE_CART_QTY_LIMIT_EXCEEDED1
Any other thoughts? Thanks
July 9, 2013 at 4:06 am #56480DanMemberI 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 #56481DanMemberPlease 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 #56482DanMemberOk.
The same issue continues (even if I just enter a number 1 instead of 3)
But
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:
define(‘WP_ESTORE_CART_CHECKOUT_ITEM_LIMIT’, ‘3’);
Any ideas on how I can get the correct error message to appear?
Thanks
July 10, 2013 at 2:30 pm #56483DanMemberI’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 thanks
July 10, 2013 at 9:22 pm #56484DanMemberGlad 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:
ESTORE_CART_QTY_LIMIT_EXCEEDED
Now that I have fixed this it works like a charm.
Thanks for the help
-
AuthorPosts
- You must be logged in to reply to this topic.