protected function wizardAddPriceRule()
    {
        $this->validatePrompt('name', $this->text('Name'), 'price_rule');
        $this->validatePrompt('trigger_id', $this->text('Trigger ID'), 'price_rule');

        $types = array();
        foreach ($this->price_rule->getTypes() as $id => $type) {
            $types[$id] = $type['title'];
        }

        $this->validateMenu('value_type', $this->text('Value type'), 'price_rule', $types, 'percent');
        $this->validatePrompt('value', $this->text('Value'), 'price_rule');
        $this->validatePrompt('currency', $this->text('Currency'), 'price_rule', $this->currency->getDefault());
        $this->validatePrompt('code', $this->text('Code'), 'price_rule', '');
        $this->validatePrompt('status', $this->text('Status'), 'price_rule', 0);
        $this->validatePrompt('weight', $this->text('Weight'), 'price_rule', 0);

        $this->validateComponent('price_rule');
        $this->addPriceRule();
    }
protected function wizardAddPriceRule()
    {
        $this->validatePrompt('name', $this->text('Name'), 'price_rule');
        $this->validatePrompt('trigger_id', $this->text('Trigger ID'), 'price_rule');

        $types = array();
        foreach ($this->price_rule->getTypes() as $id => $type) {
            $types[$id] = $type['title'];
        }

        $this->validateMenu('value_type', $this->text('Value type'), 'price_rule', $types, 'percent');
        $this->validatePrompt('value', $this->text('Value'), 'price_rule');
        $this->validatePrompt('currency', $this->text('Currency'), 'price_rule', $this->currency->getDefault());
        $this->validatePrompt('code', $this->text('Code'), 'price_rule', '');
        $this->validatePrompt('status', $this->text('Status'), 'price_rule', 0);
        $this->validatePrompt('weight', $this->text('Weight'), 'price_rule', 0);

        $this->validateComponent('price_rule');
        $this->addPriceRule();
    }
protected function wizardAddPriceRule ( ) { $ this -> validatePrompt ( 'name' , $ this -> text ( 'Name' ) , 'price_rule' ) ; $ this -> validatePrompt ( 'trigger_id' , $ this -> text ( 'Trigger ID' ) , 'price_rule' ) ; $ types = array ( ) ; foreach ( $ this -> price_rule -> getTypes ( ) as $ id => $ type ) { $ types [ $ id ] = $ type [ 'title' ] ; } $ this -> validateMenu ( 'value_type' , $ this -> text ( 'Value type' ) , 'price_rule' , $ types , 'percent' ) ; $ this -> validatePrompt ( 'value' , $ this -> text ( 'Value' ) , 'price_rule' ) ; $ this -> validatePrompt ( 'currency' , $ this -> text ( 'Currency' ) , 'price_rule' , $ this -> currency -> getDefault ( ) ) ; $ this -> validatePrompt ( 'code' , $ this -> text ( 'Code' ) , 'price_rule' , '' ) ; $ this -> validatePrompt ( 'status' , $ this -> text ( 'Status' ) , 'price_rule' , 0 ) ; $ this -> validatePrompt ( 'weight' , $ this -> text ( 'Weight' ) , 'price_rule' , 0 ) ; $ this -> validateComponent ( 'price_rule' ) ; $ this -> addPriceRule ( ) ; }
Add a new price rule step by step
Add a new price rule step by step