Contributions
Minimum Product Quantity with Admin
This contrib is a heavy modification of "Min Order Quantity" By Dave Latham.
It allows you to specify a minimum quantity for each individual product (stored in a new database field) and has an admin interface to turn the feature on or off.
It also has the capability to display the minimum order number on the product_info page.
Instructions are in txt form inside the zip
Expand All / Collapse All
Complete instructions to install MPQ v1.5
Includes all the previous updates.
In this version I added the capability to turn On/Off and specify the order in which to display the "MQP column" in the products listing page (user interface, index.php file) through the admin panel.
Complete instructions to install MPQ v1.4.
Includes the fix added in the previous update.
Problem, for items with attributes once the item was added to the cart and the product qty was updated the attributes would be lost. This fixes this problem.
Change this line:
$cart->add_cart($products[$i]['id'],$products[$i]['quantity']);
to this:
$cart->add_cart($products[$i]['id'],$products[$i]['quantity'],$products[$i]['attributes']);
Complete instructions to install MPQ v1.3.
Includes fixes added in the previous updates.
To replace the javascript alert in v1.2 do the following:
1) REPLACE
echo '<script language="javascript">alert ("Minimum order amount for:nn"'.$products[$i]["name"].'" is '.$products[$i]["min_quant"].'.nnYour cart has been updated to reflect this.");</script>';
WITH
$cart_notice = sprintf(MINIMUM_ORDER_NOTICE, $products[$i]["name"], $products[$i]["min_quant"]);
2) AFTER
<td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td>
</tr>
<?php
}
}
INSERT
if ($cart_notice) {
?>
<tr>
<td class="stockWarning" align="center"><br><?php echo $cart_notice; ?></td>
</tr>
<?php
}
3) In includes/languages/english/shopping_cart.php add
define('MINIMUM_ORDER_NOTICE', "Minimum order amount for %s is %d. Your cart has been updated to reflect this.");
In STEP 9 of your description you forgot to mention:
Find:
'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));
and insert BEFORE it:
'minorder' => tep_db_prepare_input($HTTP_POST_VARS['minorder']),
This changes things...
previous version allowed a differene minimum level for each language (if you want this use 1.1) but i changed it so that each product has a minimum level no matter the language.
Makes populating data for minorder much easier.
Upgrade instructions included for 1.1 users.
Now you have the ability to manage each individual product's minimum level.
Good luck!
-Mark
This contrib is a heavy modification of "Min Order Quantity" By Dave Latham.
It allows you to specify a minimum quantity for each individual product (stored in a new database field) and has an admin interface to turn the feature on or off.
It also has the capability to display the minimum order number on the product_info page.
Instructions are in txt form inside the zip
Note: Contributions are used at own risk.