View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004210||OXID eShop (all versions)||1.02. Price calculations (discounts, coupons, additional costs etc.)||public||2012-06-29 16:00||2012-12-07 15:20|
|Product Version||4.6.2 revision 46646|
|Target Version||Fixed in Version||4.6.6 revision 54646|
|Summary||0004210: oxArticle::getPrice( $iAmount ) doesn't calculate scale prices after the method oxArticle::loadAmountPriceInfo() is called|
|Description||oxArticle::getPrice( $iAmount ) doesn't calculate scale prices after the method oxArticle::loadAmountPriceInfo() is called.|
The problem is in the oxArticle::loadAmountPriceInfo() (and deeper), after it's called it reformats the prices in all the oxPrice fields of the price list.
Before calling the oxArticle::loadAmountPriceInfo() method you have "200.2" in the price value of oxPrice, after calling you have "100,20".
In oxArticle::getPrice( $iAmount ) the original product price is compared to the scale price goes something like : 150.2 < 100,20 (because it treats the scale price as a string)
This shouldn't work like this, because lets say i want to get the list of scale prices to print, then do a calculation with the same object.
|Steps To Reproduce||1) Create a product with scale prices|
2) Write a script that loads the product to the oxArticle object
3) Call method oxArticle::loadAmountPriceInfo()
4) Call method oxArticle::getPrice ( $iAmount ) and pass a value that would normaly change the price
5) The price inside the returned oxPrice object is still the original, when it should've been one from the scale price configuration