magyck Posted August 11, 2019 Share Posted August 11, 2019 (edited) Hola familia! Por si os sirve de ayuda, prestashop 1.7, por defecto, no lleva botón añadir al carrito , os propongo una manera de insertar un botón de 'Añadir' a la vez que mostrará 'Agotado' cuado el stock sea 0 Mi solución para 1.7 a mi manera es la siguiente: <form action="{$urls.pages.cart}" method="post" id="add-to-cart-or-refresh"> <input type="hidden" name="token" value="{$static_token}"> <input type="hidden" name="id_product" value="{$product.id}" id="product_page_product_id"> <input type="hidden" name="id_customization" value="{$product.id_customization}" id="product_customization_id"> {if $product.quantity < 1 } <button class="btn btn-danger add-to-cart" data-button-action="add-to-cart" type="submit" disabled> <i class="material-icons">error_outline</i> {l s='Agotado' d='Shop.Theme.Actions'} </button> {else} <button class="btn btn-primary add-to-cart" data-button-action="add-to-cart" type="submit"> <i class="material-icons shopping-cart"></i> {l s='Añadir' d='Shop.Theme.Actions'} </button> {/if} </button> </form> De esta manera obtendremos el resultado que esperaba, muestra 'Añadir' en el caso de que haya stock y 'Agotado' en el caso de que no quede stock. Espero que os sirva de ayuda. Podéis ver el resultado en http://www.mundoraspberry.com Edited August 14, 2019 by magyck (see edit history) Link to comment 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