-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[SHOP][FEATURE] Introduce address form modifiers in checkout component #18410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… form value modifications
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
bc126d0 to
f35dda5
Compare
… update UPGRADE guide for 2.2 transition.
f35dda5 to
8d66168
Compare
src/Sylius/Bundle/ShopBundle/Twig/Component/Checkout/Address/FormComponent.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/Twig/Component/Checkout/Address/FormComponent.php
Outdated
Show resolved
Hide resolved
❌ Preview Environment deleted from BunnyshellAvailable commands:
|
| $newAddress['firstName'] = $address->getFirstName(); | ||
| $newAddress['lastName'] = $address->getLastName(); | ||
| $newAddress['phoneNumber'] = $address->getPhoneNumber(); | ||
| $newAddress['company'] = $address->getCompany(); | ||
| $newAddress['countryCode'] = $address->getCountryCode(); | ||
| if ($address->getProvinceCode() !== null) { | ||
| $newAddress['provinceCode'] = $address->getProvinceCode(); | ||
| } | ||
| if ($address->getProvinceName() !== null) { | ||
| $newAddress['provinceName'] = $address->getProvinceName(); | ||
| } | ||
| $newAddress['street'] = $address->getStreet(); | ||
| $newAddress['city'] = $address->getCity(); | ||
| $newAddress['postcode'] = $address->getPostcode(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed if the DefaultAddressFormValuesModifier is declared as a service.
src/Sylius/Bundle/ShopBundle/Modifier/DefaultAddressFormValuesModifier.php
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/Twig/Component/Checkout/Address/FormComponent.php
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/Twig/Component/Checkout/Address/FormComponent.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/Modifier/DefaultAddressFormValuesModifier.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/Modifier/AddressFormValuesModifierInterface.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/ShopBundle/Twig/Component/Checkout/Address/FormComponent.php
Outdated
Show resolved
Hide resolved
b38ac6c to
e9b11d3
Compare
…troduce `DefaultAddressFormValuesModifier`.
e9b11d3 to
5e78b96
Compare
This PR introduces a new mechanism for extending the checkout address
FormComponentvia tagged services implementingAddressFormValuesModifierInterface.This approach uses dependency injection and a tagged_iterator with the tag
sylius_shop.modifier.address_form_values. These modifiers allow plugins and applications to dynamically transform or enrich the address data.