akeneo / magento2-connector-community

Akeneo Connector for Magento 2
Open Software License 3.0
81 stars 88 forks source link

Image Attributes aren't synced correctly #623

Open Rocheauxfees opened 1 year ago

Rocheauxfees commented 1 year ago

Hi there,

currently we are faced by some problems to synchronise some images from Akeneo to Magento by using the configuration at the "Product Images Mapping" section in the configuration page by the connector. We are using Magento 2 in the version 2.4.2-p1 (enterprise) as a multi-store-view-instance, the Akeneo Connector in Version 100.4.5 and Akeneo PIM in Version 3.2.34. Unfortunatley we aren't able to update neither magento nor the connector nor Akeneo PIM.

image

By using these settings we get the result to have images sychronised to the parent but not set as base, thumbnail, small-image or cta_image for the all stores view. Also the synchronised images are all hidden. The mentioned image attribute image_grid by Akeneo is global.

image

If we change to a store view (e.g. the Japanese one) these images are all visible and set as base and thumbnail but not as small-image or cta_image.

image

Do you have any advice where to search for a mis-configuration? Do we have to set something in the configurable section of the configuration page by the connector?

Many thanks for your help in advance.

Best

REFUZIION commented 1 year ago

Currently experiencing the same issue. We select image_1 to have all the attributes however the highest image gets all attributes assigned. This is probably an issue within the connector..

rabillion commented 1 year ago

We facing the same issue. Is there a fix for this?

roxanadicomaria commented 1 year ago

Hi, We had the same issue and while debugging this. we found a possible problem around this part:
vendor/akeneo/module-magento2-connector-community/Job/Product.php We applied a patch to fix the wrong column name without a suffix, which had a - after it, and also we made a check to only set image roles when the $columnName is the same as $image:

`diff --git a/app/code/Product.php b/app/code/Product.php index 0c9f023b..b0f218b5 100644 --- a/app/code/Product.php +++ b/app/code/Product.php @@ -3944,7 +3944,10 @@ class Product extends JobImport

                     foreach ($columns as $column) {
                         /** @var string $columnName */
itlinlab commented 1 year ago

We had the same problem as reported by @REFUZIION and @rabillion. Applied a Rewrite of the importMedia function with the patched changes provided by @roxanadicomaria and it now works as expected for us.

Thanks guys.

Using Akeneo_Connector 103.3.1 and Magento Community 2.4.5.