adobe / commerce-cif-connector

AEM Commerce connector for Magento and GraphQL
Apache License 2.0
43 stars 27 forks source link

Multiple Product Bindings, pointing to same Magento don't load products correctly #88

Closed geertsmichael closed 4 years ago

geertsmichael commented 4 years ago

Expected Behaviour

When having multiple Product Bindings (1 per StoreView), using the same project (so same Magento) and caching is enabled, each Product Binding should load the correct catalog.

Actual Behaviour

When having multiple Product Bindings (1 per StoreView), using the same project (so same Magento), caching is enabled (to 5 minutes & 1000 items), the categories load correctly and show the category translations for that StoreView.

Schermafbeelding 2020-01-24 om 07 19 50

But the products loaded for each category are the products of the first StoreView that I selected. When clicking the next Product Binding, I am seeing the same products, knowing other products should be visible. After cache expiration, the first Product Binding I select and showed the products for, these will be the products that are used for the other Product Bindings.

Schermafbeelding 2020-01-24 om 07 26 57

(I first opened the French Product Binding, all French products for all Store Views)

Schermafbeelding 2020-01-24 om 07 30 04

(This time I opened the US Product Binding, all products for US are shows for all Store Views)

In Magento 1 have 3 StoreViews, on a global level I created 2 categories and on a global level I added products for 3 StoreViews. In Magento, when switching to the specific StoreViews, I could see which products would be loaded per StoreView, but not all should be visible on all Store Views. I have SKUs that are only applicable to some locales/StoreViews.

Steps to Reproduce

  1. http://localhost:4502/libs/commerce/gui/content/products.html/var/commerce/products/
  2. Make sure you have 2 or 3 Product Bindings, all pointing to the same Magento OSGI config, but each loading a different StoreView
  3. In Magento, populate the categories with products, knowing different products will be visible on different StoreViews. Also translate the categories per StoreView
  4. Make sure cache is enabled on the OSGI config
  5. Now navigate through the categories until you see products
  6. Go to another Product Binding (for another StoreView for the same Magento), you will see the category names are translated, but the products of the first selected Product Binding are used.

Platform and Version

AEM 6.4.5 CIF Connector 0.7.1 Magento 2.3.1 (Could this be related to this version of Magento? Planning to upgrade soon)

cjelger commented 4 years ago

Thanks for reporting this issue. This is indeed a bug, that part of the connector was developed before we added support for multiple stores and the cache only considers product skus. I created the internal issue CIF-1206 to fix this.