ptityop Posted September 6, 2022 Share Posted September 6, 2022 Hello, I am modifying a catalog template and trying to show product prices without tax, but when changing the variable from displayPrice price=$r_product.price to displayPrice price=$r_product.price_tax_exc i am getting a pdf with the following error : Invalid $number parameter: "" cannot be interpreted as a number Any ideas ? Many thanks in advance Link to comment Share on other sites More sharing options...
ptityop Posted September 7, 2022 Author Share Posted September 7, 2022 Sure there it is .... with thanks in advance! <!-- name="{l s='Catalog with attributes and features' mod='m4pdf'}" data="product" --> {assign var='imageType' value='medium_default'} {* choose image type (Preferences > Images) *} <head> {literal} <style> @page { sheet-size: A4; margin-top: 30mm; margin-bottom: 15mm; margin-left: 15mm; margin-right: 15mm; margin-header: 6mm; margin-footer: 6mm; } @page header { odd-header-name: html_header1; even-header-name: html_header1; odd-footer-name: html_footer1; even-footer-name: html_footer1; } @page toc { sheet-size: A4; margin-top: 40mm; margin-bottom: 15mm; margin-left: 15mm; margin-right: 15mm; margin-header: 6mm; margin-footer: 6mm; } {/literal} {include file='style_01.tplx'} </style> </head> <body> {if $conf.cloud} {assign var="force_protocol" value="http"} {else} {assign var="force_protocol" value=""} {/if} <!--mpdf <htmlpageheader name="header1"> <div class="header zero center"> <img src="http://www.suissetechnique.ch/modules/m4pdf/img/catalogue.png" /> </div> </htmlpageheader> <htmlpagefooter name="footer1"> <hr /> <div class="left w80">{$conf.shop_www} {$conf.shop_email} {l s='phone:' mod='m4pdf'} {$conf.shop_phone}</div> <div class="right align-right w10">{ldelim}PAGENO{rdelim}</div> </htmlpagefooter> mpdf--> <img src="file:///{$conf.logo}" /> <div class="right align-right"> <h1 class="catalog">{l s='Product Catalog' mod='m4pdf'}</h1> <h3 class="bigger">{$conf.shop_name}</h3> <p>{$conf.shop_addr1}<br /> {$conf.shop_city}</p> <p>{$conf.shop_www}<br /> {$conf.shop_email}<br /> {$conf.shop_phone}</p> </div> <pagebreak page-selector="header" /> <!--mpdf <sethtmlpageheader name="header1" page="O" value="on" show-this-page="1" /> <sethtmlpagefooter name="footer1" page="O" value="on" show-this-page="1" /> mpdf--> <tocpagebreak toc-page-selector="toc" font="sans" font-size="10" indent="5" paging="on" links="on" suppress="off" pagenumstyle="1" toc-preHTML="<h2>{l s='Contents' mod='m4pdf'}</h2>" /> <!--mpdf <sethtmlpageheader name="header1" page="O" value="on" show-this-page="1" /> <sethtmlpagefooter name="footer1" page="O" value="on" show-this-page="1" /> mpdf--> {foreach from=$product item=r_product name=r_product} <table autosize="1" class="w100" style="page-break-inside:avoid"> <tr> <td colspan=2 class="w100 name"> {$r_product.name|escape:'htmlall':'UTF-8'}<tocentry content="{$r_product.name|escape:'htmlall':'UTF-8'}" level="0" /> </td> </tr> <tr> <td width="20%"> {assign var="id_product_id_image" value="`$r_product.id_product`-`$r_product.image.id_image`"} <img class="smallerphoto" src="{if $r_product.image.id_image}{imageLink name=$r_product.link_rewrite ids=$id_product_id_image force_protocol=$force_protocol type=$imageType}{else}{$conf.img_prod_dir}{$conf.pdf_iso_lang}.jpg{/if}" /> </td> <td> <br /> <div>{$r_product.description nofilter}</div> <p class="bigger"><br /><strong>{l s='Price:' mod='m4pdf'} {displayPrice price=$r_product.price_tax_exc currency=$conf.currency_current}</strong><br /></p> {* start product attributes *} {assign var="changed_product_attribute" value=0} {if $r_product.product_attribute} <br /> <table autosize="1" class="w100" style="page-break-inside:avoid"> {foreach from=$r_product.product_attribute item=product_attribute name=product_attribute} {* end of the row - other than last iterations, use $saved *} {if $changed_product_attribute != $product_attribute.id_product_attribute && !$smarty.foreach.product_attribute.first} {if $saved.reference} <span>{l s='Reference:' mod='m4pdf'} {$saved.reference}</span>, {/if} <span><strong>{l s='Price:' mod='m4pdf'} {displayPrice price=$r_product.price+$saved.price currency=$conf.currency_current}</strong></span> </td> </tr> {/if} {* start of the row *} {if $changed_product_attribute != $product_attribute.id_product_attribute} <tr> <td style="padding-top: 1mm"> {/if} {if $changed_product_attribute != $product_attribute.id_product_attribute} {assign var="changed_product_attribute" value=$product_attribute.id_product_attribute} {/if} {* attributes and groups *} <span>{$product_attribute.attribute_group.name}: {$product_attribute.attribute.name}</span>, {assign var="saved" value=$product_attribute} {* end of the row - last iteration *} {if $smarty.foreach.product_attribute.last} {if $product_attribute.reference} <span>{l s='Reference:' mod='m4pdf'} {$product_attribute.reference}</span>, {/if} <span><strong>{l s='Price:' mod='m4pdf'} {displayPrice price=$r_product.price+$product_attribute.price currency=$conf.currency_current}</strong></span> </td> </tr> {/if} {/foreach} </table> {/if} {* end product attributes *} {* start product features *} {if $r_product.product_feature} <br /> <table autosize="1" class="w100" style="page-break-inside:avoid"> {foreach from=$r_product.product_feature item=product_feature name=product_feature} <tr> <td style="padding-right: 8mm"><strong>{$product_feature.name|escape:'htmlall':'UTF-8'}:</strong></td> <td>{$product_feature.value|escape:'htmlall':'UTF-8'}</td> </tr> {/foreach} </table> {/if} {* end product features *} </td> </tr> </table> {foreachelse} <p> {l s='no products' mod='m4pdf'} </p> {/foreach} </body> Link to comment Share on other sites More sharing options...
ptityop Posted September 7, 2022 Author Share Posted September 7, 2022 FYI, it really seems to be an issue with the price exc tax, because I am having the same issue with the invoice tpl ....Same error message and no error message when deleting those lines of code, seems like the tax_exc is causing trouble somehow ... {displayPrice currency=$order->id_currency price=$line.total_tax_excl} {displayPrice price=$order_invoice->total_paid_tax_excl} Link to comment Share on other sites More sharing options...
ptityop Posted September 8, 2022 Author Share Posted September 8, 2022 Thank you ! I will try this and give feedback ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now