I'm creating a product page for a product with multiple variants. In this case the variant represents a different size (with unique SKU, stock, etc..).
It's laid out like so (don't mind the ugly styling):
I don't want to pre-select a size option because I want to avoid people adding the wrong product to their cart.
In the template there's a hidden field with the
purchasableId of the variant. The value attribute starts empty and when people click one of the options it is set to the corresponding id.
<input type="hidden" name="purchasableId" value="">
However, when people click 'Add to cart' right away, without selecting a size the following Craft\Exception is shown:
Not a purchasable ID
How can I customize this error message to notify the customer that they have to select a size option?