Page 1 of 1

Bug on ItemPrice

Posted: 11 Jun 2021, 12:34
by lecoq.fr
Hi
Every things was ok until I change some code for having a good sort by category on catalog (I will post my change later) . I try to go back on my modifications without succes.

When I display Item for public (not registered) I don't want to display prices. (I select Display Price (Access Levels) REGISTERED in Catalog Options)

Now I've got errors on components/com_phocacart/layouts/product_price.php because PriceItem doesn't exist so I add a test each time $d['priceitems'] is used :

$displayPrice = 1;// At start display price = yes. If there will be some condition which will hide the price then use the information e.g. for discount prices (even disable them)
if (isset($d['priceitems']))
{
if ($d['priceitems']['netto'] && $d['priceitems']['taxcalc'] > 0 && ($d['priceitems']['netto'] != $d['priceitems']['brutto'])) {
$labelNetto = '<div class="ph-price-txt ph-price-netto-txt '.$classPS.'-txt">'. $d['priceitems']['nettotxt'].'</div>';
$priceNetto = '<div class="ph-price-netto '.$classPS.'">'.$d['priceitems']['nettoformat'].'</div>';
}

....

With that patch the display is ok but I dont understand why, now, I need that kind of patch ...
At this time I do not understand how the $displayData variable is entered... this may be the key to the problem.

Re: Bug on ItemPrice

Posted: 13 Jun 2021, 09:59
by Jan
Hi,

$displayData is a variable in layout - such variable is sent from views to layout, so it depends on which view are your displaying at the moment.

Which error message do you exactly get? In which view?

Jan

Re: Bug on ItemPrice

Posted: 13 Jun 2021, 11:13
by Jan
BTW - I see it now, I will change the behaviour there, the price layout should not be called when the price is disabled at all. Can you confirm in whcih view you get the problem so I can test it properly?

Thank you.

Jan

Re: Bug on ItemPrice

Posted: 14 Jun 2021, 17:40
by lecoq.fr
The bug is when I want to display all the Item for a category. I don't understand why two month a go there's no problem and after having modify printed catalog soft the bug appears... yet I thought I had correctly backtracked on my modifications ! I will explain to you in another subject my modifications to have a correct sorting by category (alphabetical order) on printed catalog

Re: Bug on ItemPrice

Posted: 15 Jun 2021, 14:22
by Jan
Hi, you can test the latest Beta version where this should be OK (for the core parts):

https://github.com/PhocaCz/PhocaCart/re ... Beta13.zip

There is no if condition in the price layout, the layout is not called when this parameter is set to Yes.

Try to test this Beta version (if possible, if you are able to test it on development server) and let me know.

Jan