Open tramov opened 4 years ago
to get it to work with OneStepCheckout you would need to:
add a field-set component experius_postcode_fieldset to Stores > Configuration > Sales > OneStepCheckout > Shipping address fields and settings and drag before street field
open up https://github.com/experius/Magento-2-Module-Experius-Postcode-NL/blob/48f4487a6f22d5bd7a107c3f8731da10a37b3bc2/Block/Checkout/LayoutProcessor.php#L168 and in method getPostcodeFields comment out all the sortOrder nodes in their uiComponents inside a fieldset
//'sortOrder' => (string)($this->getStartSortOrder() + 50),
to get it to work with OneStepCheckout you would need to:
- add a field-set component experius_postcode_fieldset to Stores > Configuration > Sales > OneStepCheckout > Shipping address fields and settings and drag before street field
- open up https://github.com/experius/Magento-2-Module-Experius-Postcode-NL/blob/48f4487a6f22d5bd7a107c3f8731da10a37b3bc2/Block/Checkout/LayoutProcessor.php#L168 and in method getPostcodeFields comment out all the sortOrder nodes in their uiComponents inside a fieldset
//'sortOrder' => (string)($this->getStartSortOrder() + 50),
This is how we implemented this postcode check in OSC. Still i'm facing an issue.
Usually, when navigating to the checkout while the customer is logged in, the user can select an address form his addressbook. The default address is always preselected. But somehow when using this postcode check, the default address gets deselected while loading the checkout. The user tries to order and gets an error about "no address selected" and gets confused, thinking "what you mean.. there is an address right?" (especially when there is only 1 address shown)... and leaving the checkout potentially.
In Luma the module works fine, but in OSC i am facing this problem. Any ideas how to fix it?
How the checkout is loaded.
How it is suppose to be loaded. With default address selected. This makes it clear that the user can choose an address from the list.
Below are the changes / hacks I needed to make to make the plugin work with the onestepcheckout.com module:
Add a custom field at position #6 in the OneStepCheckout configuration:
Modify Block/Checkout/LayoutProcessor.php to add the fields at sortOrder position #6:
Small change to the CSS, remove the following from Experius/Postcode/view/frontend/web/css/source/module/_checkout-fields.less
Result: