View Issue Details

IDProjectCategoryView StatusLast Update
0001652OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2012-12-07 14:10
Reporterhighdev Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version4.2.0 revision 23610 
Summary0001652: variant abc prices are not shown in article list
DescriptionIf you assign abc prices to a variable, these prices will be shown in article details but not on the article list (category view). There is still the "normal" price.
TagsAttributes
Theme
BrowserAll
PHP Versionany
Database Versionany

Relationships

duplicate of 0001723 resolvedarvydas_vapsva special variant prices for usergroups not shown in article list 

Activities

highdev

2010-02-10 19:22

reporter   ~0002351

Last edited: 2010-02-10 22:59

should be read as: If you assign abc prices to a VARIANT ...


possible fix:

oxsimplevariant

    /**
     * Implementing (faking) performance friendly method from oxArticle
     *
     * @return oxPrice
     */
    public function getPrice()
    {
        if (!is_null($this->_oPrice)) {
            return $this->_oPrice;
        }

        $oUser = $this->getUser();
        
        $this->_oPrice = oxNew("oxPrice");
        
        if ($oUser) {
            if ( $oUser->inGroup( 'oxidpricea' ) ) {
                $dPrice = $this->oxarticles__oxpricea->value;
            } else if ( $oUser->inGroup( 'oxidpriceb' ) ) {
                $dPrice = $this->oxarticles__oxpriceb->value;
            } else if ( $oUser->inGroup( 'oxidpricec' ) ) {
                $dPrice = $this->oxarticles__oxpricec->value;
            } else {
            $dPrice = $this->oxarticles__oxprice->value;
            }
        } else {
            $dPrice = $this->oxarticles__oxprice->value;
        }
        
        if (!$dPrice) {
            $dPrice = $this->_getParentPrice();
        }

        $this->_oPrice->setPrice($dPrice, $this->_dVat);

        $this->_applyParentVat($this->_oPrice);
        $this->_applyCurrency($this->_oPrice);
        // apply discounts
        $this->_applyParentDiscounts($this->_oPrice);

        return $this->_oPrice;
    }
    
    /**
     * Returns parent price. Assuming variant parent has been assigned before function execution.
     *
     * @return double
     */
    protected function _getParentPrice()
    {
        $oUser = $this->getUser();
        
        if ($oUser) {
            if ( $oUser->inGroup( 'oxidpricea' ) ) {
                $price = $this->_oParent->oxarticles__oxpricea->value;
            } else if ( $oUser->inGroup( 'oxidpriceb' ) ) {
                $price = $this->_oParent->oxarticles__oxpriceb->value;
            } else if ( $oUser->inGroup( 'oxidpricec' ) ) {
                $price = $this->_oParent->oxarticles__oxpricec->value;
            } else {
                $price = $this->_oParent->oxarticles__oxprice->value;
            }
        } else {
            $price = $this->_oParent->oxarticles__oxprice->value;
        }

        if (!$price && $this->getConfig()->getConfigParam( 'blOverrideZeroABCPrices' )) {
            $price = $this->oxarticles__oxprice->value;
        }
        if (!$price && $this->getConfig()->getConfigParam( 'blOverrideZeroABCPrices' )) {
            $price = $this->_oParent->oxarticles__oxprice->value;
        }

        return $price;
    }

sarunas_valaskevicius

2010-05-20 14:53

reporter   ~0002975

I did reproduce it in 4.2.0, but not in the current eShop trunk