Skip to main content
Coming Soon…

Model

The model used is Shopper\Core\Models\Product.
NameTypeRequiredNotes
idautoincauto
namestringyesThe name of the product.
slugstringyesUnique, default value is auto generated using product name
skustringnoThe Stock Keeping Unit (SKU) code of the product
barcodestringnoThe barcode of the product.
typestringyesThe type of product Shopper\Core\Enum\ProductType
descriptionlongtextnoDefines the description of the product
is_visiblebooleannoDefines the visibility of the product for customers
featuredbooleannoDefault false
weight_unitstringnoThe weight unit of the product Shopper\Core\Enum\Dimension\Weight
weight_valuefloatnoThe weight value of the product
height_unitstringnoThe height unit of the product Shopper\Core\Enum\Dimension\Length
height_valuefloatnoThe height value of the product
width_unitstringnoThe width unit of the product Shopper\Core\Enum\Dimension\Length
width_valuefloatnoThe width value of the product
depth_unitstringnoThe depth unit of the product Shopper\Core\Enum\Dimension\Length
depth_valuefloatnoThe depth value of the product
volume_unitstringnoThe volume unit of the product Shopper\Core\Enum\Dimension\Volume
volume_valuefloatnoThe volume value of the product
brand_idintnoint (Brand object via the brand relation)
summarytextnoNullable
security_stockintnoDefine the security stock of the product.
seo_titlestringnoNullable
seo_descriptionstringnoNullable
external_idstringnoNullable
published_atdatetimeyesDefines a publication date so that your product are scheduled on your store.
metadatajsonnoNullable
Models are customizable, and we recommend changing the Product model when you configure your site. To change the model you need to look at the configuration file config/shopper/models.php.
use Shopper\Core\Models;

return [
    // ...
    'product' => Models\Product::class,
];
  1. Create your own Model
    php artisan make:model Product
    
    Once the app/Models/Product.php model is created in your app folder, you need to extend from the Shopper\Core\Models\Product Model.
  2. Extend your Product model from the Product Shopper Model
    namespace App\Models;
    
    use Shopper\Core\Models\Product as Model;
    
    class Product extends Model
    {
    }
    
  3. Update product key for the model on the models.php config file to use our new model
    'product' => Models\Product::class, // [tl! --]
    'product' => \App\Models\Product::class, // [tl! ++]
    

Components

By default, product Livewire components are not published. To customize components, you must publish them.
php artisan shopper:component:publish product
This command will publish all Livewire components used for product management (from pages to form components). Once you’ve published the component, you can find it in the product.php locate in the config/shopper/components folder.
use Shopper\Livewire;

return [
  'pages' => [
        'product-index' => Livewire\Pages\Product\Index::class,
        // ...
    ],
    
  'components' => [
        // ...
        'slide-overs.add-product' => Livewire\SlideOvers\AddProduct::class,
        // ...
  ],
];