Lynda Posted March 20 Posted March 20 Bonjour, Je souhaite modifier le texte du bouton "Add to cart" des fiches produit sur lesquelles le bandeau "On sale!" (promo) est activé. J'ai essayé le code suivant dans le fichier product-add-to-cart.tpl : <button class="btn btn-primary add-to-cart smooth05" data-button-action="add-to-cart" type="submit" {if !$product.add_to_cart_url}disabled{/if}> {if $flag.type == on-sale} {l s='Pre-order now' d='Shop.Theme.Actions'} {else} {l s='Add to cart' d='Shop.Theme.Actions'} {/if} </button> Résultat : le texte est bien modifié mais sur toutes les fiches produit ! Je ne comprends pas ce comportement. Une idée ? Merci pour votre aide. Share this post Link to post Share on other sites More sharing options...
idnovate.com Posted March 20 Posted March 20 Essayez avec : {if $flag.type == "on-sale"} (les guillemets " ") Share this post Link to post Share on other sites More sharing options...
Lynda Posted March 20 Posted March 20 (edited) Bonjour idnovate.com. Avec les guillemets, j'ai toujours "Add to cart" ; sans les guillemets, j'ai toujours "Pre-order now"... Edited March 20 by Lynda (see edit history) Share this post Link to post Share on other sites More sharing options...
Lynda Posted March 20 Posted March 20 J'ai trouvé, la syntaxe correcte est la suivante : {if $product->on_sale} 1 Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now