edtiger Posted July 22, 2005 Share Posted July 22, 2005 Minimum Total Order Quantity is an adaptation of the minimum order total contribution for sites which need a minimum total quantity. This is not a minimum quantity per product but a minimum total quantity. The contribution uses the calculation of total items in the order and checks that total against the minimum number set in the admin configuration area. Quote Link to comment Share on other sites More sharing options...
edtiger Posted July 22, 2005 Author Share Posted July 22, 2005 (edited) I don't anticipate many people will need help with this contrib-it's very straight forward and should work on your site even if it has been heavily modified (mine is). Nevertheless, if you have any questions please post to this form and I will try to help out. The contribution adds one database entery in the configuration table and adds a only a few lines of code to 6 files. Get the contribution here: Minimum Total Order Quantity Edited July 22, 2005 by edtiger Quote Link to comment Share on other sites More sharing options...
edtiger Posted August 4, 2005 Author Share Posted August 4, 2005 Small Fix Change STEP 3: run the following sql queryINSERT INTO `wholesale_configuration` VALUES ('', 'Minimum Total Order Quantity', 'MIN_TOTAL_ORDER_QUANTITY', '12', 'The minimum total quantity an order must be able to checkout. Only set this if you require an minimum of total items. Empty means no minimum.', 1, 30, '', '', NULL, NULL); to STEP 3: run the following sql queryINSERT INTO `configuration` VALUES ('', 'Minimum Total Order Quantity', 'MIN_TOTAL_ORDER_QUANTITY', '12', 'The minimum total quantity an order must be able to checkout. Only set this if you require an minimum of total items. Empty means no minimum.', 1, 30, '', '', NULL, NULL); I have different database table names to accomodate multiple shops in one database. This fix should help everyone with the default table names. Quote Link to comment Share on other sites More sharing options...
gingermark Posted August 17, 2005 Share Posted August 17, 2005 how do i set the minimum quantity from my admin agian ? and can iset it according to the category only.? Quote Link to comment Share on other sites More sharing options...
edtiger Posted September 9, 2005 Author Share Posted September 9, 2005 in the admin page select Configuration > My Store Search for "Minimum Total Order Quantity" and edit the number according to your needs. No it cannot be used as a minimum for categories. It only makes sure that the total quantity in the cart of all products combined reaches the minimum total you set. SORRY it took me so long to reply. For some reason I never received the auto notify that a post had occured to this forum. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 27, 2005 Share Posted October 27, 2005 (edited) No it cannot be used as a minimum for categories. Hello, thank you for your contribution. I was wondering if it would be difficult to modify this contribution to be category specific. Seems like a if/else statement could be added to check for a certain category, but i would be unclear of the syntax. In the store im working on, they have around 600 products, of which 450 or so are signs. The signs are all the same price, but they require a min. of 25 items per order for the signs only, does not have to be 25 of the same exact item. The rest of their items are 1-3 item min. Thanks for any advice you can provide w/ this. FrikFrak Edited October 27, 2005 by FrikFrak Quote Link to comment Share on other sites More sharing options...
edtiger Posted October 31, 2005 Author Share Posted October 31, 2005 Try adding a function to catalog/includes/classes/shopping_cart.php that looks something like this: function count_cat_contents() { // get total number of items in cart $total_items = 0; if (is_array($this->contents)) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { //modify this line so it only collects quantities from products within desired category $total_items += $this->get_quantity($products_id); } } return $total_items; } Then change all the code in my setup file to the following: if ($cart->count_cat_contents() < MIN_TOTAL_ORDER_QUANTITY) { That should get you started. I wouldn't know exactly how to do it without coding the fix myself... Quote Link to comment Share on other sites More sharing options...
Guest Posted November 2, 2005 Share Posted November 2, 2005 (edited) Great, sorry for slow response, Thank you for you assistance, and advice. Ive added the code above, and changed the few spots as you suggested, but when attempting to checkout, i get this error... Fatal error: Call to undefined function: count_cat_contents() in category/checkout_shipping.php i tried moving the function from catalog/includes/class/shopping_cart.php to category/checkout_shipping.php and get the same error any ideas ? lol got me boggled cause the function name, and the calls to that function are the same, another words no typos.... and its there so im unsure why it says its undifined. also, the category id # is 1 that im checking for, im unclear exactly where to add that in that line, when i try where i think it should be, it gives parse errors... Thanks again for your help -John Edited November 2, 2005 by FrikFrak Quote Link to comment Share on other sites More sharing options...
Guest Posted November 9, 2005 Share Posted November 9, 2005 ok that was dumb on my part i see, i added the function in the wrong file.... anyway, could someone tell me how to add category id # 1 to this line ? ive tried bout everything, and i keep getting parse errors expected blah blah while (list($products_id, ) = each($this->contents)) { Please, anyone ? thanks -John Quote Link to comment Share on other sites More sharing options...
edtiger Posted November 28, 2005 Author Share Posted November 28, 2005 ok that was dumb on my part i see, i added the function in the wrong file.... anyway, could someone tell me how to add category id # 1 to this line ? ive tried bout everything, and i keep getting parse errors expected blah blah while (list($products_id, ) = each($this->contents)) { Please, anyone ? thanks -John You will want to add a database query somewhere in here like this: $products_query = tep_db_query("select products_id, categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "'"); The category id is not being retrieved from the database so you first need to grab it so you can use it to check against the category id of products in the shopping cart. This should get you started. I don't know how to do the rest of it without doing it myself to an install of oscommerce. Quote Link to comment Share on other sites More sharing options...
airolg Posted February 15, 2006 Share Posted February 15, 2006 I'm getting this error, any ideas? This is on the checkout_shipping.php file after I've clicked continue. TEXT_ORDER_UNDER_MIN_QUANTITY_AMOUNT Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/mysite.com/httpdocs/store/checkout_shipping.php:68) in /home/httpd/vhosts/mysite.com/httpdocs/store/includes/functions/general.php on line 29 On the checkout_shipping.php page itself, it has TEXT_ORDER_UNDER_MIN_QUANTITY_AMOUNT above my logo. I did see the red error message, but I was trying to be a customer and pretended to miss it so I could see what happens. Any ideas? Quote Link to comment Share on other sites More sharing options...
edtiger Posted February 15, 2006 Author Share Posted February 15, 2006 (edited) First check to make sure there are no extra line breaks at the end of your checkout_shipping.php and general.php files after the ?> tag. If there are extra line breaks, it will often give an error similar to the one you mention. TEXT_ORDER_UNDER_MIN_QUANTITY_AMOUNT means you haven't added the variable to your checkout_shipping.php english file. Add this variable to that file and that should go away. Edited February 15, 2006 by edtiger Quote Link to comment Share on other sites More sharing options...
airolg Posted February 17, 2006 Share Posted February 17, 2006 Update: That didn't work, but it has in the past. I just uploaded the files again and that seemed to take care of it. Quote Link to comment Share on other sites More sharing options...
edtiger Posted February 18, 2006 Author Share Posted February 18, 2006 I wonder if the files got corrupted during your first ftp. Sometimes it happens to me--I like to use Beyond Compare to make sure the files on the server look the same as the ones on my pc. Quote Link to comment Share on other sites More sharing options...
shooshoos Posted November 24, 2010 Share Posted November 24, 2010 Hi I know this is old - but I installed it on my old oscommerce site - the message comes up fine in the cart saying that there is a minimum - but you can still press checkout and go through the whole process with less items in the cart. Is this module meant to make it impossible to check out unless the minimum is met? Im using FF 3.6.12. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
shooshoos Posted November 24, 2010 Share Posted November 24, 2010 I reinstalled and it seems to work now - thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.