cpinar Posted June 23, 2019 Share Posted June 23, 2019 Buenas, Actualmente, en el listado de productos, cuando un producto está agotado desaparece el botón de comprar, dejando el espacio en blanco. Necesito mostrar un botón donde aparezca el texto "PRODUCTO AGOTADO". El usuario no va a poder comprar pero quiero que siga apareciendo el producto en el listado. Estoy dando mil vueltas pero no se en que tpl tocar para hacerlo. Gracias a todos de antemano Link to comment Share on other sites More sharing options...
[email protected] Posted June 27, 2019 Share Posted June 27, 2019 Buenas, a ver si resuelves con esto: Ve a la carpeta: /themes/NOMBRE DEL TEMA ACTIVO/templates/catalog/_partials/miniatures/ Busca el archivo: product.tpl En mi caso donde estaba esto: {block name='product_price_and_shipping'} {if $product.show_price} <div class="product-price-and-shipping"> {if $product.has_discount} {hook h='displayProductPriceBlock' product=$product type="old_price"} <span class="sr-only">{l s='Regular price' d='Shop.Theme.Catalog'}</span> <span class="regular-price">{$product.regular_price}</span> {if $product.discount_type === 'percentage'} <span class="discount-percentage discount-product">{$product.discount_percentage}</span> {elseif $product.discount_type === 'amount'} <span class="discount-amount discount-product">{$product.discount_amount_to_display}</span> {/if} {/if} {hook h='displayProductPriceBlock' product=$product type="before_price"} <span class="sr-only">{l s='Price' d='Shop.Theme.Catalog'}</span> <span itemprop="price" class="price">{$product.price}</span> {hook h='displayProductPriceBlock' product=$product type='unit_price'} {hook h='displayProductPriceBlock' product=$product type='weight'} </div> {/if} {/block} Agrege en la línea 78: {block name='product_price_and_shipping'} {if $product.show_price} <div class="product-price-and-shipping"> {if $product.has_discount} {hook h='displayProductPriceBlock' product=$product type="old_price"} <span class="sr-only">{l s='Regular price' d='Shop.Theme.Catalog'}</span> <span class="regular-price">{$product.regular_price}</span> {if $product.discount_type === 'percentage'} <span class="discount-percentage discount-product">{$product.discount_percentage}</span> {elseif $product.discount_type === 'amount'} <span class="discount-amount discount-product">{$product.discount_amount_to_display}</span> {/if} {/if} {hook h='displayProductPriceBlock' product=$product type="before_price"} <span class="sr-only">{l s='Price' d='Shop.Theme.Catalog'}</span> <span itemprop="price" class="price">{$product.price}</span> {hook h='displayProductPriceBlock' product=$product type='unit_price'} {hook h='displayProductPriceBlock' product=$product type='weight'} <div>{$product.availability_message}</div> <!-- <---------------------------------------AQUI ------------ --> </div> {/if} {/block} Y con eso sale el mensaje que le has puesto al producto en caso de que no tenga stock, lo tenga, lo que sea. Bueno aquí ya puedes jugar tu con los mensajes, si quieres que salgan o no, etc.... Espero que te sea de ayuda. Un saludo. Link to comment Share on other sites More sharing options...
cpinar Posted June 28, 2019 Author Share Posted June 28, 2019 Muchas gracias por tu respuesta. Lo solucioné al final investigando. Ya hacía tiempo que no tocaba Prestashop y me daba mas miedo que verguenza tocar. Al final monté un condicional de stock para mostrar la etiqueta si no había y funcionó perfecto. Un saludo 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