Skip to content

Commit

Permalink
OFFI-1: Fixing Markdown inconsistencies (#408)
Browse files Browse the repository at this point in the history
* Fixing Markdown inconsistencies

* Again

* Allowing word
  • Loading branch information
porgabi authored Feb 7, 2024
1 parent e9edb5f commit a10cdde
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/allow/occ.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ footext
GST
htmlfield
LCID
markdownlint
mkdocs
numericfield
Nunavut
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Start a discussion on the [repository issue tracker](https://github.com/OrchardC

## Reporting security issues

Security issues should be reported privately, via email, to [email protected].
Security issues should be reported privately, via email, to <[email protected]>.

## Other discussions

Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ If you have [Lombiq Analyzers](https://github.com/Lombiq/.NET-Analyzers) include
2. Build and run the `OrchardCore.Commerce.Web` project.
3. Thanks to [Auto Setup](https://docs.orchardcore.net/en/latest/docs/reference/modules/AutoSetup/), the site will be set up with the `OrchardCore Commerce - Development` recipe.
4. Go to the dashboard, using the credentials `admin` and `Password1!`.
5. If you want to test Stripe, go to _Configuration__Commerce__Stripe API_. Set the keys to the test keys found [here](docs/features/stripe-payment.md). If the keys are not set, the Stripe payment button won't appear during checkout.
5. If you want to test Stripe, go to _Configuration__Commerce__Stripe API_. Set the keys to the test keys found [here](docs/features/stripe-payment.md). If the keys are not set, the Stripe payment button won't appear during checkout.
6. Go to _Content__Content Items_, and create your first `Product`.

## Documentation
Expand Down
4 changes: 4 additions & 0 deletions docs/features/boolean-product-attribute-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
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.

![image](../assets/images/boolean-product-attribute-field/content-type-editor-example.png)

![image](../assets/images/boolean-product-attribute-field/attribute-field-editor-example.png)

Attribute fields are displayed on the product's page.

![image](../assets/images/boolean-product-attribute-field/attribute-field-display-example.png)
7 changes: 7 additions & 0 deletions docs/features/inventory-part.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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).
Expand All @@ -18,17 +19,23 @@ By default, the below fields' shapes are empty, so they do not show up on the us
- _MinimumOrderQuantity_

## Usage examples

All the inventory-related settings can be found in the product's editor.

![image](../assets/images/inventory-part/inventory-editor-example.png)

With a product's inventory set to a valid value, the current inventory count will appear on the product's page.

![image](../assets/images/inventory-part/inventory-value-example.png)

With a maximum order quantity specified, trying to add more products to the cart than allowed will result in a validation error.

![image](../assets/images/inventory-part/inventory-max-quantity-example.png)

With a minimum order quantity specified, trying to add fewer products to the cart than allowed will result in a validation error.

![image](../assets/images/inventory-part/inventory-min-quantity-example.png)

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.

![image](../assets/images/inventory-part/inventory-out-of-stock-example.png)
4 changes: 4 additions & 0 deletions docs/features/numeric-product-attribute-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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.
Expand All @@ -12,10 +13,13 @@ Adds a numeric input field so the buyer can communicate some kind of additional
- **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.

![image](../assets/images/numeric-product-attribute-field/content-type-editor-example.png)

![image](../assets/images/numeric-product-attribute-field/attribute-field-editor-example.png)

Attribute fields are displayed on the product's page.

![image](../assets/images/numeric-product-attribute-field/attribute-field-display-example.png)
1 change: 1 addition & 0 deletions docs/features/payment-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Each provider is a stand-alone feature you can turn on or off.
## Creating your own

To create a custom payment provider your code must contain the following:

- An implementation of `IPaymentProvider` registered as a service.
- A shape type `Checkout{provider.Name}`, such as _CheckoutStripe.cshtml_ and _CheckoutDummy.cshtml_.

Expand Down
5 changes: 5 additions & 0 deletions docs/features/price-part.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
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.

![image](../assets/images/price-part/price-editor-example.png)

The product's price appears on the product's page, showing the specified decimal value and currency.

![image](../assets/images/price-part/price-display-example.png)

Price is also shown in the cart once the product has been added.

![image](../assets/images/price-part/price-cart-example.png)
6 changes: 6 additions & 0 deletions docs/features/price-variants-part.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,25 @@ In case of multiple attribute fields on a content type, a price field will be cr
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.

![image](../assets/images/price-variants-part/content-type-editor-example.png)

![image](../assets/images/price-variants-part/attribute-field-editor-example.png)

The prices of variants can be set in the content item's editor.

![image](../assets/images/price-variants-part/price-variants-editor-example.png)

With _InventoryPart_ present, the inventory of each variant can be set in the content item's editor.

![image](../assets/images/price-variants-part/price-variants-inventory-example.png)

On the product's page, a variant can be selected and added to the cart. If inventories exist, they are also displayed here.

![image](../assets/images/price-variants-part/price-variants-page-example.png)
4 changes: 4 additions & 0 deletions docs/features/product-part.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
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.

![image](../assets/images/product-part/product-editor-example.png)

If _Product Image_ is set, it will appear on the product's page.

![image](../assets/images/product-part/product-image-example.png)
6 changes: 5 additions & 1 deletion docs/features/text-product-attribute-field.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# 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.
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.
Expand All @@ -14,10 +15,13 @@ When not restricted to predefined values, it can be used to provide a text or no
- **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.

![image](../assets/images/text-product-attribute-field/content-type-editor-example.png)

![image](../assets/images/text-product-attribute-field/attribute-field-editor-example.png)

The predefined values of the attribute are displayed on the product's page.

![image](../assets/images/text-product-attribute-field/attribute-field-display-example.png)
4 changes: 4 additions & 0 deletions docs/features/tiered-price-part.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
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.

![image](../assets/images/tiered-price-part/tiered-price-part-editor-example.png)

The product's tiered prices appear on the product's page and modify the line price in the cart if applicable.

![image](../assets/images/tiered-price-part/tiered-price-display-example.png)

![image](../assets/images/tiered-price-part/tiered-price-cart-example.png)
5 changes: 2 additions & 3 deletions docs/features/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

## Shopping Cart Event Workflow Events

These events get triggered by `WorkflowShoppingCartEvents` which implements the `IShoppingCartEvents` interface. For each you can access the input as a .NET object using the `Context` workflow input and the serialized version as the `JSON` workflow input.
All of these workflows expect to return one or more outputs which is passed back to the invoking code.
These events get triggered by `WorkflowShoppingCartEvents` which implements the `IShoppingCartEvents` interface. For each you can access the input as a .NET object using the `Context` workflow input and the serialized version as the `JSON` workflow input. All of these workflows expect to return one or more outputs which is passed back to the invoking code.

> ⚠ If you want to return an altered version of the input as the output, please always use the JSON which is already serialized in the expected format used by OrchardCore.Commerce's converters. For example, you can use the JS expression `JSON.parse(input('JSON'))`.
> ⚠ If you want to return an altered version of the input as the output, please always use the JSON which is already serialized in the expected format used by OrchardCore.Commerce's converters. For example, you can use the JS expression `JSON.parse(input('JSON'))`. <!-- markdownlint-disable-next-line MD028 -->
> ℹ When your output contains `LocalizedHtmlString`, it can be represented in JS either as `string` or `{ Name: string, Value: string }`. In case of just `string` the same text becomes `LocalizedHtmlString.Name` and `LocalizedHtmlString.Value` too.
Expand Down
Loading

0 comments on commit a10cdde

Please sign in to comment.