View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005070||OXID eShop (all versions)||1.02. Price calculations (discounts, coupons, additional costs etc.)||public||2013-04-15 15:53||2014-03-04 11:29|
|Status||resolved||Resolution||no change required|
|Product Version||4.7.4 / 5.0.4 revision 57063|
|Target Version||Fixed in Version|
|Summary||0005070: Amount is ignored in oxArticle::getPrice() (and methods called from there)|
|Description||If you use oxArticle::getPrice($dAmount = 1) with $dAmount > 1, then this value will be ignored, it will always return the same as getPrice(1).|
Unfortunately this bug cannot be fixed easily (e.g. by using $dPrice * $dAmount in getBasePrice()), because this bug is worked around in other place, e.g. while putting articles into the basket.
One such workaround is in "oxBasketItem::setPrice", where the given price (although coming from getBasePrice(N) with N > 1 (via getBasketPrice)) is multiplied with N once more.
There are probably more (e.g. in discount calculation code paths).
|Steps To Reproduce||Use both|
in a module or a template (with $article being an oxArticle object).
|Additional Information||Please add an unit test, testing oxArticles::getPrice(N) with N > 1.|
|Tags||No tags attached.|
Reminder sent to: gpayer
getPrice() gets base article price, and if amount parameter is set, it looks for a possible price reduction, which can be added in admin settings(Administer Products->Products->Stock) with Scale Prices. Amount from and to defines range, and getPrice( amount ) that fits into one of these ranges will return modified unit price. So, in essence getPrice doesn't return total price in this case.