Jump to content

Quantité produit ne s'affiche pas en mode catalogue


Recommended Posts

Bonjour à tous,

 

un autre soucis se présente à moi.

 

je suis en mode catalogue et je voudrais afficher les quantités en stock de mes produits.

 

j'ai donc choisi le mode catalogue...

plus bas j'ai coché oui pour : Afficher les quantités disponibles sur la page produit

 

et j'ai bien indiquer une quantité pour chaque produits et pour mes deux boutiques.

 

je suis en Prestashop 1.5.6.0 et je n'ai pas le thème officiel de prestashop

 

je suis allé dans le fichier product.tpl mais je n'ai pas vu de code désactivé... du moins pour l'affichage du stock.

 

  Quote

 

<!-- availability -->

<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<span id="availability_label">{l s='Availability:'}</span>
<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}</span>
</p>
<p id="availability_date"{if ($product->quantity > 0) OR !$product->available_for_order OR $PS_CATALOG_MODE OR !isset($product->available_date) OR $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} style="display: none;"{/if}>
<span id="availability_date_label">{l s='Availability date:'}</span>
<span id="availability_date_value">{dateFormat date=$product->available_date full=false}</span>
</p>
<!-- number of item in stock -->
{if ($display_qties == 1 && !$PS_CATALOG_MODE && $product->available_for_order)}
<p id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}>
<span id="quantityAvailable">{$product->quantity|intval}</span>
<span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='Item in stock'}</span>
<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items in stock'}</span>
</p>
{/if}
 
<!-- Out of stock hook -->
<div id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
{$HOOK_PRODUCT_OOS}
</div>
 
<p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties OR $product->quantity <= 0) OR $allow_oosp OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none"{/if} >{l s='Warning: Last items in stock!'}</p>
</div>
 
<div class="content_prices clearfix">
 
<div class="leo-product-suffix">
<!-- quantity wanted -->
<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<label>{l s='Quantity:'}</label>
<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />
</p>
 
 
{if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}
<span class="exclusive">
<span></span>
{l s='Add to cart'}
</span>
{else}
<p id="add_to_cart" class="buttons_bottom_block">
<input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" />
</p>
{/if}
 
 
comment activé l'affichage des quantités ???
 
merci d'avance

 

Link to comment
Share on other sites

Hello : )

{if ($display_qties == 1 && !$PS_CATALOG_MODE && $product->available_for_order)}
<p id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}>
<span id="quantityAvailable">{$product->quantity|intval}</span>
<span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='Item in stock'}</span>
<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items in stock'}</span>
</p>
{/if}

Dans le {if}, la condition : !$PS_CATALOG_MODE vérifie que l'on est pas en mode catalogue.

Et comme on est en catalogue, le {if} n'est pas vérifié, donc on ne rentre pas dedans, donc les quantité ne sont pas affiché :)

Edited by Szed (see edit history)
Link to comment
Share on other sites

Il vous suffit de remplacer :

{if ($display_qties == 1 && !$PS_CATALOG_MODE && $product->available_for_order)}

par

{if ($display_qties == 1 && $product->available_for_order)}

De cette facon, la quantité disponible ne s'affichera pas en fonction du mode catalogue ou non.
Elle ne s'affichera que si :

 - l'option "Afficher les quantité" est coché ($display_qties == 1)

 et (&&)

 - le produit est dispo à la commande ($product->available_for_order). Pour celle ci, je ne sais pas si ca passera en mode catalogue. Si ca ne passe pas, il faut l'enlever également.

Edited by Szed (see edit history)
Link to comment
Share on other sites

merci mais j'ai remplacé le code mais cela ne s'affiche pas non plus...

 

j'ai vidé le cache, forcé la re compilation mais cela ne fonctionne pas...

 

j'ai essayé :

 

  Quote

 

 

{if ($display_qties == 1 && $product->available_for_order)}

 

puis

 

  Quote

 

 

{if ($display_qties == 1)}

 

mais toujours pas de quantité.

j'ai vérifier dans les paramètres produits, j'ai bien coché affiché les quantités sur la fiche produits à OUI

et j'ai bien des quantités dans mes articles

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...