akeneo / magento2-connector-community

Akeneo Connector for Magento 2
Open Software License 3.0
80 stars 87 forks source link

Not possible to use Visual Swatch attributes #691

Open simonrl opened 1 month ago

simonrl commented 1 month ago

Environment and configuration

  1. Magento 2 Open Source 2.4.6-p3
  2. Akeneo CE 7.0.13
  3. Connector 104.3.7

Steps to reproduce

  1. have "Simple Select" attribute in Akeneo
  2. configure it as "Visual Swatch" in the Akeneo-Connector-Configuration
  3. import everything
  4. add colors / images to swatch options in Magento
  5. import "option"

Expected result

  1. The swatch colors/images should stay intact

Actual result

  1. The colors/images are removed

Additional info

We also tried to remove the attribute again from the Akeneo-Connector-Configuration's attribute type mapping, which results in: "option"-import works fine, but "attribute" import changes the attribute type in Magento from "Visual Swatch" to "Drop Down". After this is changed manually, the swatch colors/images are still there.

The comment for the Job/Option::insertSwatchOption() reads

Insert Swatch options Values for swatch attributes (visual swatch have no data on V1)

...so how are we supposed to handle Visual Swatches, if no configuration seems to work?

akosglue commented 1 month ago

I could reproduce this issue with CE 7.0.66 magento 2.4.7 connector 104.3.7 Annoying because you select all the colors for each swatch and in 1 second your work is gone.

edit: after a closer look, this line and the next should be properly changed: https://github.com/akeneo/magento2-connector-community/blob/1815946099086a8340b9bc001c47c804ee9ce1c1/Job/Option.php#L560 so that other types are checked as well like SWATCH_TYPE_VISUAL_ATTRIBUTE_FRONTEND_INPUT and the correspondent type is inserted like SWATCH_TYPE_VISUAL_COLOR or SWATCH_TYPE_VISUAL_IMAGE, etc.

akosglue commented 3 weeks ago

@simonrl you may try the aforementioned PR that fixes the color/images issue. Tested with m2 2.4.7, php 8.3, akeneo 7.0.66 with sample data, connector 104.3.7