Fix button text update when selecting product option
All checks were successful
Deploy / Deploy to Production (push) Successful in 7s
All checks were successful
Deploy / Deploy to Production (push) Successful in 7s
- Update button text from "Choisissez une option" to "Ajouter au panier" when option is selected - Add data-default-text attribute to preserve translated text - Improve UX by providing clear feedback when option is selected 🤖 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
1aa64a7396
commit
7359d43125
2 changed files with 7 additions and 1 deletions
|
|
@ -45,6 +45,12 @@
|
|||
// Activer le bouton
|
||||
addToCartButton.removeAttribute('disabled');
|
||||
|
||||
// Changer le texte du bouton
|
||||
const buttonText = addToCartButton.querySelector('.txt');
|
||||
if (buttonText) {
|
||||
buttonText.textContent = buttonText.getAttribute('data-default-text') || 'Ajouter au panier';
|
||||
}
|
||||
|
||||
// Gérer la classe is-selected sur les li parents
|
||||
allLi.forEach(li => li.classList.remove('is-selected'));
|
||||
this.closest('li').classList.add('is-selected');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue