Price original =< price

Phoca Cart - complex e-commerce extension
vlna
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 29 Nov 2015, 23:25

Price original =< price

Post by vlna »

This modification disables displaying price if price original =< price - it is not wise o show customer we increased price. Displying identical original price looks strange.

components/com_phocacart/layouts/product_price.php

Code: Select all

<div class="<?php echo $d['class']; ?>">
<?php if ($d['priceitemsorig']['brutto'] > $d['priceitems']['brutto']) {
  if (isset($d['priceitemsorig']['bruttoformat']) && $d['priceitemsorig']['bruttoformat']) { ?>
    <div class="ph-price-txt"><?php echo JText::_('COM_PHOCACART_ORIGINAL_PRICE') ?></div>
    <div class="ph-price-original"><?php echo $d['priceitemsorig']['bruttoformat'] ?></div>
<?php } } ?>^M
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Price original =< price

Post by Jan »

Hi, sorry, but I don't understand? Original price is only set when it is different to valid price (of course, as marketing tool, mostly only when the original price is higher than the valid price)

Not sure, if such feature should be checked or not - as you can find hundreds of places where to add the if condition - to protect against logical errors.

But as we are not checking e.g. if the price is to low, etc. not sure, if we should check if somebody add the same original price as valid price :idea:

I know, it can be nonsense but what happen, if there will be somebody who wants to display lower original price to valid price. As we cannot limit standard price (we cannot decide if some price for good will be not logical and will be too low, so we cannot decide if somebody wants to display the same or lower original price every it does not make any sense) :idea:

This is really something what I cannot decide:

- should I do new if condition and make the code more difficult (you can find a lot of similar places in code)
- and should I limit possible option.

Why I am writing it here. I happened often when creating extensions, that I have added protection against logical errors users can do but if you will search this forum (e.g. Phoca Guestbook), you can see that I have spent so much time to explain why I have limited some feature, etc. :idea: :idea:

As I understand fully what you mean and I fully understand the logic of this change, really hard to decide if this should be implemented or no. :idea: :idea:

Jan
If you find Phoca extensions useful, please support the project
Post Reply