Prestashop: ps_legalcompliance unit_price tax

Created on 5 Aug 2019  路  5Comments  路  Source: PrestaShop/PrestaShop

Hello, because my previously post was closed and I don't know how to re-open it and I don't know if my last reply could be seen so I create a new post.

The settings :
PS 1.7.5.2 (not 1.7.6 tested to try to reproduce the issue)
ps_legalcompliance activated
tax activated.
Prices showed only to a custom group of clients (groupe name = pro)
Prices showed tax exc.
PHP 7
Theme : ZOneTheme (but tried with classic theme)

*The issue :*
On product list, unit_price is showed tax inc (bad)
On product page, unit_price is showed tax exc (good)

On product-list, unit_price is displayed by ps_legalcompliance :
{hook h='displayProductPriceBlock' product=$product type='unit_price'}

On product page, unit_price is displayed by product-prices.tpl

 `{block name='product_unit_price'}

      {if $displayUnitPrice}

        <p class="product-unit-price sub">{l s='(%unit_price%)' d='Shop.Theme.Catalog' sprintf=['%unit_price%' => $product.unit_price_full]}</p>

      {/if}

    {/block}`

Tried with changing the theme to Classic. Same problem.

I don't know if it's linked but in ProductController.php I see :

` if ($product_full['unit_price_ratio'] > 0) {
        $unitPrice = ($productSettings->include_taxes) ? $product_full['price'] : $product_full['price_tax_exc'];
        $product_full['unit_price'] = $unitPrice / $product_full['unit_price_ratio'];
    }`

Thanks for your help !

1.7.5.1 1.7.5.2 1.7.6.0 Bug FO Legalcompliance Minor To Do

All 5 comments

Hi @sirius82,

Thanks for these clarifications.
Following these steps, I manage to reproduce the issue with PS1.7.6.0 & PS1.7.5.1 & the ps_legalcompliance module v3.0.1 & ps_legalcompilance v3.0.2.
https://drive.google.com/file/d/1RUq8UF-ji8rYo8PF10h2BiiugkyVBMIF/view
image

I鈥檒l add this to the debug roadmap so that it鈥檚 fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!

Thanks a lot. I'm not PHP dev ...
I tried to replace the call to the hook by the code of product-prices.tpl but it causes an error about displayunitPrice. Do you want the exactly message ?

Hello, the problem was already asked here http://forge.prestashop.com/browse/BOOM-805?attachmentOrder=desc
Seemed resolved with this https://github.com/PrestaShop/PrestaShop/pull/5930/files
But the ProdutController.php in PS 1.7.5.2 seems to have theses changes. And the problem is always there ...

Why it's not possile to replace the call to the hook of legalcompliance by the code like in product-prices ? It should be so simple. But it doesn't work ...
Thanks

@sirius82, This issue is added to the bug roadmap, it should be fixed by our developers or it can be solved before if someone submits a pull request to solve it.

Thanks!

thanks. I'm just trying to understand why it's not the same code in product list and in product page and why the code of the second doesn't work in the first. I should be so simple to get the same code ?
It's important for BtoB, customers don't understand why unit price is not the same following the page. And it's not correct for the RGPD.

Thanks

Was this page helpful?
0 / 5 - 0 ratings