I did it!
Found a way around it and it works with OPC thanks to Ajeh and this code https://www.zen-cart.com/showthread....70#post1240770 from where I got the idea. Perhaps it isn't elegant but it accomplishes what I need.
This little piece of code prevents the checkout buttons from appearing if free shipping (from freeoptions) is used in conjunction with reward points and if the cart total gets below the minimum amount for free shipping to kick in. But it allows the selection of a different shipping option.
Adding the code in red to templates/tpl_modules_opc_submit_block.php
Code:
<?php
// -----
// Part of the One-Page Checkout plugin, provided under GPL 2.0 license by lat9 ([email protected]).
// Copyright (C) 2013-2017, Vinos de Frutas Tropicales. All rights reserved.
//
// Check to see that at least one shipping-method and one payment-method is enabled; if not, don't render the submit-button.
//
if ($shipping_module_available && $payment_module_available) {
// -----
// Set up two form-submittal buttons, one for payment methods that require confirmation and one for those that don't.
// This page's header_php.php has created an array of payment modules that require confirmation, which is pulled into the
// page's jscript_main.php.
//
?>
<!-- bof disable checkout button from displaying 1 of 1 -->
<?php
if (!IS_ADMIN_FLAG) {
global $order, $db;
if (($order->info['total'] < MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) && (substr_count($_SESSION['shipping']['id'], 'freeoptions') !=0)) {
echo '<div style="border: 3px solid #777777; padding: 10px 0;"><p style="text-align: center;"><strong>Your order does not qualify for Free Shipping at this time.</strong></p>
<p style="text-align: center;"><strong>Please head back to the - <a href="index.php?main_page=shopping_cart">SHOPPING BAG</a> - to add more products, increase the quantity of products in your bag to meet the minimum order amount required to qualify
for free shipping, or select a different shipping option above.</strong></p>';
echo'<span id="opc-order-confirm"></span>';
}
}
?>
<!-- eof disable checkout button from displaying 1 of 1 -->
<!--bof submit block -->
<div id="checkoutOneSubmit" class="buttonRow">
<span id="opc-order-confirm"><?php echo zen_image_button(BUTTON_IMAGE_CHECKOUT_ONE_CONFIRM, BUTTON_CHECKOUT_ONE_CONFIRM_ALT, 'name="btn_submit" id="btn_submit"'); ?></span>
<span id="opc-order-review"><?php echo zen_image_button(BUTTON_IMAGE_CHECKOUT_ONE_REVIEW, BUTTON_CHECKOUT_ONE_REVIEW_ALT, 'name="btn_submit" id="btn_submit"'); ?></span>
<?php echo zen_draw_hidden_field('order_confirmed', '1', 'id="confirm-the-order"') . zen_draw_hidden_field ('current_order_total', '0', 'id="current-order-total"'); ?>
</div>
<div class="clearBoth"></div>
<!--eof submit block -->
<?php
}
Bookmarks