danslo / CleanCheckout

A drop-in replacement for the Magento 2 checkout.
MIT License
268 stars 63 forks source link

Default Shipping Method #28

Closed mageuser closed 6 years ago

mageuser commented 6 years ago

Hello, Daniel. I want put my own module as a default shipping method, but it does not appear in the list to select.

My module is working on checkout page (its a bit bugged because my fault).

mageuser commented 6 years ago

@danslo I know it's not part of your module, but could you take a look at what I'm doing wrong when calling api and displaying the results? Already tried help in other places but without success :(

https://magento.stackexchange.com/questions/212448/forced-multiple-select-shipping-method?noredirect=1#comment295745_212448

danslo commented 6 years ago

That list is generated not by Clean Checkout, but by a core Magento source model. So that would be your first place to debug.

This magento2 issue indicates that it may be necessary to set a 'value' XML node for your shipping method to show up in this list. edit: Nevermind, that was talking about payment methods.

In any case, if you don't want to debug Magento 2 internals, you can set clean_checkout/general/default_shipping_method in core_config_data manually. I'm not convinced this is an issue with Clean Checkout itself.

danslo commented 6 years ago

As for why they all seems to be selected (rather than individually), it's probably because they all have the same method code.

Quite sure you're problems will go away once you start giving your methods a unique value in $method->setMethod(). Out of scope for this module though, so closing this issue.

mageuser commented 6 years ago

Thanks, I could solve both problems!