Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Max Quantity Order Rate Topic   - - - - -

 
  • jeta
  • Advanced Member
  • Trial users
  • Join Date: 01-Apr 16
  • 114 posts

Posted 07 June 2018 - 01:48 PM #1

Hello,

 

Is there any way to put a maximum order for all the products in my store? For example i dont want the customer to buy more than 10 products, i know that i can put the max for every product but i want to put the same maximum for all my products.

Actually the customer can put as quantity as he wants to buy but for example if he wants 50 and i have 45 automatically 45 products are put in the customer cart exposing this way my stock, i wont a possibility: 1. if he wants to buy 50 and i have in stock 45 to show the message there is not enough stock and not to put in his cart 45 or if this is not possible to put a maximum quantity for buying.

 

I will appreciate any suggestion,

 

Thanks in advance.



 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3176 posts

Posted 07 June 2018 - 02:23 PM #2

Every product description has

Minimum order quantity:
Maximum order quantity:

 

I have my product page done like this

https://forum.cs-car...k/?fromsearch=1

 

if got less then 100 product got in stock written, if 100+ then actual amount printed



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 08 June 2018 - 06:06 AM #3

Hello,

 

Is there any way to put a maximum order for all the products in my store? For example i dont want the customer to buy more than 10 products, i know that i can put the max for every product but i want to put the same maximum for all my products.

Actually the customer can put as quantity as he wants to buy but for example if he wants 50 and i have 45 automatically 45 products are put in the customer cart exposing this way my stock, i wont a possibility: 1. if he wants to buy 50 and i have in stock 45 to show the message there is not enough stock and not to put in his cart 45 or if this is not possible to put a maximum quantity for buying.

 

I will appreciate any suggestion,

 

Thanks in advance.

 

Unfortunately there is no ability to set maximum amount of items for the whole order.


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • jeta
  • Advanced Member
  • Trial users
  • Join Date: 01-Apr 16
  • 114 posts

Posted 08 June 2018 - 08:23 AM #4

Unfortunately there is no ability to set maximum amount of items for the whole order.

I understand, but is it possible that if the customer wants to buy a product with quantity 30 and that product has quantity 25 to not add in cart that produtct with quantity 25 (as it happens now) but show there is not enough stock??



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 08 June 2018 - 12:27 PM #5

Unfortunately, no


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • jeta
  • Advanced Member
  • Trial users
  • Join Date: 01-Apr 16
  • 114 posts

Posted 06 July 2018 - 12:01 PM #6

Unfortunately, no

Is there any way to set a max order amount as it is for min order amount?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17827 posts

Posted 06 July 2018 - 01:21 PM #7

- app/controllers/frontend/checkout.php

- app/functions/fn.cart.php

 

In this files you can find conditions for minimum order amount. Search by min_order_amount. Use it as example


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 06 July 2018 - 06:58 PM #8

You can use the 'check_add_to_cart_pre' hook and have your hook function be something like

define('MY_MAX_ITEMS', 30);
fn_my_changes_check_add_to_cart_pre(&$cart, &$product, $product_id, &$result) {
  $to_add = $product['amount'];
  $max_quantity = MY_MAX_ITEMS;
  if( !empty($cart['products']) ) {
    foreach($cart['products'] as $cid => $p) {
    $cur_quantity += $p['amount'];
    }
  }
  if( ($cur_quantity + $to_add) > $max_quantity) {
  $result = false;
  fn_set_notification('W', __("warning"), "Max items ($max_quantity) in cart exceeded.  Please complete checkout before ordering more items", 'K');
  }
}

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.