namespace App\Models;
use Cubist\Backpack\app\Magic\Models\CubistMagicModel;
-use Cubist\Util\ObjectUtil;
use Illuminate\Support\Str;
class Product extends CubistMagicModel
protected $table = 'catalog_products';
protected $_options = ['name' => 'product',
- 'singular'=>'produit',
+ 'singular' => 'produit',
'plural' => 'produits'];
public function setFields()
'label' => 'Nom du produit',
'type' => 'Text',
'column' => true,
- 'tab' => 'General']);
+ 'tab' => 'Informations génerales']);
$this->addField(['name' => 'reference',
'label' => 'SKU (référence)',
'column' => true,
'unique' => true,
'translatable' => false,
- 'tab' => 'General']);
+ 'tab' => 'Informations génerales']);
$this->addField(['name' => 'product_type',
'label' => 'Type de produit',
'type' => 'SelectFromModel',
'model' => 'App\Models\ProductType',
'column' => true,
- 'tab' => 'Specifications']);
+ 'tab' => 'Spécifications']);
$specifications = Specification::all();
$types = ProductType::all();
break;
}
}
+ foreach ($type->filters as $rel_specification) {
+ if ($spec->id == $rel_specification->id) {
+ $in[] = $type->id;
+ break;
+ }
+ }
+ $in = array_unique($in);
}
if (!count($in)) {
continue;
}
- $params = ['tab' => 'Specifications',
+ $params = ['tab' => 'Spécifications',
'name' => 's_' . Str::snake($spec->name),
'label' => $spec->name,
'fake' => true,
$this->addField(['name' => 'slug',
- 'type' => 'Slug (URL)',
- 'label' => 'Slug',
+ 'type' => 'Slug',
+ 'label' => 'Slug (URL)',
'column' => true,
- 'tab' => 'General']);
+ 'tab' => 'Informations génerales']);
$this->addField(['name' => 'online',
'type' => 'Checkbox',
'label' => 'En ligne',
'column' => true,
- 'tab' => 'General']);
+ 'tab' => 'Informations génerales']);
$this->addField(['name' => 'public',
'type' => 'Checkbox',
'label' => 'Publique',
'column' => true,
- 'tab' => 'General']);
+ 'tab' => 'Informations génerales']);
$this->addField(['name' => 'supplier',
'label' => 'Fournisseur',
'type' => 'Text',
'translatable' => false,
- 'tab' => 'Supplier']);
+ 'tab' => 'Informations fournisseur']);
$this->addField(['name' => 'supplier_reference',
'label' => 'Référence fournisseur',
'type' => 'Text',
'translatable' => false,
- 'tab' => 'Supplier']);
+ 'tab' => 'Informations fournisseur']);
$this->addField(['name' => 'highlights',
'label' => 'Product highlights',
'type' => 'Markdown',
- 'tab' => 'Texts']);
+ 'tab' => 'Textes']);
$this->addField(['name' => 'descriptions',
'label' => 'Description',
'type' => 'Markdown',
- 'tab' => 'Texts']);
+ 'tab' => 'Textes']);
$this->addField(['name' => 'images',
'label' => 'Images du produit',
'type' => 'Images',
- 'tab' => 'Media']);
+ 'tab' => 'Média']);
$this->addField(['name' => 'dimensions',
'label' => 'Dimensions',
'type' => 'Markdown',
- 'tab' => 'Texts']);
+ 'tab' => 'Textes']);
$this->addField(['name' => 'options',
'label' => 'Options',
'type' => 'Markdown',
- 'tab' => 'Texts']);
+ 'tab' => 'Textes']);
$this->addField(['name' => 'accessories',
'label' => 'Accessoires',
'type' => 'Markdown',
- 'tab' => 'Texts']);
+ 'tab' => 'Textes']);
}
}