elgentos / LargeConfigProducts

Large Configurable Products workaround for Magento 2
91 stars 29 forks source link

Products with SwatchImages as variable attribute #31

Closed simonmaass closed 5 years ago

simonmaass commented 5 years ago

Product variations are not loading with products that have configurable attributes as color with swatch images.

No variations are loaded:

image

we are currently looking into the problem... any help welcome

peterjaap commented 5 years ago

This is the last change we did concerning that template; https://github.com/elgentos/LargeConfigProducts/commit/f8759c6d47966315d620e95e2d2a07c82f831f50

Maybe there's a hint? In our install where we use this extension it works as expected. Maybe you have an overriden theme file?

simonmaass commented 5 years ago

@peterjaap thnx - will update soon

mwr commented 5 years ago

I think I found the issue. It comes from the json defined in view/frontend/templates/product/view/renderer.phtml.

In the JSON created there, there needs to be a attribute with the name jsonSwatchImageSizeConfig containing the swatch image height and width so the frontend javascript can render / request the images in the correct size. The value for jsonSwatchImageSizeConfig is loaded using $block->getJsonSwatchSizeConfig() like in the Magento standard.

see pull-request https://github.com/elgentos/LargeConfigProducts/pull/32

simonmaass commented 5 years ago

@peterjaap please see pull-request

peterjaap commented 5 years ago

I merged the Pull Request but today we upgraded a clients version to include this PR and we found out that this change was breaking for Magento <2.3. So I did a small adjustment to have it return null when getJsonSwatchSizeConfig() returns null.

https://github.com/elgentos/LargeConfigProducts/commit/1d95b70f983d855303482c4a34c07c1acf1f4f5e