Skip to content
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

Made swatches color-picker configurable #4229

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Sep 26, 2024

Description (*)

... as suggested in related pull request.

  • added new multi-select to config (see Catalog -> Configurable Swatches)
  • added install script to not change anything for current installations

Related Pull Requests

  1. See New feature: ConfigurableSwatches now allows for auto-generation of the swatch image file based on color selection #3686

@github-actions github-actions bot added Component: Eav Relates to Mage_Eav Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches translations Relates to app/locale labels Sep 26, 2024
@empiricompany
Copy link
Contributor

empiricompany commented Sep 26, 2024

this has already been discussed in the PR; if an attribute is configured as swatch there must not be another configuration to enable the color picker (as @ADDISON74 wanted).
simply, don't fill the colors and nothing happens on frontend

@sreichel
Copy link
Contributor Author

From my POV the current implementation is not complete. E.g. I dont need or want a color picker for "Size" attributes. That makes no sense to me.

Further ... with an additional configuration we could add a file-upload for selected swatchable attributes.

This would be pretty cool for me.

This PR does not change the current behavoir or breaks anything. It only allows a more precise configuration.

@sreichel sreichel marked this pull request as draft September 26, 2024 18:09
@sreichel sreichel marked this pull request as ready for review September 26, 2024 19:47
@empiricompany
Copy link
Contributor

For me it remains very cumbersome and not very intuitive but if we want it, must be explained well in the documentation that you need to configure the attribute as Swatch + configure it as a color picker to activate it.

+1 for implent image upload

@sreichel
Copy link
Contributor Author

sreichel commented Sep 26, 2024

must be explained well in the documentation

To avoid this the install script was added ... by default every swatchable attribute will show the color-picker. So nothing changes. You have to manually de-select the attributes to not show the color-picker.

Edit: o/c some emplaination should be added to docs.

@empiricompany
Copy link
Contributor

this PR add a new configuration to enable the color picker for specific attribute not to disable it, so attributes selected as Swatch not show the color picker by default. correct?

@sreichel
Copy link
Contributor Author

sreichel commented Sep 26, 2024

correct?

No. If you set another/new attribute to be "swatchable", you have to enable the color-picker too - if you want. For existing configuration it changes nothing. So "yes" - for new swatchable attributes, color-picker is turned off by default.

This install-script was added to keep the color-picker enabled for all swatch-attributes. You have to manually de-select them to disable the color picker. (thats why i said i does not change anything for existing installations)

@ADDISON74
Copy link
Contributor

I have to read again the comments I had on #3686 to understand the change, then I'll give you feedback. empiricompany's initial proposal was not bad, but being a complex change in the code, there were no fresh forces to carry things through to the end. Anyway the effort made is appreciated.

@sreichel
Copy link
Contributor Author

For sample data config looks like this:

confsw

@empiricompany
Copy link
Contributor

please check this behavior:
If there is no attribute selected as swatch, color picker option is empty.
I have to save the attribute as swatch then re-save for enable colorpicker

@sreichel
Copy link
Contributor Author

Thanks. I know save config twice is not ideally. I have an idea how to fix it, but I am not sure if it worth to spent time on it - as it probably not often changes.

Add JS ...

  • to add/remove options in second selection when de/select a swatch attribute.

@ADDISON74
Copy link
Contributor

ADDISON74 commented Sep 28, 2024

This PR works and thank you for reading my comments in the PR #3686. There I tried to convince the participants without success.

Indeed, two simultaneous saves are required to set the configuration of an attribute.

However, I consider that the OpenMage implementation proposed in #3686 should have been inspired by Magento 2, but for that I will propose a separate discussion here #4231.

@empiricompany
Copy link
Contributor

empiricompany commented Sep 28, 2024

in my opinion two separate saves is not intuitive, for this reason I remain of the idea that a new configuration is not needed but that simply, in the case of an attribute that does not use colors like size, you don't pick any color and upload the individual images as default.

@sreichel
Copy link
Contributor Author

@empiricompany if we want to add a file-upload option, we have to select which attribute uses color-picker or upload.

I'd like to have it in ... maybe you have an idea for some javascript?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches Component: Eav Relates to Mage_Eav phpstan translations Relates to app/locale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants