View Issue Details

IDProjectCategoryView StatusLast Update
0001655OXID eShop (all versions)1.02. Price calculations (discounts, coupons, additional costs etc.)public2012-12-07 15:20
Reporteraggrosoft Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionsuspended 
Product Version4.2.0 revision 23610 
Summary0001655: Calling oxArticle::loadAmountPrice befor oxArticle::getBasketPrice leads to price = 0
DescriptionFollowing test code:

    public function getProduct($loadVariants=true)
    {
        $myConfig = oxConfig::getInstance();
        $myUtils = oxUtils::getInstance();

        if ( $this->_oProduct === null ) {

            //this option is only for lists and we must reset value
            //as blLoadVariants = false affect "ab price" functionality
            $myConfig->setConfigParam( 'blLoadVariants', $loadVariants );
            $myConfig->setConfigParam( 'blPerfLoadPrice', true );

            $sOxid = oxConfig::getParameter( 'anid' );

            // object is not yet loaded
            $this->_oProduct = oxNew( 'oxarticle' );
            $this->_oProduct->load( $sOxid );
        }

        return $this->_oProduct;
    }

$oProduct = $this->getProduct(); //$oProduct is a multi variant article with amount prices

//I just cut out the fetching of the select lists (POST), the basket (SESSION) and the quantity (POST)
$oPrice = $oProduct->getBasketPrice($qty,$lists,$oBasket);
//This value is correct
print_r($oPrice);
$oProduct->loadAmountPriceInfo();
$oPrice = $oProduct->getBasketPrice($qty,$lists,$oBasket);
//This value is wrong
print_r($oPrice);
Additional InformationIch bin mir nicht sicher ob sich dieser Fehler einfach so reproduzieren lässt, ich könnte auch einen umfangreicheren use case bereitstellen.
TagsScale Price
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Relationships

related to 0003092 resolvedarvydas_vapsva article: "not isBuyable()" does not equal "isNotBuyable()" 

Activities

aggrosoft

2010-03-03 16:25

reporter   ~0002377

Translation:

Following test code:

    public function getProduct($loadVariants=true)
    {
        $myConfig = oxConfig::getInstance();
        $myUtils = oxUtils::getInstance();

        if ( $this->_oProduct === null ) {

            //this option is only for lists and we must reset value
            //as blLoadVariants = false affect "ab price" functionality
            $myConfig->setConfigParam( 'blLoadVariants', $loadVariants );
            $myConfig->setConfigParam( 'blPerfLoadPrice', true );

            $sOxid = oxConfig::getParameter( 'anid' );

            // object is not yet loaded
            $this->_oProduct = oxNew( 'oxarticle' );
            $this->_oProduct->load( $sOxid );
        }

        return $this->_oProduct;
    }

$oProduct = $this->getProduct(); //$oProduct is a multi variant article with amount prices

//I just cut out the fetching of the select lists (POST), the basket (SESSION) and the quantity (POST)
$oPrice = $oProduct->getBasketPrice($qty,$lists,$oBasket);
//This value is correct
print_r($oPrice);
$oProduct->loadAmountPriceInfo();
$oPrice = $oProduct->getBasketPrice($qty,$lists,$oBasket);
//This value is wrong
print_r($oPrice);

aggrosoft

2010-03-03 16:26

reporter   ~0002378

Translation of additional info:

I'm not sure if this error is so easy to reproduce, if needed I could also supply a more detailed use case.

sarunas_valaskevicius

2010-05-20 12:08

reporter   ~0002972

Reminder sent to: aggrosoft

Hi,

I could not reproduce this bug, please could you provide the more detailed use case?

Regards,

dainius.bigelis

2011-11-05 14:21

reporter   ~0005366

Currently we cannot solve the problems like this, because it needs quite large refactoring in core classes. We added a note to our plans to keep this in mind, when we will go to refactor oxarticle class, but for now this issue is Suspended, and must be considered during refactoring.

Thanks for your feedback.