Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add more examples for product docs

Krzysztof Wolski8d310f1ad38e
diff --git a/docs/img/product_class_tree.png b/docs/img/product_class_tree.png
new file mode 100644
index 0000000000..a8616c42fe
Binary files /dev/null and b/docs/img/product_class_tree.png differ
diff --git a/docs/products.rst b/docs/products.rst
index b2cfd0e896..a9b50ae5d3 100644
--- a/docs/products.rst
+++ b/docs/products.rst
@@ -5,6 +5,10 @@ Before filling your shop with products we need to introduce 3 product concepts -
**Example:** Book store - one of *products* would be "Introduction to Saleor". The book is available in hard and soft cover, so there would be 2 *product variants*. Type of cover is only attribute which creates separate variants in our store, so we use *product class* named "Book" with activated variants and 'Cover type' variant attribute.
+Class diagram
+-------------
+
+.. image:: img/product_class_tree.png
Product variant
---------------
@@ -16,14 +20,121 @@ Product
Describes common details of few *product variants*. When shop displays category view, items on the list are distinct *products*. If variant has no overrode property (example: price), default value is taken from *product*.
+- available_on
+ Until this date product is not listed in storefront and is unavailable for users.
+
+- is_featured
+ Featured products are displayed on front page.
+
Product class
-------------
-Think about it as template for your products. You can describe here attributes and change number of variants.
+Think about it as template for your *products*. Multiple *products* can use same *product class*.
+Note: In interface product class is called *Product Type*
+
+- product_attributes
+ Attributes shared with all *product variants*. Example: Publisher - all book variants are published by same company
+
+- variant_attributes
+ It's what distinguishes different *variants*. Example: Cover type - your book can be in hard or soft cover.
+
+- is_shipping_required
+ Mark as false for *products* which does not need shipping. Could be used for digital products.
+
+- has_variants
+ If your *product* has no different variants or if you want to create separate *product* for every one of them - turn this option off.
+ Note: this option simplifies dashboard. There is always *variant* created under the hood.
+
.. warning::
Changing a *product class* affects all *products* of this class.
.. warning::
You can't remove *product class* if it has any *products*.
+
+
+Attributes
+----------
+
+*Attributes* can help you better describe your products. Also, the can be used to filter items in category views.
+There are 2 types of *attributes* - choice type and text type. If you don't provide choice values, then attribute is text type.
+
+**Examples**
+
+* *Choice type*: Every shirt you sell can be made in 3 colors. Then you create *attribute* Color with 3 choice values (for example 'Red', 'Green', 'Blue')
+* *Text type*: Number of pages
+
+
+Example - Coffee
+----------------
+
+Your shop sells Coffee from around the world. Customer can order 1kg, 500g and 250g packages. Orders are shipped by couriers.
+
+**Attributes**
+
+* *Name*: Country of origin
+* *Values*: Brazil, Vietnam, Colombia, Indonesia
+
+
+* *Name*: Package size
+* *Values*: 1kg, 500g and 250g
+
+**Product class**
+
+* *Name*: Coffee
+* *Product Attributes*: Country of origin
+* *Variant Attributes*: Package size
+* *Has variants*: Yes
+* *Is shipping required*: Yes
+
+**Product**
+
+* *Product class*: Coffee
+* *Name*: Best Java Coffee
+* *Country of Origin attribute*: Indonesia
+* *Description*: Best coffee found on Java island!
+
+**Variants**
+
+* *Package size attribute*: 1kg
+* *Price*: $20
+
+
+* *Package size attribute*: 500g
+* *Price*: $12
+
+
+* *Package size attribute*: 250g
+* *Price*: $7
+
+
+Example - Online game item
+--------------------------
+
+You have great selection of online games items. Each item is unique, important details are included in description. Bought items are shipped directly to buyer account.
+
+**Attributes**
+
+* *Name*: Game
+* *Values*: Kings Online, War MMO, Target Shooter
+* *Name*: Max attack
+* *Values*: ---
+
+
+**Product class**
+
+* *Name*: Game item
+* *Product Attributes*: Game, Max attack
+* *Variant Attributes*: None
+* *Has variants*: No
+* *Is shipping required*: No
+
+**Product**
+
+* *Product class*: Game item
+* *Name*: Magic Fire Sword
+* *Price*: $199
+* *Game attribute*: Kings Online
+* *Max attack attribute*: 8000 damage
+* *Description*: Unique sword for any fighter. Set your enemies in fire!