OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
865 stars 436 forks source link

configurableswatches directory is missing from base #3012

Open ADDISON74 opened 1 year ago

ADDISON74 commented 1 year ago

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.

dbachmann commented 1 year ago

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

fballiano commented 1 year ago

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

ADDISON74 commented 1 year ago

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 commented 1 year ago

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.