turbo1: have you considered submitting your script to be included as part of magento core?
streamlined and integrated into core, all credits to yours truly?
ditto with your other contributions..
much respect again for getting this commissioned. i’m finding i’m on the bleeding edge of required functionality in the sense that functionality in magento is being developed just as i require it!
I haven’t thought much about submitting it I didn’t author the script, so all credit should really go to Anda.
And yes, it probably does not work with special price rules or grouped products. It was written specifically for my (very basic) store. I have only simple products and no special pricing anywhere. But everyone is free to modify the script to be more robust!
I am not sure why, but I just realized that after I made that change, my prices became a mess, very strange.
It looks like special prices are fine.
the code now looks like this (I believe I made correct changes):
$product_data = array();
Thanks for any help.
P.S. I changed code back as it was before, and now prices are correct, but sure I miss a special prices.
I don’t know why function getSpecialPrice() doesn’t give correct result or something wrong with the code…
Yes, it looks pretty much same as mine, except I added couple more fields, but they are fine and not related to prices anyhow.
Now I added pull out special price as separate column in a file and got two columns: price and special. The thing is that function special gave me “special” even it is was not used. It gave me values which looks like prices, something like 6.99 or 19.99 for example. Looks like from not cleared memory or something, I do not know.
I do not know how function works, but you check that function as a Boolean, which is probably not right. :(
P.S. Some update:
I noticed that function getSpecial return the last special price for the product when it called like that. So, if all products have special prices, it will give you correct result. Otherwise it will return the last result which is more than zero.
I checked the file I got and what I noticed: (I added second column, special, just to check what function returns):
all product specials were zero until first product in a list which has special price. Then, function returned same special price as for first product for all next products until next product which has other special price. And so on. So, all products in between, got special prices of previous product… I do not know how function can be “reset ted” after every call.
exists or not. If it does, that means it has a special price, and it uses the special. if it doesn’t, it uses the regular price. Isn’t this the functionality you want?…
Sure, this is functionality I want.
The thing is: your code is good, function getSpecialPrice() itself is not really. But I guess in the next version of Magento it will be corrected.
I posted about it here:
sorry, I’m not following.
What I was saying is that function itself was not given correct value, it has nothing to do with your code. Your code was and is correct, as I know (I’m not a php programmer, though).
I can not see a difference between code you just posted and code before.