X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Setting a maximum order quantity for products (https://forum.x-cart.com/showthread.php?t=72791)

SamsonWebDesign 09-17-2015 01:43 AM

Setting a maximum order quantity for products
 
Does anyone know a quick way I can use the minimum order quantity for products in X-Cart 4.7 and change it to be a maximum instead.

I'm guessing I can simply change the validation on that field to be greater than instead of less than but I'm struggling to find where that validation is carried out.

Any help appreciated. :-)

seyfin 09-22-2015 03:30 AM

Re: Setting a maximum order quantity for products
 
Actually, there are multiply lines of code that check the minimum order quantity for products, for example:

include/func/func.cart.php

Code:

    // Update the quantities

    foreach ($productindexes as $productindex => $new_quantity) {
...
        $amount_min = func_query_first_cell("SELECT min_amount FROM $sql_tbl[products] WHERE productid='$productid'");
...
        if (
            $new_quantity >= $amount_min
            && !empty($active_modules['Egoods'])
            && !empty($cart['products'][$productindex]['distribution'])
        ) {

            $cart['products'][$productindex]['amount'] = 1;
...
        }
    }



All times are GMT -8. The time now is 05:31 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.