Opencart Version 2.3.0.2 - currently using Vqmod (below) to hide other shipping when free shipping is active. I am looking to adapt it to also hide free shipping for a particular Customer group = '2" (i.e. Wholesale customers will not see\be allowed free shipping).
<file path="catalog/model/extension/shipping/*.php">
<operation error="skip">
<search><![CDATA[if ($status) {]]></search>
<add position="before"><![CDATA[
if (get_class($this)!='ModelExtensionShippingFree') {
if (($this->config->get('free_status') == 1) && (float)$this->cart->getTotal() >= $this->config->get('free_total')) {
$status = false;
}
}
]]></add>
I haven't had a lot of experience with opencart, but AFAIK you don't need to use
vqmodfor opencart v2.3 or above. Plus, it's performance bottelneck and unpredictable.The
indexmethod of classControllerCheckoutShippingMethod[catalog/controller/checkout/shipping_method.php] is responsible for generating all the shipping methods and putting them all inside the session. Opencart allows us to place an event right after this index method call and modify the final output.Create a module with the below content inside the
installmethod and whatever else you wanna put it in there: