-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Testing * Adding documentation page and images for InventoryPart * Adding documentation page and images for ProductPart * Adding documentation page and images for PricePart * Adding documentation and images for PriceVariantsPart * Adding documentation and images for TieredPricePart * Adding documentation pages and images for product attributes * Fixing typo * Fixing links and improving formatting * Adding improvements and clarifications * Improving formatting * Renaming * Fixing links * Fixing sentence
- Loading branch information
Showing
41 changed files
with
209 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+564 KB
...sets/images/boolean-product-attribute-field/attribute-field-display-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.6 KB
...ssets/images/boolean-product-attribute-field/attribute-field-editor-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65 KB
docs/assets/images/boolean-product-attribute-field/content-type-editor-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+537 KB
...sets/images/numeric-product-attribute-field/attribute-field-display-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45 KB
...ssets/images/numeric-product-attribute-field/attribute-field-editor-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65 KB
docs/assets/images/numeric-product-attribute-field/content-type-editor-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46 KB
docs/assets/images/price-variants-part/attribute-field-editor-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.9 KB
docs/assets/images/price-variants-part/price-variants-editor-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.7 KB
docs/assets/images/price-variants-part/price-variants-inventory-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+598 KB
docs/assets/images/price-variants-part/price-variants-page-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+598 KB
.../assets/images/text-product-attribute-field/attribute-field-display-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46 KB
docs/assets/images/text-product-attribute-field/attribute-field-editor-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65 KB
docs/assets/images/text-product-attribute-field/content-type-editor-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Binary file added
BIN
+21 KB
docs/assets/images/tiered-price-part/tiered-price-part-editor-example.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# BooleanProductAttributeField | ||
|
||
Adds a checkbox so the buyer can communicate some kind of yes/no choice about their purchase. Currently this attribute is not supported for price variant creation. | ||
|
||
## Fields and properties | ||
- **Hint** (`string`): Sets the description text to display for this attribute on the product's page. | ||
- **DefaultValue** (`T`): Sets the default value. | ||
- **Label** (`string`): Sets the text associated to the checkbox for this attribute on the product page. | ||
|
||
## Usage examples | ||
New attribute fields can be added or existing fields can be edited in the relevant product content type's editor. | ||
 | ||
|
||
 | ||
|
||
Attribute fields are displayed on the product's page. | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# InventoryPart | ||
|
||
The `InventoryPart` adds basic inventory management capabilities to a product. Requires [`ProductPart`](product-part.md) to be present on the content type as well. | ||
|
||
## Fields and properties | ||
- **AllowsBackOrder** (`BooleanField`): When set to true, product can be ordered even when the Inventory field's value is below 1. | ||
- **IgnoreInventory** (`BooleanField`): When set to true, all inventory checks (within [`InventoryShoppingCartEvents`](https://github.com/OrchardCMS/OrchardCore.Commerce/blob/main/src/Modules/OrchardCore.Commerce/Events/InventoryShoppingCartEvents.cs)) are bypassed. | ||
- **Inventory** (`IDictionary<string, int>`): Sets the number of available products. Uses a `Dictionary<string, int>` object to keep track of multiple inventories (which is mostly relevant for products with a [`PriceVariantsPart`](price-variants-part.md) attached to them). | ||
- **MaximumOrderQuantity** (`NumericField`): Determines the maximum amount of products that can be placed in an order. Also sets the upper limit for the _Quantity_ input on the product's page. This field is ignored if its value is set to 0 or below. | ||
- **MinimumOrderQuantity** (`NumericField`): Determines the minimum amount of products that can be placed in an order. Also sets the lower limit for the _Quantity_ input on the product's page. This field is ignored if its value is set to 0 or below. | ||
- **OutOfStockMessage** (`HtmlField`): Enables providing a specific message for an out of stock product. Defaults to "Out of Stock". | ||
|
||
By default, the below fields' shapes are empty, so they do not show up on the user-facing part of the site: | ||
|
||
- _AllowsBackOrder_ | ||
- _IgnoreInventory_ | ||
- _MaximumOrderQuantity_ | ||
- _MinimumOrderQuantity_ | ||
|
||
## Usage examples | ||
All the inventory-related settings can be found in the product's editor. | ||
 | ||
|
||
With a product's inventory set to a valid value, the current inventory count will appear on the product's page. | ||
 | ||
|
||
With a maximum order quantity specified, trying to add more products to the cart than allowed will result in a validation error. | ||
 | ||
|
||
With a minimum order quantity specified, trying to add fewer products to the cart than allowed will result in a validation error. | ||
 | ||
|
||
With a custom out of stock message provided, the message will show up on the product's page when its inventory is below 1 and back ordering is not allowed. | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# NumericProductAttributeField | ||
|
||
Adds a numeric input field so the buyer can communicate some kind of additional numeric detail about their purchase. Currently this attribute is not supported for price variant creation. | ||
|
||
## Fields and properties | ||
- **Hint** (`string`): Sets the description text to display for this attribute on the product's page. | ||
- **DefaultValue** (`T`): Sets the default value. | ||
- **Required** (`bool`): Determines whether a value is required. | ||
- **Placeholder** (`string`): Sets the hint to display when the input is empty. | ||
- **DecimalPlaces** (`string`): Sets the number of digits possible after the decimal point. | ||
- **Minimum** (`string`): Determines the minimum value allowed. | ||
- **Maximum** (`string`): Determines the maximum value allowed. | ||
|
||
## Usage examples | ||
New attribute fields can be added or existing fields can be edited in the relevant product content type's editor. | ||
 | ||
|
||
 | ||
|
||
Attribute fields are displayed on the product's page. | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# PricePart | ||
|
||
Provides a single price to a product using a custom [`PriceField`](https://github.com/OrchardCMS/OrchardCore.Commerce/blob/main/src/Modules/OrchardCore.Commerce.ContentFields/Models/PriceField.cs). | ||
|
||
## Fields and properties | ||
- **PriceField** (`PriceField`): Sets the base price of a product using a decimal number and a currency. The final price of a product may differ based on other features that implement `IShoppingCartEvents`, like promotions and tax settings. | ||
|
||
## Usage examples | ||
The product's price can be set in the product's editor. | ||
 | ||
|
||
The product's price appears on the product's page, showing the specified decimal value and currency. | ||
 | ||
|
||
Price is also shown in the cart once the product has been added. | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# PriceVariantsPart | ||
|
||
Provides multiple prices to a product based on predefined attributes. This currently only supports [`TextProductAttributeField`](text-product-attribute-field.md)s that are restricted to predefined values. | ||
|
||
If [`InventoryPart`](inventory-part.md) is present, there will be multiple separate inventories for the variants. | ||
|
||
In case of multiple attribute fields on a content type, a price field will be created for each possible combination. Individual inventories can be created using a recipe, see the sample [Price Variant Product](https://github.com/OrchardCMS/OrchardCore.Commerce/blob/main/src/Modules/OrchardCore.Commerce/Recipes/OrchardCore.Commerce.Samples.Product.recipe.json#L145). | ||
|
||
Adding or editing product attributes can be done in the content type's editor (see below). | ||
|
||
## Fields and properties | ||
- **Variants** (`IDictionary<string, Amount>`): This property stores each variant's SKU along with their price. | ||
|
||
## Usage examples | ||
New attribute fields can be added or existing fields can be edited in the content type's editor. | ||
 | ||
|
||
 | ||
|
||
The prices of variants can be set in the content item's editor. | ||
 | ||
|
||
With _InventoryPart_ present, the inventory of each variant can be set in the content item's editor. | ||
 | ||
|
||
On the product's page, a variant can be selected and added to the cart. If inventories exist, they are also displayed here. | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# ProductPart | ||
|
||
A content item becomes a product if it has a `ProductPart` and a price providing part (e.g. [`PricePart`](price-part.md), [`PriceVariantsPart`](price-variants-part.md), or [`TieredPricePartPart`](tiered-price-part.md)). | ||
|
||
## Fields and properties | ||
- **SKU** (`string`): The product's stock keeping unit, used for identification purposes. Must be globally unique and cannot contain the hyphen (`-`) character. | ||
- **CanBeBought** (`IDictionary<string, bool>`): Determines whether the product can currently be bought based on current inventory settings. If there is no [`InventoryPart`](inventory-part.md) on the product, it is unused. This is not editable in the product's editor. | ||
- **ProductImage** (`MediaField`): Allows selecting an image from the Media Library that will be displayed on the product's page. | ||
|
||
## Usage examples | ||
The _SKU_ and the _Product Image_ properties can be set in the product's editor. | ||
 | ||
|
||
If _Product Image_ is set, it will appear on the product's page. | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# TextProductAttributeField | ||
|
||
Allows adding further details to a product. By default it is displayed as a text input, but this is modified by some of the properties below. When used in combination with a [`PriceVariantsPart`](price-variants-part.md) and restricted to predefined values, it creates variants for the product. | ||
|
||
When not restricted to predefined values, it can be used to provide a text or note to the merchant. For example, in a clothing store it may be used to supply custom text to be printed on the item. | ||
|
||
## Fields and properties | ||
- **Hint** (`string`): Sets the description text to display for this attribute on the product's page. | ||
- **Required** (`bool`): Determines whether a value is required. | ||
- **DefaultValue** (`T`): Sets the default value. | ||
- **Placeholder** (`string`): Sets the hint to display when the input is empty. | ||
- **PredefinedValues** (`IEnumerable<object>`): Holds the set of allowed values. These are also used to create variants with a `PriceVariantsPart`. | ||
- **RestrictToPredefinedValues** (`bool`): Determines whether values should be restricted to the set of predefined values. When true, the field is displayed as a list of radio buttons. Note that this must be set to true for `PriceVariantsPart` to pick up the values. | ||
- **MultipleValues** (`bool`): Determines whether multiple values can be selected. This only makes sense when _RestrictToPredefinedValues_ is true. If enabled, the predefined values are displayed as a list of checkboxes. | ||
|
||
## Usage examples | ||
New attribute fields can be added or existing fields can be edited in the relevant product content type's editor. | ||
 | ||
|
||
 | ||
|
||
The predefined values of the attribute are displayed on the product's page. | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# TieredPricePart | ||
|
||
Allows setting several prices for a product based on the quantity purchased at once. | ||
|
||
## Fields and properties | ||
- **DefaultPrice** (`Amount`): Sets the base price of the product, which will be applicable until the selected quantity reaches one of the specified tiers. | ||
- **PriceTiers** (`IList<PriceTier>`): A list of [`PriceTiers`](https://github.com/OrchardCMS/OrchardCore.Commerce/blob/main/src/Modules/OrchardCore.Commerce/Models/PriceTier.cs) that determine which price to use at which quantity. The currency of these prices follows the currency set for the _DefaultPrice_ property. If there are no tiers specified, the _DefaultPrice_'s value is used in all cases. | ||
|
||
## Usage examples | ||
The price tiers can be set in the product's editor. | ||
 | ||
|
||
The product's tiered prices appear on the product's page and modify the line price in the cart if applicable. | ||
 | ||
|
||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Modules/OrchardCore.Commerce/Recipes/OrchardCore.Commerce.Content.Product.recipe.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters