Hi, I have a question about setting shipping options. I’ve looked at various topics but can’t quite figure it out. The situation is as follows.
I charge €5.95 shipping costs for orders up to €50 or €4.95 to €50 if the customer wants to collect from a DHL Service Point. Both options are free for orders over €50. I also have three physical stores where customers should be able to pick up (free) and pay in the store.
I have set the option to pick up in store, but unfortunately it is not shown.
There is a plugin that works for DHL E-commerce. Customers can check this box and choose a DHL point. This works fine up to €50, but above €50 Woocommerce shows the Free shipping option. According to various forums, this is a known annoyance because it can be confusing for customers. If they order more than €50, only the options DHL Service Point, Home Delivery and Collection should be shown. And not Free Shipping again. There is a piece of code known to remove that option:
function hide_shipping_when_free_is_available( $rates, $package ) {
$new_rates = array();
foreach ( $rates as $rate_id => $rate ) {
// Only modify rates if free_shipping is present.
if ( ‘free_shipping’ === $rate->method_id ) {
$new_rates[ $rate_id ] = $rate;
break;
}
}
if ( ! empty( $new_rates ) ) {
//Save local pickup if it’s present.
foreach ( $rates as $rate_id => $rate ) {
if (‘local_pickup’ === $rate->method_id ) {
$new_rates[ $rate_id ] = $rate;
break;
}
}
return $new_rates;
}
return $rates;
}
But unfortunately this means that the DHL option (service point selector) is no longer shown. And that is not the intention. Is there a manual available from you on how to properly set such options so that they are all present and work properly?