Hello,
I’m looking for a solutions for hiding all shipping methods when a customer has free shipping instead of pickup. I found Some extensions but they hide also the pickup solution. I have the latetst version of oc.
Can somebody help me?
Thanks, Jan
That's a bit more complicated, you may want to get something like Restrict Shipping Methods which can actually do this for any shipping method, and doesn't require modifying code. However, if you want to try it yourself, you could change the edit suggested in my tutorial to this, which I haven't tested but should work:
Code: Select all
$new_shipping_quotes = array();
if (isset($quote_data['free'])) {
$new_shipping_quotes['free'] = $quote_data['free'];
}
if (isset($quote_data['pickup'])) {
$new_shipping_quotes['pickup'] = $quote_data['pickup'];
}
if (!empty($new_shipping_quotes)) {
$quote_data = $new_shipping_quotes;
}
$new_shipping_methods = array();
if (isset($method_data['free'])) {
$new_shipping_methods['free'] = $method_data['free'];
}
if (isset($method_data['pickup'])) {
$new_shipping_methods['pickup'] = $method_data['pickup'];
}
if (!empty($new_shipping_methods)) {
$method_data = $new_shipping_methods;
}
So you want to hide other shipping method (except Pickup), when free is available?
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Who is online
Users browsing this forum: davidmarkdavid34 and 270 guests