I'm trying to get url with already selected options.

If I have only one options, code is working fine adding #{attribute_id}={attribute_value} after url.


This code is not working when I have more than one option.


Any idea how can I make this work?

  • Curious to see... might need a javascript solution for this.
    – Joshua34
    Commented Feb 21, 2017 at 21:45
  • have you get any solution for this issue?
    – Indian
    Commented May 3, 2019 at 10:42

1 Answer 1


You can try the code like this.


In your URL, need to replace # with ?.

  • is that working for you, when you access this url the options are selected? for me it's not. Commented Feb 22, 2017 at 13:51
  • If you are talking about the auto select in drodown that show on that page, then you need to some code to make it working, because that is custom option of product. Commented Feb 23, 2017 at 6:22
  • It's not custom option. There are options based on attributes. If you check the first url, you'll see it's working when I have only one option. But it's not working when I have two or more. Commented Feb 25, 2017 at 2:29
  • you need to do custom code to auto select from URL value when attribute is render. Commented Feb 25, 2017 at 3:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.