field($model, 'name')->textInput(['maxlength' => true]) ?> field($model, 'brand_id')->dropDownList( ArrayHelper::map(ProductHelper::getBrands()->all(), 'brand_id', 'name'), [ 'prompt' => Yii::t('product', 'Select brand') ] ) ?> field($model, 'categories')->dropDownList( ArtboxTreeHelper::treeMap(ProductHelper::getCategories(), 'category_id', 'name'), [ // 'prompt' => Yii::t('product', 'Select category'), 'multiple' => true ] ) ?> field($model, 'images[]')->widget(FileInput::classname(), [ 'options' => [ 'accept' => 'image/*', 'multiple' => true, ], 'pluginOptions' => [ // 'uploadUrl' => \yii\helpers\Url::to(['/site/file-upload']), ] ]); */?> field($model, 'variants')->widget(MultipleInput::className(), [ 'columns' => [ [ 'name' => 'product_variant_id', 'type' => MultipleInputColumn::TYPE_HIDDEN_INPUT, ], [ 'name' => 'name', 'type' => MultipleInputColumn::TYPE_TEXT_INPUT, 'title' => 'Name', ], [ 'name' => 'sku', 'type' => MultipleInputColumn::TYPE_TEXT_INPUT, 'title' => 'SKU', ], [ 'name' => 'price', 'type' => MultipleInputColumn::TYPE_TEXT_INPUT, 'title' => 'Price', ], [ 'name' => 'price_old', 'type' => MultipleInputColumn::TYPE_TEXT_INPUT, 'title' => 'Old Price', ], [ 'name' => 'product_unit_id', 'type' => MultipleInputColumn::TYPE_DROPDOWN, 'title' => 'Unit', 'items' => ArrayHelper::map(\common\modules\product\models\ProductUnit::find()->all(), 'product_unit_id', 'name'), ], [ 'name' => 'stock', 'type' => MultipleInputColumn::TYPE_TEXT_INPUT, 'title' => 'Stock', 'options' => [ 'placeholder' => '∞' ], ], ], ]); ?>
isNewRecord ? Yii::t('product', 'Create') : Yii::t('product', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>