Skip to content

Special Price not displayed if higher than lowest price #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Sorcy opened this issue Oct 4, 2010 · 5 comments
Open

Special Price not displayed if higher than lowest price #6

Sorcy opened this issue Oct 4, 2010 · 5 comments

Comments

@Sorcy
Copy link

Sorcy commented Oct 4, 2010

I'm not sure if this really is an issue or an intended feature, however:

If my configurable product is comprised of several simple products and one simple products normal price is lower (say 20$) than the special price of another simple product (say, 21$), the second price is not displayed as a special price but as a normal price.

@toasty
Copy link
Collaborator

toasty commented Oct 4, 2010

Yeah that's intended behaviour. Well. In most cases. It depends where you mean exactly. Let me elaborate :)

To work out which associated product prices to show when the pages load (i.e. the 'price from' price) SCP does:

  1. Find the product with the lowest price (either special or normal, whichever's lowest) from the associated products
  2. Show normal price for that product
  3. Show special price for that product, if lower than its normal price.

It purposefully doesn't do:

  1. Find lowest normal price from the associated products and show it
    then independently
  2. Find lowest special price from the associated products and show it
    Because then as you say you can have an offer price higher than the normal price and things like that.

I don't think it would be terrible whichever way it works, but I went with what made most sense to me. I think this bit is ok.

However there's still a bug on product pages as mentioned in the readme here: http://github.com/organicinternet/magento-configurable-simple/ which is:

Open Bugs
* If an associated product has a special price, but another product associated to the same configurable product is cheaper yet doesn't have a special price, then on the product page the 'special price' html will not be displayed when the associated product with the special price is chosen.

I've not gotten round to fixing that yet.

It's because the 'price from' price (determined using the logic above) finds the associated product with the cheapest price, but this product doesn't have a special price so 'Special Price: blah' or whatever isn't displayed. That's fine. The bug is that on the Product page, when you pick your attributes such that a different associated product is matched, and that product does have a special price, SCP doesn't add the 'Special Price: blah' html. At the moment it can only show it if it was there when the page loaded, that is, if the original lowest priced 'price from' product had a special price too. Quite a silly bug really.

Matt

@Sorcy
Copy link
Author

Sorcy commented Oct 5, 2010

Ah, yeah, that is in fact what I was talking about, sorry for not being specific enough.

@Sorcy
Copy link
Author

Sorcy commented Oct 7, 2010

Just FYI: I solved this problem in a very roundabout way buy writing a javascript that checks if there is a span that could contain the special-price. If there is not it basically rewrites the complete price-box with the version where special-price and old price are included and from there on out it works beautifully.

Surely not the most sophisticated solution, but as a part time cludge it works just fine.

@toasty
Copy link
Collaborator

toasty commented Oct 7, 2010

Cheers for letting me know. I think i'll have to do something similar, or force the special-price span to always be rendered by the php. I doubt it'll be anything very elegant either way :)

Did you have to do anything tricky to get it to work well? If so do you mind sharing the code?

@zuiko
Copy link

zuiko commented Mar 7, 2012

Hi,
I don't really know if I face to the same issue:

  • My Magento is 1.4.1.0
  • I tried SCP 0.74 and 0.82

I have a configurable product which simples have each the same price and the same special price.
In the product list (grid), no problem for this product, the price and the special price are both displayed.
In the product page only the special price is displayed but without the words "Special Price:"

To find the issue I put some traces on app/design/frontend/default/default/template/catalog/product/price.phtml
and I found that for the product (alone) page the test
if ($_finalPrice == $_price)
is wrongly OK

I found also that in \app\code\community\OrganicInternet\SimpleConfigurableProducts\Catalog\Model\Product\Type\Configurable\Price.php
the public function getPrice($product) does not give the same result in the 2 cases.
When it works (in product list or grid)
$price = $product->getIndexedPrice();
gives a not null result and this result is used.
When it does not work (in the product page) the same instruction gives a null result thus the rest of the function is used
and gives a wrong result where $_finalPrice == $_price in the phtml

If someone has an idea to fix this I would be very glad ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants