1

My store is built on a collection of configurable products. Some have many size options but only one colour. I have noticed people have been selecting the size and adding to cart and not realising they have to select the colour option (because there is only one)

My question is, is there any way to automatically select an attribute on the product page, for example... automatically select the first attribute of colour as people are finding it hard to make a purchase and not noticing it is a required field.

2
  • Tumbleweed......
    – Max Smith
    May 13 '16 at 10:37
  • 1
    To the best of my knowledge there is no core feature for doing it. The simplest approach may be to use JS on page load to check the value and if it isn't set select it. You'd need to check carefully that any change events are triggered though, depending how you set the value of a select in JS this doesn't always happen. Jun 27 '16 at 8:12
3

Copy js/configurableswatches/swatches-product.js

into your theme and change selectFirstOption to true on line 107,

or extend Product.ConfigurableSwatches._O.Product.selectFirstOption

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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