PDA

View Full Version : How to configure "Minimum Order" in storefront.



doricanchef
09-26-2005, 11:43 AM
Could any of you help me figure out how to set my store to only accept a minumum order of 2 (like) items. I am selling food items and need the customer to be able to order 2 or more items as it would not be profitable for me to only make 1. The can order 2, 3, 4 or more, but cannot order only 1.

I'm not talking about a minimum of 2 orders before they can proceed to checkout, but the minimum purchase for item A is 2.

Any ideas?

Carlos

AnnieChrist
09-26-2005, 08:25 PM
Try this contribute but you may have to modify it to fit your oscommerce version http://www.oscommerce.com/community/contributions,2198/page,2

doricanchef
09-26-2005, 08:32 PM
That's the contribution that I was trying to install. The instructions say to edit Shopping_Cart.php on line 144, but mine only has 26 lines in it. I'm using OSMAX, so I believe they are set-up different than that OSc straight version.

I made sure I was in the right cart in /catalog and not the one deeper in /languages.

AnnieChrist
09-26-2005, 08:46 PM
you edit the file in catalog/templates/EXAMPLEaabox/contents/shopping_cart.tpl.php the line is around 104 follow the instructions

doricanchef
09-26-2005, 09:25 PM
I did everything up to Step 8: I got this parse:

Parse error: parse error, unexpected '<' in /hsphere/local/home/carlitov/doricancatering.com/catalog/templates/content/shopping_cart.tpl.php on line 163

These are those lines of text:

<?php
}
}
?>
//Minimum quantity code
if ($cart_notice) {
?>
<tr>
<td class="stockWarning" align="center"><br><?php echo $cart_notice; ?></td>
</tr>
<?php
}
//End Minimum quantity code

<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>

Line 164 is the second line after: //End Minimum quantity code

Any ideas what I did wrong?

michael_s
09-27-2005, 05:13 AM
You are missing ?> on the blank line below //End Minimum quantity code

doricanchef
09-27-2005, 05:55 AM
Ok, now I get this:

Parse error: parse error, unexpected '}' in /hsphere/local/home/carlitov/doricancatering.com/catalog/templates/content/shopping_cart.tpl.php on line 190

Line 190 = } else {

Am I missing another ?> somewhere?

Here's the code (from the last error on 164 to the end)

<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td class="main"><?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td>
<?php
$back = sizeof($navigation->path)-2;
if (isset($navigation->path[$back])) {
?>
<td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>
<?php
}
?>
<td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<?php
} else {
?>
<tr>
<td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<?php
}
?>
</table></form>

Cisco
07-01-2006, 09:16 AM
This works great, only one thing.

If you have twebty items listed the code checks each product again and again after you keep adding more items. The customer will have to keep accepting the qty for each item each time. Also if the qty is greater than the min desired and you sell 20 per box as the case qty. When the customer adds more of the same item it will only add 1 more to the qty making it 21 instead of 40.

How do keep it from checking items already updated to the min. qty?

Is there a way to make the product description reflect the desired qty you will sell it, in the admin panel for each product?