Postel nicolas Posted March 16, 2021 Share Posted March 16, 2021 Bonjour je ne suis pas développeur, j'essaye juste de me débrouillé avec les moyens du bord "merci google" mais la je planche depuis quelques temps sur un soucis que je n'arrive pas à résoudre, je pense que ce n'est pas grand chose mais rien y fait je ne trouve pas. J'ai adapté mon thème pour afficher le champ "Si rupture de stock (et précommande autorisée)" dans les catégories dans les miniatures; sur la page d'accueil, nouveaux produit, meilleur ventes .... cela fonctionne bien mais dans les pages des catégories cela m'affiche "rupture de stock" Voici le code utilisé dans templates\catalog\_partials\miniatures\product.tpl {block name='product_availability'} <span id="product-availability"> {if $product.show_availability && $product.availability_message} {if $product.availability == 'available'} <i class="material-icons rtl-no-flip product-available"></i> {elseif $product.availability == 'last_remaining_items'} <i class="material-icons product-last-items"></i> {else} <i class="material-icons product-unavailable"></i> {/if} {$product.availability_message} {/if} </span> {/block} Je vous joints 2 photos JE suis sous presta 1.7.7.1 Link to comment Share on other sites More sharing options...
Postel nicolas Posted March 21, 2021 Author Share Posted March 21, 2021 Bonjour, personne aurait une idée ou je peut chercher ? Merci d'avance Link to comment Share on other sites More sharing options...
Remy FRK Corp Posted March 25, 2021 Share Posted March 25, 2021 (edited) Bonjour. Je viens d’essayer de mon coté avec ce bout de code qui semble venir du fichier product-add-to-cart.tpl Et visiblement ca marche pour les page catégorie aussi... Edited March 25, 2021 by Remy FRK Corp (see edit history) Link to comment Share on other sites More sharing options...
Remy FRK Corp Posted March 25, 2021 Share Posted March 25, 2021 votre bout de code: {block name='product_availability'} <span id="product-availability"> {if $product.show_availability && $product.availability_message} {if $product.availability == 'available'} <i class="material-icons rtl-no-flip product-available"></i> {elseif $product.availability == 'last_remaining_items'} <i class="material-icons product-last-items"></i> {else} <i class="material-icons product-unavailable"></i> {/if} {$product.availability_message} {/if} </span> {/block} correspond à ca en BO : Link to comment Share on other sites More sharing options...
Remy FRK Corp Posted March 25, 2021 Share Posted March 25, 2021 Sinon vous avez ça aussi : {if $product.additional_delivery_times == 1} {if $product.delivery_information} <span class="delivery-information">{$product.delivery_information}</span> {/if} {elseif $product.additional_delivery_times == 2} {if $product.quantity > 0} <span class="delivery-information">{$product.delivery_in_stock}</span> {* Out of stock message should not be displayed if customer can't order the product. *} {elseif $product.quantity <= 0 && $product.add_to_cart_url} <span class="delivery-information">{$product.delivery_out_stock}</span> {/if} {/if} Qui correspond àa ça dans le BO : Link to comment Share on other sites More sharing options...
Remy FRK Corp Posted March 25, 2021 Share Posted March 25, 2021 Et ca c'est étrange non ? : Link to comment Share on other sites More sharing options...
Remy FRK Corp Posted March 25, 2021 Share Posted March 25, 2021 (edited) après moi j'ai fais ça depuis le theme natif sur une installation toute fraiche de PS Vous visiblement vous avez un theme qui semble ne pas être celui par défaut, ou un module qui modifie les miniature produit... est-ce de la que vient votre soucis ? OU Avez vous raté une marche en modifiant un fichier ? Edited March 25, 2021 by Remy FRK Corp (see edit history) Link to comment Share on other sites More sharing options...
Postel nicolas Posted March 26, 2021 Author Share Posted March 26, 2021 (edited) Bonjour et merci pour votre reponse et le temps passé à regarder Remy. 10 hours ago, Remy FRK Corp said: votre bout de code: {block name='product_availability'} <span id="product-availability"> {if $product.show_availability && $product.availability_message} {if $product.availability == 'available'} <i class="material-icons rtl-no-flip product-available"></i> {elseif $product.availability == 'last_remaining_items'} <i class="material-icons product-last-items"></i> {else} <i class="material-icons product-unavailable"></i> {/if} {$product.availability_message} {/if} </span> {/block} correspond à ca en BO : oui cela correspond dans les fiches produits à ceci Pour cette réponse : ci dessous ce n'est pas ce que je recherche 9 hours ago, Remy FRK Corp said: après moi j'ai fais ça depuis le theme natif sur une installation toute fraiche de PS Vous visiblement vous avez un theme qui semble ne pas être celui par défaut, ou un module qui modifie les miniature produit... est-ce de la que vient votre soucis ? OU Avez vous raté une marche en modifiant un fichier ? 10 hours ago, Remy FRK Corp said: Sinon vous avez ça aussi : {if $product.additional_delivery_times == 1} {if $product.delivery_information} <span class="delivery-information">{$product.delivery_information}</span> {/if} {elseif $product.additional_delivery_times == 2} {if $product.quantity > 0} <span class="delivery-information">{$product.delivery_in_stock}</span> {* Out of stock message should not be displayed if customer can't order the product. *} {elseif $product.quantity <= 0 && $product.add_to_cart_url} <span class="delivery-information">{$product.delivery_out_stock}</span> {/if} {/if} Qui correspond àa ça dans le BO : Pour cette réponse ci dessous 9 hours ago, Remy FRK Corp said: après moi j'ai fais ça depuis le theme natif sur une installation toute fraiche de PS Vous visiblement vous avez un theme qui semble ne pas être celui par défaut, ou un module qui modifie les miniature produit... est-ce de la que vient votre soucis ? OU Avez vous raté une marche en modifiant un fichier ? je suis sur un thème nommé "MR PET" Et pour cette réponse ci dessous cela vient d'un module "conformité légal" et c'est en partie résolue 9 hours ago, Remy FRK Corp said: Et ca c'est étrange non ? : Edited March 26, 2021 by Postel nicolas (see edit history) Link to comment Share on other sites More sharing options...
Postel nicolas Posted March 26, 2021 Author Share Posted March 26, 2021 Voici le contenu du fichier product tpl dans templates\catalog\_partials\miniatures\ Si cela peut aider {** * 2007-2017 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License 3.0 (AFL-3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/AFL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <contact@prestashop.com> * @copyright 2007-2017 PrestaShop SA * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) * International Registered Trademark & Property of PrestaShop SA *} {$image_limit = Module::getInstanceByName('an_theme')->getParam('segmentedviewsettinds_imagelimit')} {assign currency_code Context::getContext()->currency->iso_code} {assign base_dir_url Context::getContext()->shop->getBaseURL(true)} {block name='product_miniature_item'} {* $product.images|@debug_print_var nofilter *} <article class="product-miniature js-product-miniature {if Module::isEnabled('an_theme') and Module::getInstanceByName('an_theme')->getParam('product_productImageChange') == 'hover-slider'} product-miniature-hover-slider {/if} " data-id-product="{$product.id_product}" data-id-product-attribute="{$product.id_product_attribute}" itemscope itemtype="http://schema.org/Product"> {if isset($product->upc) AND $product->upc} <meta itemprop="gtin13" content="{l s='EAN Code:'}{$product->ean13}"> {/if} {if isset($product->isbn) AND $product->isbn} <meta itemprop="gtin13" content="{l s='ISBN Code:'}{$product->isbn}"> {/if} {if isset($product->upc) AND $product->upc} <meta itemprop="gtin13" content="{l s='UPC Code:'}{$product->upc}"> {/if} {if isset($product.cover.large.url) AND $product.cover.large.url} <meta itemprop="image" content="{$product.cover.large.url}"> {/if} {if isset($product.id_manufacturer) AND $product.id_manufacturer} <meta itemprop="brand" content="{Manufacturer::getnamebyid($product.id_manufacturer)}"> {/if} {if isset($product.description_short) AND $product.description_short} <meta itemprop="description" content="{$product.description_short|strip_tags:'UTF-8'}"> {/if} <meta itemprop="sku" content="{$product.id_product}"> <div class="thumbnail-container"> <div class="thumbnail-container-image " style="min-height: 250px; min-height: {$product.cover.bySize.home_default.height}px;"> {block name='product_thumbnail'} {if Module::isEnabled('an_theme')} {if Module::getInstanceByName('an_theme')->getParam('product_productImageChange') == 'standart'} <a href="{$product.url}" class="thumbnail product-thumbnail"> <img src="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} {$base_dir_url}/modules/an_theme/views/img/loading.gif {else} {$product.cover.bySize.home_default.url} {/if}" alt="{if !empty($product.cover.legend)}{$product.cover.legend}{else}{$product.name|truncate:30:'...'}{/if}" data-full-size-image-url="{$product.cover.large.url}" class="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} b-lazy {/if}" data-width="{$product.cover.bySize.home_default.width}" data-height="{$product.cover.bySize.home_default.height}" content="{$product.cover.bySize.home_default.url}" data-src="{$product.cover.bySize.home_default.url}" > </a> {elseif Module::getInstanceByName('an_theme')->getParam('product_productImageChange') == 'hover'} <a href="{$product.url}" class="thumbnail product-thumbnail"> {foreach from=$product.images item=image name=foo} <img class="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} b-lazy {/if} img_hover_change {if $image.id_image == $product.cover.id_image} cover {/if} {if $smarty.foreach.foo.total == 1 } only_one {/if}" data-full-size-image-url="{$image.bySize.large_default.url}" src="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} {$base_dir_url}/modules/an_theme/views/img/loading.gif {else} {$product.cover.bySize.home_default.url} {/if}" alt="{$image.legend}" data-width="{$product.cover.bySize.home_default.width}" data-height="{$product.cover.bySize.home_default.height}" style="height: {$product.cover.bySize.home_default.height}px;" content="{$image.bySize.home_default.url}" data-src="{$image.bySize.home_default.url}" > {/foreach} </a> {elseif Module::getInstanceByName('an_theme')->getParam('product_productImageChange') == 'slider'} <div class="slider_product-wrapper"> <a href="{$product.url}" class="thumbnail product-thumbnail" style="height: {$product.cover.bySize.home_default.height}px; width: {$product.cover.bySize.home_default.width}px"> <img src="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} {$base_dir_url}/modules/an_theme/views/img/loading.gif {else} {$product.cover.bySize.home_default.url} {/if}" alt="{if !empty($product.cover.legend)}{$product.cover.legend}{else}{$product.name|truncate:30:'...'}{/if}" data-full-size-image-url="{$product.cover.large.url}" class="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} b-lazy {/if} slider_product cover" data-width="{$product.cover.bySize.home_default.width}" data-height="{$product.cover.bySize.home_default.height}" content="{$product.cover.bySize.home_default.url}" data-src="{$product.cover.bySize.home_default.url}" > </a> {foreach from=$product.images item=image} {if $image.id_image != $product.cover.id_image} <a href="{$product.url}" class="thumbnail product-thumbnail" style="height: {$product.cover.bySize.home_default.height}px; width: {$product.cover.bySize.home_default.width}px"> <img class="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} b-lazy {/if} slider_product not_cover" data-full-size-image-url="{$image.bySize.large_default.url}" src="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} {$base_dir_url}/modules/an_theme/views/img/loading.gif {else} {$image.bySize.home_default.url} {/if}" alt="{$image.legend}" data-width="{$product.cover.bySize.home_default.width}" data-height="{$product.cover.bySize.home_default.height}" content="{$image.bySize.home_default.url}" data-src="{$image.bySize.home_default.url}" > </a> {/if} {/foreach} </div> {elseif Module::getInstanceByName('an_theme')->getParam('product_productImageChange') == 'hover-slider'} <a href="{$product.url}" class="thumbnail product-thumbnail hover_slider"> <ul {if $product.images|@count == 1} class="only_one_item"{/if}> <li class="cover-item"> <div class="hover-slider-img"> <img src="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} {$base_dir_url}/modules/an_theme/views/img/loading.gif {else} {$product.cover.bySize.home_default.url} {/if}" alt="{if !empty($product.cover.legend)}{$product.cover.legend}{else}{$product.name|truncate:30:'...'}{/if}" data-full-size-image-url="{$product.cover.large.url}" class="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} b-lazy {/if} hover-slider-image" data-width="{$product.cover.bySize.home_default.width}" data-height="{$product.cover.bySize.home_default.height}" content="{$product.cover.bySize.home_default.url}" data-src="{$product.cover.bySize.home_default.url}" > </div> </li> {$image_limit_other = $image_limit} {foreach from=$product.images item=image name=hoverslider} {if $smarty.foreach.hoverslider.iteration == $image_limit and $image.id_image == $product.cover.id_image } {$image_limit_other = $image_limit-1} {elseif $smarty.foreach.hoverslider.iteration > $image_limit and $image.id_image == $product.cover.id_image } {$image_limit_other = $image_limit-1} {/if} {/foreach} {foreach from=$product.images item=image name=hoverslider} {if $image.id_image != $product.cover.id_image and $smarty.foreach.hoverslider.iteration <= $image_limit_other} <li class="no-cover-item"> <div class="hover-slider-img"> {if Module::getInstanceByName('an_theme')->getParam('segmentedviewsettinds_textonlastimg') == 1} {if $smarty.foreach.hoverslider.iteration == $image_limit_other and ($product.images|@count-$image_limit)>0} <div class="more-images"> {$product.images|@count-$image_limit} {if ($product.images|@count-$image_limit) == 1} {l s='more image' d='Shop.Theme.Actions'} {else} {l s='more images' d='Shop.Theme.Actions'} {/if} </div> {/if} {/if} <img class="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} b-lazy {/if} hover-slider-image" data-full-size-image-url="{$image.bySize.large_default.url}" src="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} {$base_dir_url}/modules/an_theme/views/img/loading.gif {else} {$image.bySize.home_default.url} {/if}" alt="{$image.legend}" data-width="{$product.cover.bySize.home_default.width}" data-height="{$product.cover.bySize.home_default.height}" content="{$image.bySize.home_default.url}" data-src="{$image.bySize.home_default.url}" >00 </div> </li> {/if} {/foreach} </ul> </a> {/if} {else} <a href="{$product.url}" class="thumbnail product-thumbnail"> <img src="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} {$base_dir_url}/modules/an_theme/views/img/loading.gif {else} {$image.bySize.home_default.url} {/if}" alt="{if !empty($product.cover.legend)}{$product.cover.legend}{else}{$product.name|truncate:30:'...'}{/if}" data-full-size-image-url="{$product.cover.large.url}" class="{if Module::getInstanceByName('an_theme')->getParam('global_lazyLoad')} b-lazy {/if} " data-width="{$product.cover.bySize.home_default.width}" data-height="{$product.cover.bySize.home_default.height}" content="{$product.cover.bySize.home_default.url}" data-src="{$image.bySize.home_default.url}" > </a> {/if} {/block} <div class="highlighted-informations{if !$product.main_variants} no-variants{/if} hidden-sm-down"> {if Module::isEnabled('an_theme') and Module::getInstanceByName('an_theme')->getParam('global_showquickview') == 1} {block name='quick_view'} <a class="quick-view" href="#" data-link-action="quickview"> <i class="material-icons search"></i> {l s='' d='Shop.Theme.Actions'} </a> {/block} {/if} {if !Module::isEnabled('an_productattributes')} {block name='product_variants'} {if $product.main_variants} {include file='catalog/_partials/variant-links.tpl' variants=$product.main_variants} {/if} {/block} {/if} </div> </div> <div class="product-description"> {block name='product_name'} <h3 class="h3 product-title" itemprop="name"><a href="{$product.url}">{$product.name|truncate:200:'...'}</a></h3> {/block} {if Module::isEnabled('an_theme') and Module::getInstanceByName('an_theme')->getParam('product_shortdescription') == 1} {$max_length = Module::getInstanceByName('an_theme')->getParam('product_shortdescriptionlength')} {block name='product_description_short'} <p class="an_short_description" id="an_short_description_{$product.id}"> {$product.description_short|strip_tags:'UTF-8'|truncate:$max_length:'...'} </p> {/block} {block name='product_availability'} <span id="product-availability"> {if $product.show_availability && $product.availability_message} {if $product.availability == 'available'} <i class="material-icons rtl-no-flip product-available"></i> {elseif $product.availability == 'last_remaining_items'} <i class="material-icons product-last-items"></i> {else} <i class="material-icons product-unavailable"></i> {/if} {$product.availability_message} {/if} </span> {/block} {/if} {block name='product_price_and_shipping'} {if $product.show_price} <div class="product-price-and-shipping" itemprop="offers" itemscope itemtype="http://schema.org/Offer" priceValidUntil=""> <meta itemprop="priceCurrency" content="{if isset($currency_code)}{$currency_code}{/if}"> <meta itemprop="url" content="{$product.url}"> <link itemprop="availability" href="http://schema.org/InStock"> {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} {hook h='displayProductPriceBlock' product=$product type="before_price"} <span class="sr-only">{l s='Price' d='Shop.Theme.Catalog'}</span> <span class="price" itemprop="price" content="{$product.price_tax_exc}"> <span class="money" {if isset($currency_code)}data-currency-{$currency_code|lower}="{$product.price}"{/if}>{$product.price}</span> </span> {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> {/if} {hook h='displayProductPriceBlock' product=$product type='unit_price'} {hook h='displayProductPriceBlock' product=$product type='weight'} {if isset($product.product_attribute_minimal_quantity)} {$min_quantity = $product.product_attribute_minimal_quantity} {else} {$min_quantity = $product.minimal_quantity} {/if} {if Module::isEnabled('an_theme')} {if Module::getInstanceByName('an_theme')->getParam('product_addtocart') == 'button' or Module::getInstanceByName('an_theme')->getParam('product_addtocart') == 'qtyandbutton' } <div class="atc_div"> {if Module::getInstanceByName('an_theme')->getParam('product_addtocart') == 'qtyandbutton'} <input name="qty" type="number" min="{$min_quantity}" max="{$product.quantity}" class="form-control atc_qty" value="{$min_quantity}"/> {/if} <button class="add_to_cart btn btn-primary btn-sm {if $product.availability == 'unavailable'}disabled{/if} " onclick="mypresta_productListCart.add({literal}$(this){/literal});"> {l s='Add to cart' d='Shop.Theme.Actions'} </button> </div> {/if} {/if} </div> {/if} {/block} </div> {block name='product_flags'} {block name='product_reviews'} {hook h='displayProductListReviews' product=$product} {/block} <a href="{$product.url}"> <ul class="product-flags"> {foreach from=$product.flags item=flag} <li class="product-flag {$flag.type}">{$flag.label}</li> {/foreach} {if $product.has_discount} {if $product.discount_type === 'percentage'} <li class="product-flag discount-percentage">{$product.discount_percentage}</li> {else} <li class="product-flag discount-percentage"> {l s='- %amount%' d='Shop.Theme.Catalog' sprintf=['%amount%' => $product.discount_to_display]} </li> {/if} {/if} </ul> </a> {/block} </div> </article> {/block} Link to comment Share on other sites More sharing options...
Remy FRK Corp Posted March 26, 2021 Share Posted March 26, 2021 Bonjour. Petite question est ce que votre teheme est bien compatible avec votre version de Presta? Vous dites ètre en 1.7.7.1 mais le disclaimer de votre theme s'arrete en 2017... (bon vu que c'est un theme spe ...) Link to comment Share on other sites More sharing options...
Postel nicolas Posted March 26, 2021 Author Share Posted March 26, 2021 Bonjour, oui la version téléchargé du thème correspond bien à la version de PrestaShop. Link to comment Share on other sites More sharing options...
Remy FRK Corp Posted March 26, 2021 Share Posted March 26, 2021 (edited) OK bon je vois que le fichier intègre pas mal de choses spécifique à votre theme. Ne disposant pas de votre theme c'est compliqué de dire ou se situe le soucis, on aurait pu pensé à une divergence d’héritage au niveau des fichiers mais visiblement votre tpl category reçoit bien une info, or il n'affiche pas la bonne... Faudrait comparer les fichiers qui affichent correctement et celui qui n'affiche pas correctement... aussi bien dans la structure que dans leurs héritages... à ce stade tout ce que je peux vous dire c'est que ca vient probablement de votre theme ou de quelque chose que vous avez fait vu que sur le theme classic ca marche sans soucis... Edited March 26, 2021 by Remy FRK Corp (see edit history) Link to comment Share on other sites More sharing options...
Postel nicolas Posted March 26, 2021 Author Share Posted March 26, 2021 (edited) ok je vous remercie Une idée sur quels fichiers à comparer en premier lieu ? Edited March 26, 2021 by Postel nicolas (see edit history) Link to comment Share on other sites More sharing options...
Remy FRK Corp Posted March 26, 2021 Share Posted March 26, 2021 peut être ceux liés a category et ceux situés dans catalog/listing ca doit tourner autour du répertoire catalog Link to comment Share on other sites More sharing options...
Postel nicolas Posted March 29, 2021 Author Share Posted March 29, 2021 Bonjour j'ai jeter un œil ce dimanche mais rien trouver pour l'instant je reviens vous dire si je trouve ou non dans la semaine. Link to comment Share on other sites More sharing options...
Postel nicolas Posted April 1, 2021 Author Share Posted April 1, 2021 Bonjour je reviens vers vous J 'ai modifié le bout de code par celui ci dessous par une autre variable ($product.available_later) trouver sur le net: {block name='product_availability'} <span id="product-availability"> {if $product.show_availability && $product.availability_message} {if $product.availability == 'available'} <i class="material-icons rtl-no-flip product-available"></i>{$product.availability_message} {elseif $product.availability == 'last_remaining_items'} <i class="material-icons product-last-items"></i>{$product.availability_message} {else} {if !empty($product.available_later)} <i class="material-icons product-available"></i> {$product.available_later} {else} <i class="material-icons product-unavailable"></i> {$product.availability_message}{/if} {/if} {/if} </span> {/block} Je n'ai pas trouvé ni corrigé le problème originel mais cela fonctionne pour le moment. Merci A Remy pour son aide Link to comment Share on other sites More sharing options...
Remy FRK Corp Posted April 2, 2021 Share Posted April 2, 2021 Bonjour. De rien c'est vous qui avez tout fait ! Bon courage pour votre boutique. 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