Fix multilingual support for product data and thank you redirect
All checks were successful
Deploy / Deploy to Production (push) Successful in 7s
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:
parent
7359d43125
commit
57037fc435
2 changed files with 9 additions and 1 deletions
|
|
@ -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;
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue