protected function actionListPriceRule()
    {
        list($selected, $action, $value) = $this->getPostedAction();

        $deleted = $updated = 0;

        foreach ($selected as $rule_id) {

            if ($action === 'status' && $this->access('price_rule_edit')) {
                $updated += (int) $this->price_rule->update($rule_id, array('status' => $value));
            }

            if ($action === 'delete' && $this->access('price_rule_delete')) {
                $deleted += (int) $this->price_rule->delete($rule_id);
            }
        }

        if ($updated > 0) {
            $message = $this->text('Updated %num item(s)', array('%num' => $updated));
            $this->setMessage($message, 'success');
        }

        if ($deleted > 0) {
            $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($message, 'success');
        }
    }
protected function actionListPriceRule()
    {
        list($selected, $action, $value) = $this->getPostedAction();

        $deleted = $updated = 0;

        foreach ($selected as $rule_id) {

            if ($action === 'status' && $this->access('price_rule_edit')) {
                $updated += (int) $this->price_rule->update($rule_id, array('status' => $value));
            }

            if ($action === 'delete' && $this->access('price_rule_delete')) {
                $deleted += (int) $this->price_rule->delete($rule_id);
            }
        }

        if ($updated > 0) {
            $message = $this->text('Updated %num item(s)', array('%num' => $updated));
            $this->setMessage($message, 'success');
        }

        if ($deleted > 0) {
            $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($message, 'success');
        }
    }
protected function actionListPriceRule ( ) { list ( $ selected , $ action , $ value ) = $ this -> getPostedAction ( ) ; $ deleted = $ updated = 0 ; foreach ( $ selected as $ rule_id ) { if ( $ action === 'status' && $ this -> access ( 'price_rule_edit' ) ) { $ updated += ( int ) $ this -> price_rule -> update ( $ rule_id , array ( 'status' => $ value ) ) ; } if ( $ action === 'delete' && $ this -> access ( 'price_rule_delete' ) ) { $ deleted += ( int ) $ this -> price_rule -> delete ( $ rule_id ) ; } } if ( $ updated > 0 ) { $ message = $ this -> text ( 'Updated %num item(s)' , array ( '%num' => $ updated ) ) ; $ this -> setMessage ( $ message , 'success' ) ; } if ( $ deleted > 0 ) { $ message = $ this -> text ( 'Deleted %num item(s)' , array ( '%num' => $ deleted ) ) ; $ this -> setMessage ( $ message , 'success' ) ; } }
Applies an action to the selected price rules
Applies an action to the selected price rules