osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Maximum Product Quantity with Admin

This is a discussion on Maximum Product Quantity with Admin within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; This contribution is an excellent idea, but I found that it was possible to fill the cart with more than ...


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 01-06-2008, 10:00 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,314
Thanks: 67
Thanked 321 Times in 304 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 Maximum Product Quantity with Admin

This contribution is an excellent idea, but I found that it was possible to fill the cart with more than the maximum and proceed directly to checkout, bypassing the good work done by shopping_cart.php.

The following snippet, inserted in the top of the catalog/checkout_shipping.php file, solved the problem for me, by redirecting "overfull" carts at checkout back to /catalog/shopping_cart.php to be corrected.

If it helps you too, my work here is done!


Find
if (!tep_session_is_registered('cartID')) tep_session_register('cartID');
$cartID = $cart->cartID;

Insert after

//Check for maximum quantity
if(MAXIMUM_ORDERS == 'true'){
for ($i=0, $n=sizeof($order->products); $iproducts[$i]['id']."'");
while ($max_order = tep_db_fetch_array($max_order_query)) {
// set the cart item max var
if ($order->products[$i]['qty'] > $max_order['max_quant'] ) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART) );
}
}
}
}
//End MAXIMUM quantity code

More...
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates. New designs every month!

  • 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.

  • 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
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
Product Quantity Dropdown on Product Info Page michael_s New osCommerce Contributions 0 09-11-2007 11:13 AM
Product Quantity Dropdown on Product Info Page michael_s New osCommerce Contributions 0 06-12-2007 01:14 PM
Minimum Product Quantity with Admin v1.5 Twister osCMax v2 Customization/Mods 2 05-27-2007 02:23 AM
Maximum Stock Quantity on Stock Page? Dubious osCMax v2 Features Discussion 0 08-18-2006 02:17 PM
Changing maximum number of orders displayed in admin panel markymrk22 osCommerce 2.2 Installation Help 1 09-03-2005 10:56 AM


All times are GMT -8. The time now is 12:08 AM.


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