Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

How to limit the total number of items in shopping cart?

by

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, 10 months ago by Dan.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • July 8, 2013 at 1:14 pm #9304
    Dan
    Member

    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 #56475
    Dan
    Member

    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-cart

    July 8, 2013 at 2:28 pm #56476
    Dan
    Member

    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

    [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 #56477
    Peter
    Member

    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:

    “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 #56478
    wpCommerce
    Moderator

    Hi, please do the following:

    1. install a fresh copy WP eStore plugin:

    Re-install or Load a Fresh Copy of the Plugin(s)

    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 #56479
    Dan
    Member

    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:

    ESTORE_CART_QTY_LIMIT_EXCEEDED1

    Any other thoughts? Thanks

    July 9, 2013 at 4:06 am #56480
    Dan
    Member

    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
    Dan
    Member

    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
    Dan
    Member

    Ok.

    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 #56483
    Dan
    Member

    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 thanks

    July 10, 2013 at 9:22 pm #56484
    Dan
    Member

    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:

    ESTORE_CART_QTY_LIMIT_EXCEEDED

    Now that I have fixed this it works like a charm.

    Thanks for the help

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ