Jump to content

[résolu] Label 'Bientôt dispo' dans product-list


Recommended Posts

Bonjour et merci par avance à celles et ceux qui voudront bien me donne un coup de main.

Voilà ce que j'ai (et qui me va très bien) : les produits sans stock sont "non commandable" et quand je rentre une 'date de disponibilité' sur l'onglet Quantité de l'article : cette date apparaît bien sur la fiche produit.

le code :

<p id="availability_date"{if ($product->quantity > 0) || !$product->available_for_order || $PS_CATALOG_MODE || !isset($product->available_date) || $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} style="display: none;"{/if}>
<span class="label label-warning">{l s='Availability date:'}{if Validate::isDate($product->available_date)}{dateFormat date=$product->available_date full=false}{/if}
</span>
</p>

le visuel :

 image.jpeg.25e843464a502d72bbfdaf104a4e560c.jpeg

 

Et voilà ce que j'aimerais (et qui me paraît d'une logique implacable étant donné que c'est la première chose que le client voit) :

--> avoir le label 'Bientôt dispo' ou 'Arrivage prévu' dans le product-list s'il y a une 'date de disponibilité' de renseignée, et même si le produit est non commandable.

Je me passerais ici de la date ;-)

Je me doute bien que cela se passe ici, mais mes connaissances s'arrêtent là !!

					{if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
						{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
							<span class="availability">
								{if ($product.allow_oosp || $product.quantity > 0)}
									<span class="{if $product.quantity <= 0 && isset($product.allow_oosp) && !$product.allow_oosp} label-danger{elseif $product.quantity <= 0} label-warning{else} label-success{/if}">
										{if $product.quantity <= 0}{if $product.allow_oosp}{if isset($product.available_later) && $product.available_later}{$product.available_later}{else}{l s='In Stock'}{/if}{else}{l s='Out of stock'}{/if}{else}{if isset($product.available_now) && $product.available_now}{$product.available_now}{else}{l s='In Stock'}{/if}{/if}
									</span>
								{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
									<span class="label-warning">
										{l s='Product available with different options'}
									</span>
								{else}
									<span class="label-danger">
										{l s='Out of stock'}
									</span>
								{/if}
							</span>
						{/if}
					{/if}
				</div>

 

Je suis en PS 1.6.1.9

 

Merci de m'avoir lu.

Merci encore plus de votre aide.

 

DN

 

 

 

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

je me réponds à moi même (si ça peut en aider d'autres !)

voilà le code à insérer avant le label 'stock non dispo' du product-list.tpl du thème :

{elseif (isset($product.available_date) && $product.available_date > 0 && $product.quantity == 0)}
<span class="label label-warning">{l s='Availability date:'}</span>

pour ma part, dans la traduction de 'Availability date:' j'ai mis 'Bientôt dispo'...

 

 

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