magento / community-features

Magento Features Development is an Initiative to Allows Community Memebers Join to Development of Magento Features
46 stars 18 forks source link

Configurable product: Freely choosing from selects #251

Open DanieliMi opened 4 years ago

DanieliMi commented 4 years ago

Description

When configuring a configurable product on the product page the customer has to work through the selects from top down. Given the following product: Configurable_Select The customer first has to select Size, then he's able to select Color and last the Material. The new feature should allow the customer to freely choose from the selects in any order.

Expected behavior

Given the example above: Color and Material are not disabled and can be selected. Upon select the other selects need to be updated to provide valid option combinations.

Benefits

It will be easier for customers to find the configurable they like. From the example above: If a customer wants a specific material he has to select Size and Color to start with before even knowing which materials are available. And if the color doesn't matter he has to go through all colors to see if the material is available. The feature prevents this example.

Additional information

This is already implemented for swatches. It seems inconsistent that swatches support this feature but selects don't.

Would a PR with such a feature approved?

amenk commented 4 years ago

Basically the feature can be forced by patching

vendor/magento/module-swatches/Block/Product/Renderer/Configurable.php::isProductHasSwatchAttribute()

See also

vendor/magento/module-swatches/Block/Product/Renderer/Configurable.php::getRendererTemplate()

But the big questions is, why two different templates are needed

DanieliMi commented 4 years ago

If there is no reason for two different templates we should reduce it to one to stay consistent.

amenk commented 3 years ago

It is possible to force the swatches template by overwriting

\Magento\Swatches\Block\Product\Renderer\Configurable::getRendererTemplate

 */
protected function getRendererTemplate()
{
    return self::SWATCH_RENDERER_TEMPLATE;

We think the reason that there are different templates is modularity between Magento_Swatches and normal configurable module. Still it would be nice to have the full functionality in the configurable module.

amenk commented 3 years ago

FOSS module in the making https://github.com/iMi-digital/magento2-module-always-swatch-selects