Remove Specific Shipping Method Based on Condition in Magento 2

checkoutmagento2shipping-methods

I have installed a store pick up extension in our website. This extension showing two option as radio buttons

Collect in Store

  1. Yes
  2. No

So if we select 'NO', then in shipping method,

There is an additional shipping method showing like below.

Store pickup 0.00

Can we hide this option from the list if the extension installed is enabled?

In which file we can hide specific shipping method based on condition.

Can anyone help me with the issue?

I need to hide the specific shipping method from the list of options.

Best Answer

I am able to resolve this error like below.

Added id for each tr that is, each shipping rates.

<tr class="row" data-bind="attr: {                                                    
                           'id': 'shippingval_' + method.method_code}
                            ,click: $parent.selectShippingMethod" >

Then using css, hidden the specific shipping method that is "pickupstore" in my case.

Hope this may help for others.

Cheers!!

Related Topic