cancel
Showing results for 
Search instead for 
Did you mean: 

Shipping Method Dropdown and Set Default Shipping Method on Cart Page

Shipping Method Dropdown and Set Default Shipping Method on Cart Page

Hi

In magento2 how to make shipping method radio buttons in cart to dropdown in cart.

 

4 REPLIES

Re: Shipping Method Dropdown and Set Default Shipping Method on Cart Page

Hi @sanganagouda,

 

Can you show an example of the customziation you are looking for?

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Shipping Method Dropdown and Set Default Shipping Method on Cart Page

yes please find attached image 

 

shipping_method.png

Re: Shipping Method Dropdown and Set Default Shipping Method on Cart Page

Hi @sanganagouda,

 

The template you're looking for is:

 

vendor/magento/module-checkout/view/frontend/web/template/cart/shipping-rates.html

Maybe you can override the file within your theme?

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Shipping Method Dropdown and Set Default Shipping Method on Cart Page

No its not working as required, after changing in shipping-reates.html code of 

<input
type="radio"
class="radio"
data-bind="click: $parents[1].selectVirtualMethod,
attr: {
value: carrier_code + '_' + method_code,
id: carrier_code + '_' + method_code,
name: 'estimate_method' + $parentContext.$index()
}
"/>

 

to 

<select
data-bind="
options: $parents[1].selectShippingMethod,
optionsText:attr: {for: 's_method_' + method_code},
value: $parents[1].selectedShippingMethod,
attr: {
value: carrier_code + '_' + method_code,
id: 's_method_' + method_code
}
">
</select>

but it showing dropdown for each method like 

Capture.PNG

so not able to set option values to select