-
Notifications
You must be signed in to change notification settings - Fork 102
539 add apply to property #540
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
539 add apply to property #540
Conversation
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.
Hi @ProkopovVitaliy, thank you for the provided changes. But I guess providing a multiple select with available product types, would be much more user friendly. Additionally, we'll avoid entering some typos within that field.
Please let me know your thoughts.
Thank you.
Hi @eduard13 Yes you are right, this is more user friendly. But if developer have custom product type in their store, for example
What about your opinion ? |
@ProkopovVitaliy @eduard13 Magento provides product_types.xml file that describes the product types. Is it possible to implement support for this file for the apply_to option? When typing manually, there is a chance of making a typo. There may also be third-party product types. If there was multiselect option, it would be very convenient. Thanks! https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Downloadable/etc/product_types.xml#L9 |
@ProkopovVitaliy |
@eduard13 I finalized this functionality. Could you please review it? Main points:
Overview:
Open window for generation and try generate attribute for new created product type: |
mappedAttributes.put(EavAttribute.APPLY_TO.getAttribute(), | ||
wrapStringValueForTemplate(eavEntityData.getApplyTo())); |
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.
@ProkopovVitaliy, just want to bring your attention, that breaking a multiple arguments to a new line, should move all the arguments to a new empty line, like following.
mappedAttributes.put(EavAttribute.APPLY_TO.getAttribute(), | |
wrapStringValueForTemplate(eavEntityData.getApplyTo())); | |
mappedAttributes.put( | |
EavAttribute.APPLY_TO.getAttribute(), | |
wrapStringValueForTemplate(eavEntityData.getApplyTo()) | |
); |
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.
@eduard13 Thanks for recommendation, really it's looks better in your variant. I will take this into account.
Thanks!
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.
No action is needed here, just wanted to add a remark, it also applies to PHP code.
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.
Thank you for the feature 👍.
Description (*)
Added possibility set
apply_to
property for product eav attribute.There are two variants how to use this property in data patch generation:
If
Apply to all products types
selected no specific product type will be specified for the attribute.Unselect

Apply to all products types
, and it will be possible to specify product types:After that will be generated data patch with specified product types:
Fixed Issues (if relevant)
Questions or comments
Contribution checklist (*)