Add to cart not working only on spanish translation

Hello I have store with 5 languages.

Everything works when switching location and language. But when i switch to spanish language add to cart button gets faded. If i switch to any other language add to cart is enabled.

What might be the problem?

What theme you’re using?

It is possible that some symbols in Spanish translation are not escaped by the theme properly and this breaks some HTML elements/JS code…

Would be much easier if you can share a link to your store (preview link if not published yet)

Hey Tim thanks for reply.

Hers us link to the store.

Yes, this is what happens – see HTML output and product data for different languages:

English:


"options": [{
  "name": "options",
  "position": 1,
  "values": ["Brandnew"]
}],

German:


"options": [{
  "name": "Optionen",
  "position": 1,
  "values": ["Brandneu"]
}]

Spanish:


"options": [{
  "name": "",
  "position": 1,
  "values": [""]
}]

See how value of input matches the one from product data for English and German, but not for Spanish?

I guess theme code strips HTML formatting from input values.

Because of this mismatch theme code can’t find currently selected variant and disables the cart button.

You should ensure that translation of product properties does not include HTML tags, like the Spanish one have (except for product description, of course) – check what’s configured in translation app.

1 Like

Thanks a milion that was the issue.

1 Like