Dynamic data-attributes possible?

I want to create my own dropdowns for product options that are then dynamically added to the data-attributes of the buy button. Is that possible? I am selling make-up and need to have clickable color swatches that are linked to the respective color name that you also can access via a dropdown. Thus I need to create that functionality on my own. Hope, it is somehow clear what I want. :slight_smile:

Hi @moritzlaube,

This can be achieved by using the data-item-custom{x}-value attribute. You’ll find more details about this here.

Essentially, you’ll want to listen to the “onchange” event of your dropdown to update the data-item-custom{x}-value attribute of your product dynamically.

Let me know if that helps,

Cheers!