Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoselecting configurable product options does not work with the swatches module enabled #2746

Closed
tzyganu opened this issue Dec 17, 2015 · 4 comments
Labels
bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@tzyganu
Copy link
Contributor

tzyganu commented Dec 17, 2015

Preconditions:

  • magento v2.0.0 installed
  • catalog module version:
    • 2.0.3 in module.xml
    • 100.0.2 in composer.json
  • configurable products module version:
    • 2.0.0 in module.xml
    • 100.0.2 in composer.json
  • swatches module version:
    • 2.0.0 in module.xml
    • 100.0.2 in composer.json
  • full sample data installed (this is not mandatory)

Steps to reproduce

  • visit a configurable product page with a hash to autoselect the options: product.phtml#{attribute_id}={option_id}.
  • example in sample data: orion-two-tone-fitted-jacket.html#90=49. This should select the color black automatically

Expected result

  • the color swatch black should be selected

Actual result

  • nothing is selected

Additional information

  • Disabling the Magento_Swatches module makes the page behave as expected:
@tanya-soroka
Copy link

Hello @tzyganu , thanks for reporting this issue. Internal ticket has been created: MAGETWO-47023.

@vkholoshenko vkholoshenko added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Dec 22, 2015
@tigerx7
Copy link

tigerx7 commented Jan 16, 2016

I dug into SwatchRenderer.js and from the looks of it, this isn't a bug. Magento2 just handles the autoselecting differently.

In M1, it used the # parameter, which in itself was odd, but in M2, it's actually looking for a query. Also, the attribute id expectation has been changed to an attribute code.

So what normally might have looked like:
orion-two-tone-fitted-jacket.html#90=49

should now look like:
orion-two-tone-fitted-jacket.html?color=49

I've been able to successfully autoselect on configurable products with swatches using ?{attribute_code}={option_id}

@tzyganu
Copy link
Contributor Author

tzyganu commented Jan 19, 2016

@tigerx7 But it still works as I expect it to work when I disable the swatch module. If this is not a bug it's at least an inconsistency.

magento-team pushed a commit that referenced this issue Jan 20, 2016
…es not work with the swatches module enabled #2746
magento-team pushed a commit that referenced this issue Jan 20, 2016
…es not work with the swatches module enabled #2746

- fix js static
@mslabko
Copy link
Member

mslabko commented Jan 20, 2016

@tzyganu, Issue has been fixed in commit 0416e64
Thank you for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

6 participants