Jump to content

Afficher le stock restant sur la fiche produit


Recommended Posts

Bonjour,

J'utilise Prestashop 1.6.1.23 et je rencontre un souci.
Sur certains produits la quantité en stock s'affiche bien sur la fiche produit et sur d'autres non.
Je constate que ça ne s'affiche pas sur des produits qui sont gratuits. Y a-t-il quelque chose à cocher en plus pour les produits gratuits ?
Merci à ceux qui pourront m'éclairer sur ce sujet.

Link to comment
Share on other sites

à l’instant, Mediacom87 a dit :

Bonjour,

Dans la section Préférences >> Produits comme est configuré l'affichage du stock ?

image.thumb.png.fb75637c4c72ca41193bc376bab0cffa.png

j'ai bien spécifié OUI pour affiche les quantités disponibles et mis 5 en dernières quantités.

Ca fonctionne bien pour les produits payants mais c'est uniquement sur les produits gratuits que je rencontre ce souci.

Link to comment
Share on other sites

Il faudrait regarder dans votre product.tpl comment est écrite la condition.

Dans le thème de base c'est ça:

			{if ($display_qties == 1 && !$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && $product->available_for_order)}
				<!-- number of item in stock -->
				<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'}</span>
					<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items'}</span>
				</p>
			{/if}
			<!-- availability or doesntExist -->
			<p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
				{*<span id="availability_label">{l s='Availability:'}</span>*}
				<span id="availability_value" class="label{if $product->quantity <= 0 && !$allow_oosp} label-danger{elseif $product->quantity <= 0} label-warning{else} label-success{/if}">{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span>
			</p>

 

Link to comment
Share on other sites

il y a 3 minutes, Eolia a dit :

Il faudrait regarder dans votre product.tpl comment est écrite la condition.

Dans le thème de base c'est ça:

			{if ($display_qties == 1 && !$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && $product->available_for_order)}
				<!-- number of item in stock -->
				<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'}</span>
					<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items'}</span>
				</p>
			{/if}
			<!-- availability or doesntExist -->
			<p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
				{*<span id="availability_label">{l s='Availability:'}</span>*}
				<span id="availability_value" class="label{if $product->quantity <= 0 && !$allow_oosp} label-danger{elseif $product->quantity <= 0} label-warning{else} label-success{/if}">{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span>
			</p>

 

alors là tout ça est du chinois pour moi. Je vais voir ça avec la presta qui nous a monté notre boutique. Merci.

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...