Bug on ItemPrice

Phoca Cart - complex e-commerce extension
lecoq.fr
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 13 Apr 2021, 17:27

Bug on ItemPrice

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Bug on ItemPrice

Post 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
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Bug on ItemPrice

Post 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
If you find Phoca extensions useful, please support the project
lecoq.fr
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 13 Apr 2021, 17:27

Re: Bug on ItemPrice

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Bug on ItemPrice

Post 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
If you find Phoca extensions useful, please support the project
Post Reply