Fellow zenners,
Here's my alternative solution to the minimum order problem, whereby the minimum order must be reached before they can proceed to checkout. It's basically done using the session.
All you need to do is edit three files:
1) header_php.php (within /zencartroot/includes/modules/pages/checkout_shipping/)
2) tpl_shopping_cart_default.php (within /zencartroot/includes/templates/customtemplate/templates/)
3) shopping_cart.php (within /zencartroot/includes/languages/caftemp/)
For file 1), add:
// if the amount in the shopping cart is less than £3, redirect them back to the shopping cart page
$_SESSION['minimum_amount'] = false;
if ($_SESSION['cart']->show_total() < 3) {
$_SESSION['minimum_amount'] = true;
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
For file 2, add below the other error messages (after line 45):
<?php if($_SESSION['minimum_amount']) { ?>
<div class="messageStackError"><?php echo MINIMUM_ORDER_CANT_CHECKOUT; ?></div>
<?php //reset the session variable after warning them, so if they update their quantity using the blue arrows icon, the error dissapears
$_SESSION['minimum_amount'] = false;
} ?>
For file 3, add:
define('MINIMUM_ORDER_CANT_CHECKOUT', 'Your order must be at least £3. Please choose another product or make a donation.');
The only problem I'm having is getting that £ sign to display properly since it currently brings up "£3" instead of "£3". I'll post the solution when I find it.
Hope this helps someone.
Bookmarks