Opencart how to show free shipping if order is above X amount otherwise X delivery charges

Here is a simple idea, return Flat Rate only if Subtotal amount is less then Free shipping

// catalog/model/shipping/flat.php

replace

 return $method_data;

with

if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
    return $method_data;
  }