View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002435 | OXID eShop (all versions) | 4.05. Performance | public | 2011-01-24 12:35 | 2012-12-10 13:29 |
Reporter | tjungcl | Assigned To | |||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.4.7 revision 33396 | ||||
Fixed in Version | 4.5.2 revision 38481 | ||||
Summary | 0002435: Rangeprice calculation unneccessary costy, especially annoying in admin | ||||
Description | (Also in all earlier versions of oxid). The function _applyRangePrice is called for every article in any article-list. Even if loadVariants is OFF, this function loads all variants, loads the prices for the variants, calculates the minimum and maximum price. When all that is done, it checks, if loadVariants is OFF and if so, it throws away all the variant-loading-results and loads the min-price from oxvarminprice. --> The blLoadVariants check should absolutly be moved above the loading of all variants. Plus you should consider to store the "isRangePrice" information in the oxarticle-table. It would be calculated and updated in the _onChangeUpdateMinVarPrice function - this would also spare a lot of variant-loading. Also see https://bugs.oxid-esales.com/view.php?id=2388 | ||||
Additional Information | minor issue: calculating the min and max of arrayvalues can be done by using phps native functions min and max. So, you can replace the loop $dMinPrice = $aPrices[0]; $dMaxPrice = $aPrices[0]; foreach ($aPrices as $dPrice) { if ($dMinPrice > $dPrice) { $dMinPrice = $dPrice; } if ($dMaxPrice < $dPrice) { $dMaxPrice = $dPrice; } } with $dMinPrice = min($aPrices); $dMaxPrice = max($aPrices); | ||||
Tags | Performance | ||||
Theme | |||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
related to | 0002388 | resolved | Linas Kukulskis | bad performance and even crashes when loading long variant-list in admin |
|
the function getVariants checks if loadVariants is true (else it doesnt load variants), but only when isAdmin is false - so if in admin, the rangeprice-calculation indeed loads all variants vor all articles in list. |
|
1. uzed min max functions 2. The blLoadVariants check moved above the loading of all variants. 3. added skip, from now calculates range price only for parent articles (for variants its skips) |