Author Topic: Limit items in cart  (Read 541 times)

Offline trundle

  • Newbie
  • *
  • Posts: 13
  • Karma: +3/-0
    • View Profile
Limit items in cart
« on: November 12, 2020, 07:27:53 AM »
Is there any way to limit the amount of items a user can have in their cart? I know I can put quantity limits per item, but thats not what I need. We have an application where we want to only allow users to have three items in their cart for any single order. Can this be set somewhere?

TIA

Offline maxter

  • Full Member
  • ***
  • Posts: 211
  • Karma: +64/-0
    • View Profile
Re: Limit items in cart
« Reply #1 on: November 12, 2020, 11:15:23 PM »
There is no such setting to limit number or items in the cart, but should be relatively simple to alter in the code

There is "$this->cust_data" array in core/lib/cart.php class. This needs to be limited your requirement.



Offline trundle

  • Newbie
  • *
  • Posts: 13
  • Karma: +3/-0
    • View Profile
Re: Limit items in cart
« Reply #2 on: November 13, 2020, 02:21:07 PM »
Thank you for the reply, but I am not versed in php programming.
If you know what the code should read, I can modify the file.

Thanks again!

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4310
  • Karma: +289/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Limit items in cart
« Reply #3 on: November 14, 2020, 03:48:31 PM »
There are few things that needs to be changed. It would not be as simple as adding a line of code.

This might be a good feature to have for other users, if you are willing to contribute, we can have it done for you and other future versions.
PM if interested in more details.
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

 

Powered by SMFPacks Social Login Mod