Magento products: simple, configurable and per store view
Adding products in Magento 2.4.9: a simple product with tax class, stock, weight, category, description and image, then a configurable product in three colours with the Create Configurations wizard. Then the store view differences: a German name, description, URL key and meta, a product hidden in one store view, and the price, stock and SEO settings that decide what can differ per website.
Scopes
Every product field shows its scope in grey under the label. It decides where a value can differ.
| Scope | Means | Fields (examples) |
|---|---|---|
| [global] | The same everywhere | SKU, weight, quantity, categories, price (while Catalog Price Scope is Global) |
| [website] | Can differ per website | Enable Product, tax class, price (with Catalog Price Scope = Website) |
| [store view] | Can differ per store view, usually per language | Name, short description, description, visibility, URL key, meta title, meta description |
Change a value for one scope with the Scope switcher at the top left of the product page, then untick Use Default Value under the field.
A simple product
One item, one SKU. Catalog › Products, the arrow next to Add Product › Simple Product.
- Product Name:
MageBooster Travel Mug. SKU:MB-MUG-01(Magento suggests the name; a short unique code is easier in stock lists and orders). Price:24. - Tax Class: Taxable Goods. Tax rules connect this product class with rates, like the 20% UK VAT rate from Lesson 4 (Stores › Tax Zones and Rates, Stores › Tax Rules).
- Quantity:
50, Stock Status: In Stock. Weight:0.4kg (shipping methods use it). - Categories: Travel Gear (Lesson 3). Visibility: Catalog, Search.
- Content: the Short Description has a simple editor; Description uses Page Builder.
- Images And Videos: upload a picture. The first one becomes the Base, Small and Thumbnail image.
- Search Engine Optimization: the URL Key is made from the name; meta title and description go here too.
- Product in Websites: Main Website ticked. Save.
A configurable product
One product page where the customer picks an option. Every option is its own simple product (its own SKU, stock and image), linked to the parent.
- Add Product › Configurable Product. Name
MageBooster Daypack, SKUMB-PACK, price49, category Backpacks. - Configurations › Create Configurations (fill name and price first: the wizard checks the required fields).
- Step 1: tick the attribute, here color. A size attribute works the same way. Only attributes with Catalog Input Type Dropdown or Swatch and Global scope are listed.
- Step 2: the values: Black, Purple, Gray.
- Step 3: Apply unique images by attribute to each SKU (attribute Color, one picture per colour, so the picture changes when the customer picks a colour), Apply single price to all SKUs: 49, Apply single quantity to each SKUs: 20. Unique prices or quantities per colour are possible too.
- Step 4: the summary: 3 new products. Generate Products.
- In Current Variations, give every colour a weight (0.8 in the video). Without a weight Magento saves them as virtual products, which have no shipping.
- Save. Magento asks for the attribute set that gets the color attribute: Add configurable attributes to the current Attribute Set, Confirm.
Per store view: name, description, URL, meta
- Open the Travel Mug. Scope (top left) › German (the store view from Lesson 4).
- Untick Use Default Value under Product Name:
MageBooster Reisebecher. - Content: untick it under Short Description and write the German text.
- Search Engine Optimization: URL Key
reisebecher, a German Meta Title and Meta Description (each with Use Default Value unticked). - Save. The default store view keeps the English values; the German store shows
/reisebecher.html.
Hiding a product in one store view
In Magento 2.4.9 Enable Product has [website] scope: switching it off in the German scope switches the product off for every store view of that website. To hide a product in one store view only, use Visibility, which is a store view value:
- Open the Daypack, Scope › German.
- Untick Use Default Value under Visibility, choose Not Visible Individually, Save.
The Daypack stays in the English store and disappears from the German category pages, search and its own URL. Product in Websites works one level up: untick a website and the product is gone from all of its store views.
# which store views hide or show a product (visibility 1 = Not Visible Individually, 4 = Catalog, Search) sudo mariadb magento -e "select e.sku, v.store_id, v.value from catalog_product_entity e join catalog_product_entity_int v on v.entity_id = e.entity_id join eav_attribute a on a.attribute_id = v.attribute_id and a.entity_type_id = 4 where a.attribute_code = 'visibility' and e.sku like 'MB-%'"
Price per website
Stores › Configuration › Catalog › Catalog › Price › Catalog Price Scope: Global (one price everywhere) or Website. With Website, the product’s price field gets [website] scope, and you set a price per website with the Scope switcher.
Stock per website (MSI)
| Screen | What it is |
|---|---|
| Stores › Inventory › Sources | Places where you keep stock, like a warehouse or a shop. A new install has one: Default Source. |
| Stores › Inventory › Stocks | A stock groups sources and is assigned to websites (sales channels). Default Stock sells on Main Website. |
With one source the product page shows a single Quantity field. Add a second source and a stock for a second website, and every product gets an Assigned Sources list with a quantity per source; each website sells from its own stock.
SEO settings
Stores › Configuration › Catalog › Catalog › Search Engine Optimization:
| Setting | Value in the video | Why |
|---|---|---|
| Product URL Suffix | .html | Keep it once the shop is live: changing it changes every product URL. |
| Use Categories Path for Product URLs | No | One short URL per product, whatever category it is in. |
| Create Permanent Redirect for URLs if URL Key Changed | Yes | Renaming a URL key adds a 301 from the old address. |
| Use Canonical Link Meta Tag For Categories / Products | Yes | Tells search engines which address is the main one. |
Product meta title, keywords and description are on the product page (Search Engine Optimization section), per store view.
Downloads
The price scope and SEO settings from the video as bin/magento config:set commands.
#!/bin/bash # Magento 2.4.9 catalog settings from MageBooster Lesson 10, from the command line. Run on the server. cd /var/www/magento # Stores > Configuration > Catalog > Catalog > Price: Catalog Price Scope = Website (0 = Global, 1 = Website) sudo -u magento bin/magento config:set catalog/price/scope 1 # Catalog > Search Engine Optimization sudo -u magento bin/magento config:set catalog/seo/product_url_suffix .html sudo -u magento bin/magento config:set catalog/seo/product_use_categories 0 sudo -u magento bin/magento config:set catalog/seo/save_rewrites_history 1 sudo -u magento bin/magento config:set catalog/seo/category_canonical_tag 1 sudo -u magento bin/magento config:set catalog/seo/product_canonical_tag 1 sudo -u magento bin/magento cache:flush config full_page
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| A new product is not on the storefront | Indexers on Update by Schedule run with cron: wait a minute or two, or check bin/magento indexer:status. Also check Product in Websites, Visibility and Stock Status. |
| Create Configurations shows errors | Fill the required fields (name, price) first. |
| The colour products are virtual | They had no weight. Set a weight in Current Variations or on each product. |
| Enable Product: No in one store view switches it off everywhere | Enable Product has website scope. Use Visibility: Not Visible Individually in that store view. |
| The German price is the same | Price scope is per website, not per store view. Use a second website. |
| Old product URL gives 404 after a rename | Create Permanent Redirect was off when the URL key changed. Add a redirect in Marketing › URL Rewrites. |
Next lesson
Lesson 11: multisite: three websites on three domains, with magento-vars.php choosing the website for each domain.
▶ Watch every MageBooster lesson on YouTube: all lessons in order · subscribe to the channel
