$sectionID = $sectionRuleValue->attribute('value');
         $section = eZSection::fetch($sectionID);
         if ($section) {
             if (!$firstLoop) {
                 $limitation .= ', ';
             } else {
                 $firstLoop = false;
             }
             $sectionName = $section->attribute('name');
             $limitation .= "'" . $sectionName . "'";
         }
     }
 } else {
     $limitation .= ' ' . ezpI18n::tr('kernel/shop', 'in any section');
 }
 $productRuleValues = eZDiscountSubRuleValue::fetchBySubRuleID($discountRuleID, 2);
 if ($productRuleValues != null) {
     $limitation = ezpI18n::tr('kernel/shop', 'Products') . ' ';
     $firstLoop = true;
     foreach ($productRuleValues as $productRuleValue) {
         $objectID = $productRuleValue->attribute('value');
         $product = eZContentObject::fetch($objectID);
         if ($product) {
             if (!$firstLoop) {
                 $limitation .= ', ';
             } else {
                 $firstLoop = false;
             }
             $productName = $product->attribute('name');
             $limitation .= "'" . $productName . "'";
         }
        {
            $discountRuleSelectedClasses[] = -1;
        }

        $discountRuleSelectedSections = array();
        $discountRuleSelectedSectionsValues = eZDiscountSubRuleValue::fetchBySubRuleID( $discountRuleID, 1, false );
        foreach( $discountRuleSelectedSectionsValues as $value )
        {
            $discountRuleSelectedSections[] = $value['value'];
        }
        if ( count( $discountRuleSelectedSections ) == 0 )
        {
            $discountRuleSelectedSections[] = -1;
        }

        $discountRuleSelectedProductsValues = eZDiscountSubRuleValue::fetchBySubRuleID( $discountRuleID, 2, false );
        foreach( $discountRuleSelectedProductsValues as $value )
        {
            $discountRuleSelectedProducts[] = $value['value'];
        }
    }
    else
    {
        // does not exist => create new one, but do not store...
        $discountRuleName = ezpI18n::tr( 'design/admin/shop/discountruleedit', 'New discount rule' );
        $discountRulePercent = 0.0;
        $discountRuleSelectedClasses = array( -1 );
        $discountRuleSelectedSections = array( -1 );
        $discountRuleSelectedProducts = array();

        $discountRule = array( 'id' => 0,