How can I include commas in product attribute text?

Solved

How can I include commas in product attribute text?

drock111
Shopify Partner
14 0 15

I have a product variant that I would like to set the size attribute to:

 

Size: "EFC-1 (Fits F-1, HTM-1, G-4 Fenders)"

 

but when I try to add this to the product options it breaks it up on the commas and tries to add several attributes. Is the comma character a special character not allowed in product options text? Is there a way or a trick to include commas?

Accepted Solution (1)

made4Uo
Shopify Partner
3873 718 1214

This is an accepted solution.

Hi @drock111

 

Yes, since the code detects that this is another options. If you really need comma on this. You cant write the options as follow. Replace the comma with "/"

EFC-1 (Fits F-1/ HTM-1/ G-4 Fenders)

 

Depending on your theme, you have to change the value of the variant like below. 

NOTE: You need to change the section product, the cart and the notification. 

{{ value | replace: "/", "," }}

 

This is the Shopify 2.0 FREE themes main-product.liquid

made4Uo_0-1658364530783.png

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free

View solution in original post

Replies 3 (3)

made4Uo
Shopify Partner
3873 718 1214

This is an accepted solution.

Hi @drock111

 

Yes, since the code detects that this is another options. If you really need comma on this. You cant write the options as follow. Replace the comma with "/"

EFC-1 (Fits F-1/ HTM-1/ G-4 Fenders)

 

Depending on your theme, you have to change the value of the variant like below. 

NOTE: You need to change the section product, the cart and the notification. 

{{ value | replace: "/", "," }}

 

This is the Shopify 2.0 FREE themes main-product.liquid

made4Uo_0-1658364530783.png

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free
bham123
Tourist
4 0 1

Hello, is there any update on this please? Shopify won't let me add this code anywhere (Theme - Impulse)

made4Uo
Shopify Partner
3873 718 1214

You need to open another question. The code does not apply to impact theme 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free