![]() |
Minimum Products Allowed To checkout
Again another simple but useful option
We already have an option for the following Minimum allowed order subtotal: Maximum allowed order subtotal (0 means no maximum limit): Maximum allowed total quantity of products in an order (0 means no maximum limit): It would be useful to complete the set and add the following option too Minimum allowed total quantity of products in an order (0 means no maximum limit): Im working on a store now that wishes to set a minimum quantity ordered before you can checkout |
Re: Minimum Products Allowed To checkout
As I had to do this anyway if anyone needs it heres how it can be done ...
this is done for 4.1.8 but it should not be too hard to adjust it for other versions. Its basically a rehash of the max amount setting. for starters put this into the config table Code:
INSERT INTO `xcart_config` ( `name` , `comment` , `value` , `category` , `orderby` , `type` , `defvalue` , `variants` ) Then edit cart.php and find ... Code:
if ($mode == "checkout" && !$func_is_cart_empty && $config["General"]["maximum_order_items"] > 0 && func_cart_count_items($cart) > $config["General"]["maximum_order_items"]) { and just after it add this Code:
# Next up add the following language variable via the languages section Code:
topic - errors next up edit skin1/customer/home_main.tpl find Code:
{elseif $main eq "error_max_items"} and just after it add this .. Code:
{elseif $main eq "error_min_items"} finally make a new tpl file (you can make a copy of error_max_itemps.tpl) skin1/main/error_min_items.tpl this is the code for the template file Code:
{* $Id: error_min_items.tpl,v 1.2 2005/11/17 06:55:39 max Exp $ *} you should now be able to set the minimum amount of items that need to be added to the cart before someone can checkout. If you leave this as zero then it will be ignored |
All times are GMT -8. The time now is 04:22 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.