protected function wizardAddProduct()
    {
        // Required
        $this->validatePrompt('title', $this->text('Title'), 'product');

        // Optional
        $this->validatePrompt('description', $this->text('Description'), 'product');
        $this->validatePrompt('store_id', $this->text('Store ID'), 'product', 0);
        $this->validatePrompt('sku', $this->text('SKU'), 'product', '');
        $this->validatePrompt('stock', $this->text('Stock'), 'product', 0);
        $this->validatePrompt('price', $this->text('Price'), 'product', 0);
        $this->validatePrompt('currency', $this->text('Currency code'), 'product', $this->currency->getDefault());
        $this->validatePrompt('product_class_id', $this->text('Product class ID'), 'product', 0);
        $this->validatePrompt('user_id', $this->text('User ID'), 'product', 0);
        $this->validatePrompt('meta_title', $this->text('Meta title'), 'product', '');
        $this->validatePrompt('meta_description', $this->text('Meta description'), 'product', '');
        $this->validatePrompt('category_id', $this->text('Category ID'), 'product', 0);
        $this->validatePrompt('brand_category_id', $this->text('Brand category ID'), 'product', 0);

        $size_units = $this->product->getSizeUnits();
        $this->validateMenu('size_unit', $this->text('Size unit'), 'product', $size_units, key($size_units));

        $this->validatePrompt('length', $this->text('Length'), 'product', 0);
        $this->validatePrompt('width', $this->text('Width'), 'product', 0);
        $this->validatePrompt('height', $this->text('Height'), 'product', 0);

        $weight_units = $this->product->getWeightUnits();
        $this->validateMenu('weight_unit', $this->text('Weight unit'), 'product', $weight_units, key($weight_units));
        $this->validatePrompt('weight', $this->text('Weight'), 'product', 0);

        $this->validatePrompt('subtract', $this->text('Subtract'), 'page', 0);
        $this->validatePrompt('status', $this->text('Status'), 'page', 0);

        $this->setSubmitted('form', true); // Internal flag. Specifies that the product submitted manually
        $this->validateComponent('product');
        $this->addProduct();
    }
protected function wizardAddProduct()
    {
        // Required
        $this->validatePrompt('title', $this->text('Title'), 'product');

        // Optional
        $this->validatePrompt('description', $this->text('Description'), 'product');
        $this->validatePrompt('store_id', $this->text('Store ID'), 'product', 0);
        $this->validatePrompt('sku', $this->text('SKU'), 'product', '');
        $this->validatePrompt('stock', $this->text('Stock'), 'product', 0);
        $this->validatePrompt('price', $this->text('Price'), 'product', 0);
        $this->validatePrompt('currency', $this->text('Currency code'), 'product', $this->currency->getDefault());
        $this->validatePrompt('product_class_id', $this->text('Product class ID'), 'product', 0);
        $this->validatePrompt('user_id', $this->text('User ID'), 'product', 0);
        $this->validatePrompt('meta_title', $this->text('Meta title'), 'product', '');
        $this->validatePrompt('meta_description', $this->text('Meta description'), 'product', '');
        $this->validatePrompt('category_id', $this->text('Category ID'), 'product', 0);
        $this->validatePrompt('brand_category_id', $this->text('Brand category ID'), 'product', 0);

        $size_units = $this->product->getSizeUnits();
        $this->validateMenu('size_unit', $this->text('Size unit'), 'product', $size_units, key($size_units));

        $this->validatePrompt('length', $this->text('Length'), 'product', 0);
        $this->validatePrompt('width', $this->text('Width'), 'product', 0);
        $this->validatePrompt('height', $this->text('Height'), 'product', 0);

        $weight_units = $this->product->getWeightUnits();
        $this->validateMenu('weight_unit', $this->text('Weight unit'), 'product', $weight_units, key($weight_units));
        $this->validatePrompt('weight', $this->text('Weight'), 'product', 0);

        $this->validatePrompt('subtract', $this->text('Subtract'), 'page', 0);
        $this->validatePrompt('status', $this->text('Status'), 'page', 0);

        $this->setSubmitted('form', true); // Internal flag. Specifies that the product submitted manually
        $this->validateComponent('product');
        $this->addProduct();
    }
protected function wizardAddProduct ( ) { // Required $ this -> validatePrompt ( 'title' , $ this -> text ( 'Title' ) , 'product' ) ; // Optional $ this -> validatePrompt ( 'description' , $ this -> text ( 'Description' ) , 'product' ) ; $ this -> validatePrompt ( 'store_id' , $ this -> text ( 'Store ID' ) , 'product' , 0 ) ; $ this -> validatePrompt ( 'sku' , $ this -> text ( 'SKU' ) , 'product' , '' ) ; $ this -> validatePrompt ( 'stock' , $ this -> text ( 'Stock' ) , 'product' , 0 ) ; $ this -> validatePrompt ( 'price' , $ this -> text ( 'Price' ) , 'product' , 0 ) ; $ this -> validatePrompt ( 'currency' , $ this -> text ( 'Currency code' ) , 'product' , $ this -> currency -> getDefault ( ) ) ; $ this -> validatePrompt ( 'product_class_id' , $ this -> text ( 'Product class ID' ) , 'product' , 0 ) ; $ this -> validatePrompt ( 'user_id' , $ this -> text ( 'User ID' ) , 'product' , 0 ) ; $ this -> validatePrompt ( 'meta_title' , $ this -> text ( 'Meta title' ) , 'product' , '' ) ; $ this -> validatePrompt ( 'meta_description' , $ this -> text ( 'Meta description' ) , 'product' , '' ) ; $ this -> validatePrompt ( 'category_id' , $ this -> text ( 'Category ID' ) , 'product' , 0 ) ; $ this -> validatePrompt ( 'brand_category_id' , $ this -> text ( 'Brand category ID' ) , 'product' , 0 ) ; $ size_units = $ this -> product -> getSizeUnits ( ) ; $ this -> validateMenu ( 'size_unit' , $ this -> text ( 'Size unit' ) , 'product' , $ size_units , key ( $ size_units ) ) ; $ this -> validatePrompt ( 'length' , $ this -> text ( 'Length' ) , 'product' , 0 ) ; $ this -> validatePrompt ( 'width' , $ this -> text ( 'Width' ) , 'product' , 0 ) ; $ this -> validatePrompt ( 'height' , $ this -> text ( 'Height' ) , 'product' , 0 ) ; $ weight_units = $ this -> product -> getWeightUnits ( ) ; $ this -> validateMenu ( 'weight_unit' , $ this -> text ( 'Weight unit' ) , 'product' , $ weight_units , key ( $ weight_units ) ) ; $ this -> validatePrompt ( 'weight' , $ this -> text ( 'Weight' ) , 'product' , 0 ) ; $ this -> validatePrompt ( 'subtract' , $ this -> text ( 'Subtract' ) , 'page' , 0 ) ; $ this -> validatePrompt ( 'status' , $ this -> text ( 'Status' ) , 'page' , 0 ) ; $ this -> setSubmitted ( 'form' , true ) ; // Internal flag. Specifies that the product submitted manually $ this -> validateComponent ( 'product' ) ; $ this -> addProduct ( ) ; }
Add a new product step by step
Add a new product step by step