i have applied free shipping on specifics amount, but on the checkout page the option of flat shipping option is still showing,i think it should to be hide when the order is of free shipping, how can i fix that ? i'm OC v3.0.2, journal theme.
kindly see the link https://prnt.sc/rfp4st
store link https://lastchance.pk/
Best Regards.
Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Code: Select all
if (($this->config->get('shipping_free_status') == 1) && (float)$this->cart->getTotal() >= $this->config->get('shipping_free_total')) $status = false;
before
Code: Select all
if ($status) {
in the other shipping methods you do not want to show when free shipping applies
directory: catalog/model/extension/shipping/
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
i have tested X-Shipping does not work for me, and most of the plugins are paid!.kestas wrote: ↑Mon Mar 16, 2020 7:50 amHave you tried to find on marketplace some module to restrict shipping methods on some conditions? https://www.opencart.com/index.php?rout ... _license=0
i have tested this also in catalog/model/extension/shipping/free.php but it does not work for me, after applying the code free shipping option does not show. Only Flat Shipping option left there.letxobnav wrote: ↑Mon Mar 16, 2020 3:42 pmyou can add
Code: Select all
if (($this->config->get('shipping_free_status') == 1) && (float)$this->cart->getTotal() >= $this->config->get('shipping_free_total')) $status = false;
before
Code: Select all
if ($status) {
in the other shipping methods you do not want to show when free shipping applies
directory: catalog/model/extension/shipping/
Have you tried this one: https://www.opencart.com/index.php?rout ... _license=0mamoon wrote: ↑Mon Mar 16, 2020 4:40 pmi have tested X-Shipping does not work for me, and most of the plugins are paid!.kestas wrote: ↑Mon Mar 16, 2020 7:50 amHave you tried to find on marketplace some module to restrict shipping methods on some conditions? https://www.opencart.com/index.php?rout ... _license=0
This is not my extension, so I don't know it work or no, but you can try. It is free.
Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here
Code: Select all
// is free shipping module enabled and the cart subtotal eligible
if (($this->config->get('shipping_free_status') == 1) && (float)$this->cart->getSubTotal() >= $this->config->get('shipping_free_total')) {
// determine shipping is actually free based on address
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('shipping_free_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')");
if (!$this->config->get('shipping_free_geo_zone_id')) {
$free_status = true;
} elseif ($query->num_rows) {
$free_status = true;
} else {
$free_status = false;
}
// disable this shipping method if shipping is free
if ($free_status) {
$status = false;
}
}
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
thanks you save my life, this extension is working proper on my site, Thanks alot!kestas wrote: ↑Mon Mar 16, 2020 5:09 pmHave you tried this one: https://www.opencart.com/index.php?rout ... _license=0mamoon wrote: ↑Mon Mar 16, 2020 4:40 pmi have tested X-Shipping does not work for me, and most of the plugins are paid!.kestas wrote: ↑Mon Mar 16, 2020 7:50 amHave you tried to find on marketplace some module to restrict shipping methods on some conditions? https://www.opencart.com/index.php?rout ... _license=0
This is not my extension, so I don't know it work or no, but you can try. It is free.

your code looks good, i have not tested this because of the extension. but thanks alot for the help!letxobnav wrote: ↑Mon Mar 16, 2020 5:12 pmtry this, it takes the address in account:
Code: Select all
// is free shipping module enabled and the cart subtotal eligible if (($this->config->get('shipping_free_status') == 1) && (float)$this->cart->getSubTotal() >= $this->config->get('shipping_free_total')) { // determine shipping is actually free based on address $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('shipping_free_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')"); if (!$this->config->get('shipping_free_geo_zone_id')) { $free_status = true; } elseif ($query->num_rows) { $free_status = true; } else { $free_status = false; } // disable this shipping method if shipping is free if ($free_status) { $status = false; } }

Users browsing this forum: No registered users and 9 guests