View Issue Details

IDProjectCategoryView StatusLast Update
0005641OXID eShop (all versions)1.02. Price calculations (discounts, coupons, additional costs etc.)public2014-03-04 11:25
Reporteredip123 Assigned To 
PriorityimmediateSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.7.10 / 5.0.10 
Target Version4.7.11 / 5.0.11Fixed in Version4.7.11 / 5.0.11 
Summary0005641: Fatal Error after activating oxskipdiscounts
DescriptionIf the option oxskipdiscounts ("Alle neg. Nachlässe ignorieren.") is activated for an article, you get a Fatal Error on the details page of this article.
Can be reproduced in demo shop.
Steps To ReproduceChoose an article in the backend and activate oxskipdiscounts ("Alle neg. Nachlässe ignorieren.").
In the frontend call the details page for this article.
Additional InformationThe function _getAmountPriceList() in oxarticle returns an Array if oxskipdiscounts is activated, but in loadAmountPriceInfo() the result is accessed as an object.
TagsDiscount, Products
Attached Files
ThemeBoth
BrowserAll
PHP Version5.3
Database Versionany

Activities

edip123

2014-02-06 10:56

reporter   ~0009474

This function works correctly:

    protected function _getAmountPriceList()
    {
        if ( $this->_oAmountPriceList === null ) {
            $oAmPriceList = oxNew( 'oxAmountPricelist' );
            if ( !$this->skipDiscounts() ) {

                //collecting assigned to article amount-price list
                $oAmPriceList->load( $this );

                // prepare abs prices if currently having percentages
                $oBasePrice = $this->_getGroupPrice();
                foreach ( $oAmPriceList as $oAmPrice ) {
                    if ( $oAmPrice->oxprice2article__oxaddperc->value ) {
                        $oAmPrice->oxprice2article__oxaddabs = new oxField(oxPrice::percent( $oBasePrice, 100 - $oAmPrice->oxprice2article__oxaddperc->value ), oxField::T_RAW );
                    }
                }

            }
            $this->_oAmountPriceList = $oAmPriceList;
        }

        return $this->_oAmountPriceList;
    }

edip123

2014-02-06 11:03

reporter   ~0009475

I've added a module to override the function.

saulius.stasiukaitis

2014-02-07 14:16

reporter   ~0009482

Fixed as suggested.