magento-lts icon indicating copy to clipboard operation
magento-lts copied to clipboard

configurableswatches directory is missing from base

Open addison74 opened this issue 2 years ago • 4 comments

The color swatch feature only works with the RWD theme. It cannot be used with other custom themes unless files are added manually to the base directory so that they can be found by Magento fallback. The issue is solved by copying the specific directories from the rwd directory into base. I would choose to move this directory.

To test this issue visit a configurable product in the default RWD theme, then change the package in Backend to default. The color swatches block has been replaced with options as in the case of simple products.

addison74 avatar Feb 04 '23 09:02 addison74

I've noticed this bug too and I can confirm copying the template . files from rwd/configurableswatches to base/configurableswatches will solve this issue.

dbachmann avatar Aug 08 '23 11:08 dbachmann

configurableswatches javascripts are written for jquery and the base theme doesn't have jquery so... if we move js/templates from the rwd theme to base it won't work.

all of the configurableswatches js should be rewritten to vanilla javascript and we already know how hard that will me.

or we should add jquery to the base...

unless we do one of those two options we can't move the templates to the base package

fballiano avatar Aug 09 '23 18:08 fballiano

In my case it worked because the custom theme used loads jQuery. Personal opinion, we should not complicate things and add jQuery to the base theme if the respective module is enabled.

addison74 avatar Aug 09 '23 18:08 addison74

Analyzing this issue better, see how I would proceed. I would copy all template files related to configurableswatches in base. In the Backend, in the "Configurable Swatches" section, next below the activation selector, I would put a warning.

configurable

If you use a theme other than RWD, add the jQuery link to the template file named ... by yourself. In addition to the warning, we also make an explanatory paragraph in the Readme.

It is an elegant solution because many custom themes that use files from /base directory already use jQuery (it is my case). There is practically no need to add the library.

addison74 avatar Aug 09 '23 21:08 addison74