Post by friedchicken » Thu Feb 23, 2017 10:26 pm

Hi, currently my shipping option displays flat rate shipping fee even if the free shipping option min order is met. I found solutions for other versions but not applicable for OC

I found from the shipping template below code that it will auto select/checked the free shipping within the loop. Any help to code it to drop other shipping option if free is detected?

Thanks for the help!

Code: Select all

<?php if (!$shipping_method['error']) { ?>
<?php foreach ($shipping_method['quote'] as $quote) { ?>
<div class="radio">
    <?php if ($quote['code'] == $code || !$code) { ?>
    <?php $code = $quote['code']; ?>
    <input type="radio" name="shipping_method" value="<?php echo $quote['code']; ?>" checked="checked" />
    <?php } else { ?>
    <input type="radio" name="shipping_method" value="<?php echo $quote['code']; ?>" />
    <?php } ?>
    <?php echo $quote['title']; ?> - <?php echo $quote['text']; ?></label>
<?php } ?>



Thu Feb 23, 2017 10:19 pm

Post by Johnathan » Thu Feb 23, 2017 11:59 pm

The easiest solution is just to get an extension that is capable of showing (and hiding) flat rate charges based on total, like Total-Based Shipping. That way you can choose when your flat rate charges show, and when your free shipping charges show.

However, I also have a tutorial here that details how to hide all other shipping methods when Free Shipping is active. It still works with OpenCart 2.3 (just keep in mind you only need to edit the files that exist on your server): ... e-shipping

Image Image Image Image

User avatar
Global Moderator


Fri Dec 18, 2009 3:08 am

Post by friedchicken » Sat Feb 25, 2017 12:25 am

Hi Jonathan,

Thanks. Your tutorial helped me. Just needed to add your code at the catalog/controller/checkout/shipping_method.php


Now for moving on to my next issue item.... :crazy:



Thu Feb 23, 2017 10:19 pm
Who is online

Users browsing this forum: No registered users and 3 guests