Jump to content

[TUTO] Change price = 0 by Contact us


Recommended Posts

Bonjour à tous, 

 

Après des heures à chercher une solution et n'étant pas développeur, je voulais que lorsque le prix soit égale à 0 il soit afficher Contactez nous. 

 

Voici ce que j'ai fait : 

 

fichier product.tpl ligne 386 : 

remplacer : {if $priceDisplay >= 0 && $priceDisplay <= 2}

par : {if $priceDisplay >= 0 && $priceDisplay <= 2 && $productPrice >= 1}

 

avant la fin du IF ajoutez : 

{else}<span id="our_price_display">Nous contacter</span> 
 
Ce qui donne : 
 
<div class="price">
				<p class="our_price_display">
				{if $priceDisplay >= 0 && $priceDisplay <= 2 && $productPrice >= 1}
					<span id="our_price_display">{convertPrice price=$productPrice}</span>
					<!--{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
						{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
					{/if}-->
				{else}<span id="our_price_display">Nous contacter</span> 

				{/if}
				</p>

Ensuite il faut modifier aussi product-list.tpl pour être synchro sur tout le site internet. 

 

Il suffit d'ajouter la condition {prix du produit > 1€} :

ajoutez à la ligne 52 dans le {if} : $product.price >= 1

ce qui donne : {if $product.price >= 1 && isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}

 

et encore une fois ajouter le else ce qui donne au final : 

<div class="content_price">
					{if $product.price >= 1 && isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
					<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />
					{else}<span class="price">Contactez nous</span> 
					{/if}

J'espère que ca évitera de perdre du temps à certains ! 

 

A plus

 

N'hésitez pas à me répondre si j'ai fait une faute ... Je ne suis pas développeur donc mon égo ne prendra pas un coup ! ;-)

 

 

 

 

 

Edited by KevLas (see edit history)
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...