protected function addOptions(array $data)
    {
        if (empty($data['combination'])) {
            return false;
        }

        foreach ($data['combination'] as $combination) {

            if (empty($combination['fields'])) {
                continue;
            }

            foreach ($combination['fields'] as $field_id => $field_value_id) {

                $options = array(
                    'type' => 'option',
                    'field_id' => $field_id,
                    'product_id' => $data['product_id'],
                    'field_value_id' => $field_value_id
                );

                $this->product_field->add($options);
            }
        }

        return true;
    }
protected function addOptions(array $data)
    {
        if (empty($data['combination'])) {
            return false;
        }

        foreach ($data['combination'] as $combination) {

            if (empty($combination['fields'])) {
                continue;
            }

            foreach ($combination['fields'] as $field_id => $field_value_id) {

                $options = array(
                    'type' => 'option',
                    'field_id' => $field_id,
                    'product_id' => $data['product_id'],
                    'field_value_id' => $field_value_id
                );

                $this->product_field->add($options);
            }
        }

        return true;
    }
protected function addOptions ( array $ data ) { if ( empty ( $ data [ 'combination' ] ) ) { return false ; } foreach ( $ data [ 'combination' ] as $ combination ) { if ( empty ( $ combination [ 'fields' ] ) ) { continue ; } foreach ( $ combination [ 'fields' ] as $ field_id => $ field_value_id ) { $ options = array ( 'type' => 'option' , 'field_id' => $ field_id , 'product_id' => $ data [ 'product_id' ] , 'field_value_id' => $ field_value_id ) ; $ this -> product_field -> add ( $ options ) ; } } return true ; }
Adds multiple options
@param array $data
@return boolean
Adds multiple options