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




LinkBack URL
About LinkBacks









Bookmarks