Fix multilingual support for product data and thank you redirect
All checks were successful
Deploy / Deploy to Production (push) Successful in 7s

- Add translate: false to price, hasOptions, and optionValues fields
- Make thank you page redirect language-aware (detects /fr/ prefix)
- Ensure stock, weight, dimensions, and options are shared between languages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2025-12-19 18:05:37 +01:00
parent 7359d43125
commit 57037fc435
2 changed files with 9 additions and 1 deletions

View file

@ -7,7 +7,12 @@ window.SnipcartSettings = {
// Redirection après paiement réussi
document.addEventListener('snipcart.ready', function() {
Snipcart.execute('bind', 'order.completed', function(order) {
window.location.href = '/thanks?order=' + order.token;
// Détecter la langue actuelle depuis l'URL
const currentPath = window.location.pathname;
const langMatch = currentPath.match(/^\/([a-z]{2})(\/|$)/);
const langPrefix = langMatch ? '/' + langMatch[1] : '';
window.location.href = langPrefix + '/thanks?order=' + order.token;
});
});

View file

@ -22,6 +22,7 @@ tabs:
min: 0
step: 0.01
required: true
translate: false
width: 1/4
stock:
label: Stock
@ -99,6 +100,7 @@ tabs:
fr: Options
type: toggle
default: false
translate: false
width: 1/7
optionLabel:
label:
@ -116,6 +118,7 @@ tabs:
help:
en: "Comma-separated values (e.g.: XS, S, M, L, XL)"
fr: "Valeurs séparées par des virgules (ex: XS, S, M, L, XL)"
translate: false
when:
hasOptions: true
width: 3/7