View Issue Details

IDProjectCategoryView StatusLast Update
0002435OXID eShop (all versions)4.05. Performancepublic2012-12-10 13:29
Reportertjungcl Assigned To 
Status resolvedResolutionfixed 
Product Version4.4.7 revision 33396 
Fixed in Version4.5.2 revision 38481 
Summary0002435: Rangeprice calculation unneccessary costy, especially annoying in admin
Description(Also in all earlier versions of oxid).

The function
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
Additional Informationminor 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;

            $dMinPrice = min($aPrices);
            $dMaxPrice = max($aPrices);
PHP Versionany
Database Versionany


related to 0002388 resolvedLinas Kukulskis bad performance and even crashes when loading long variant-list in admin 



2011-01-24 14:04

reporter   ~0004010

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.

Linas Kukulskis

2011-08-02 15:42

reporter   ~0004913

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)