Jump to content

Afficher les montants HT sur les avoirs Prestashop


Recommended Posts

ok. Vous n'avez pas peur de mettre les mains dans le code ? J'ai regardé dans les fichiers et voici ce que vous pouvez essayer :

1.  overrider le fichier tpl du pdf : copier le fichier pdf/order-slip-total.tpl dans themes/votre-theme/pdf/order-slip-total-tab.tpl

2. remplacer le bloc suivant :

	{if isset($order_details) && count($order_details) > 0}
		{if (($order->total_paid_tax_incl - $order->total_paid_tax_excl) > 0)}
			{if $tax_excluded_display}
				<tr>
					<td class="grey" width="70%">
						{l s='Product Total (Tax Excl.)' d='Shop.Pdf' pdf='true'}
					</td>
					<td class="white" width="30%">
						- {displayPrice currency=$order->id_currency price=$order->total_products}
					</td>
				</tr>
			{else}
				<tr>
					<td class="grey" width="70%">
						{l s='Product Total (Tax Incl.)' d='Shop.Pdf' pdf='true'}
					</td>
					<td class="white" width="30%">
						- {displayPrice currency=$order->id_currency price=$order->total_products_wt}
					</td>
				</tr>
			{/if}
		{else}
			<tr>
				<td class="grey" width="70%">
					{l s='Product Total' d='Shop.Pdf' pdf='true'}
				</td>
				<td class="white" width="30%">
					- {displayPrice currency=$order->id_currency price=$order->total_products}
				</td>
			</tr>
		{/if}
	{/if}

 par :

{if isset($order_details) && count($order_details) > 0}
	<tr>
		<td class="grey" width="70%">
			{l s='Product Total (Tax Excl.)' d='Shop.Pdf' pdf='true'}
		</td>
		<td class="white" width="30%">
			- {displayPrice currency=$order->id_currency price=$order->total_products}
		</td>
	</tr>
	<tr>
		<td class="grey" width="70%">
			{l s='Product Total (Tax Incl.)' d='Shop.Pdf' pdf='true'}
		</td>
		<td class="white" width="30%">
			- {displayPrice currency=$order->id_currency price=$order->total_products_wt}
		</td>
	</tr>
	<tr>
		<td class="grey" width="70%">
			{l s='Total Tax' d='Shop.Pdf' pdf='true'}
		</td>
		<td class="white" width="30%">
			- {displayPrice currency=$order->id_currency price=($order->total_paid_tax_incl - $order->total_paid_tax_excl)}
		</td>
	</tr>
{/if}

De cette façon, le bloc affichera le prix HT, le prix TTC et le montant de la TVA.

Cela supprime la condition dépendant des réglages de Prestashop (si affichage HT activé => seulement prix HT, sinon prix TTC affiché)

Ne pas oublier de vider le cache de Prestashop

Link to comment
Share on other sites

J'ai oublié un point : avec le code proposé, comme il intègre le montant de la TVA, il faut supprimer, dans l'override du tpl, le bloc


	{if ($order->total_paid_tax_incl - $order->total_paid_tax_excl) > 0}
		<tr>
			<td class="grey" width="70%">
				{l s='Total Tax' d='Shop.Pdf' pdf='true'}
			</td>
			<td class="white" width="30%">
				- {displayPrice currency=$order->id_currency price=($order->total_paid_tax_incl - $order->total_paid_tax_excl)}
			</td>
		</tr>
	{/if}

Sinon il s'affichera 2 fois 🙂

Link to comment
Share on other sites

Bonjour je ne pense pas qu'il existe un module. Des que mon pc est retranché je vous enverrai le tel et vous dirai oû le mettre après avoir sauvegardé le fichier original. Ou vous m'envoyez en mode un accès FTP.

Link to comment
Share on other sites

Bonjour,

Via FTP, créez un dossier pdf dans le dossier de votre thème (themes/votre_theme/pdf.

Importez ensuite dans ce dossier le fichier joint et testez. Vous ne touchez pas aux fichiers d'origine, c'est un "override". Si cela ne fonctionne pas, il suffit de le supprimer.

order-slip.total-tab.tpl

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