How do I add a single tag containing commas to a product?

Highlighted
Shopify Partner
61 0 13

I have a product with three tags:

["Aardappel, groente, fruit", "Aardappelen", "Hele aardappel"]

My question is how do I add those 3 tags to a product using the API without it being sliced up into 5 tags because the first one contains commas?

I've tried:

new_product = ShopifyAPI::Product.new
new_product.title = "Burton Custom Freestlye 151"
new_product.product_type = "Snowboard"
new_product.vendor = "Burton"
new_product_tags = "'Aardappel, groente, fruit', Aardappelen, Hele aardappel"
new_product.save

But it doesn't work.

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
79 0 7

Hello, this is expected behaviour as our tagging system uses commas to split apart those values. 

Adam Doeler, API Team, Developer at Shopify
0 Likes
Highlighted
Shopify Partner
61 0 13

Hi Adam,

I know, but my question is how do I make sure it adds "
Aardappel, groente, fruit" as one tag? 

Or do I need to change it to something like "Aardappel - groente - fruit"?

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
79 0 7

Hi Narek, you would need to change it. Dashes are a good alternative, as are colons.

Adam Doeler, API Team, Developer at Shopify
0 Likes
Highlighted
Shopify Partner
61 0 13

Thanks Adam.

0 Likes
Highlighted
Shopify Expert
36 0 10

For some reason it looks like "Adam"'s responses have disappeared. Narzero, I'm attempting to do the same thing with the API. Did you happen to have any luck? 

0 Likes
Highlighted
Shopify Partner
61 0 13

Adam pointed out that you'll have to replace all "," with some other character. I simply use "-".

["Aardappel - groente - fruit", "Aardappelen", "Hele aardappel"]

 

0 Likes
Highlighted
Shopify Expert
36 0 10

I apologize for the slow response, I must not have enabled notifications on this thread. Thanks a bunch for the response though @narzero, this is what I eventually ended up doing. I'm glad to know I wasn't overlooking something. 

Cheers!

0 Likes
Highlighted
Shopify Partner
1 0 0

You can use the HTML code for a comma instead, so:

 

Thing , Another , One more thing

 

That should work well!

0 Likes