osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Minimum Order Quantity Per Product

This is a discussion on Minimum Order Quantity Per Product within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; Fix for bypassing the shopping cart and going to checkout. A user can add a quantity less than the minimum, ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 06-20-2008, 10:30 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,979
Thanks: 80
Thanked 345 Times in 324 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post Minimum Order Quantity Per Product

Fix for bypassing the shopping cart and going to checkout. A user can add a quantity less than the minimum, instead of going to shopping cart, can go to checkout and the price, quantity never gets updated.

Added a check on checkout_shipping.php for checking quantities in cart with minimum quantity for product. The addition simply does a check, if a product does not have the correct quantity, they will be redirected to the shopping cart for it to make the udpates.

On line (42) or somewhere close find:

require(DIR_WS_CLASSES . 'order.php');
$order = new order;

Add this below:

// ================================================== ===============
// CHECK FOR MINIMUM QUANTITY FOR CHECKOUT
// fix for contribution Minimum Product Quantity
// if user adds less than minimum quantity for product, the
// checkout button lets them proceed and make the purchase
// with out the minimum quantity.
// ================================================== ===============

for($xix = 0; $xix < count($order->products); $xix++)
{
$check_quantity_query = tep_db_query("SELECT minorder FROM ".TABLE_PRODUCTS." WHERE products_id=".tep_get_prid($order->products[$xix]['id']));
$check_quantity_results = tep_db_fetch_array($check_quantity_query);

if($order->products[$xix]['qty'] < $check_quantity_results['minorder'])
{
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART) );
}
}

// ================================================== ===============
// END CHECK FOR MINIMUM QUANTITY FOR CHECKOUT
// ================================================== ===============


More...
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
minimum quantity per product ctbhost osCMax v2 Customization/Mods 1 06-01-2008 10:10 AM
Minimum Product Quantity with Admin v1.5 Twister osCMax v2 Customization/Mods 2 05-27-2007 03:23 AM
Minimum Order Quantity Per Product michael_s New osCommerce Contributions 0 01-12-2007 07:56 PM
Minimum order with low order fee FSUddin osCommerce 2.2 Modification Help 2 12-14-2004 08:19 AM
Quantity to order shown on Product detail doug osCommerce 2.2 Modification Help 5 03-06-2003 01:51 AM


All times are GMT -8. The time now is 07:43 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax