Skip to content

Fix typos / missing fields or broken mermaid diagrams for vouchers / promotions docs #1547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions docs/developer/discounts/promotions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The catalogue discounts from promotions are recalculated by a background task, s

### Examples of the use cases

- Define the product fixed or parentage discounts based on certain conditions.
- Define the product fixed or percentage discounts based on certain conditions.
- Define the discount available only for a specific period.

### Order promotions
Expand Down Expand Up @@ -1200,6 +1200,7 @@ that applies on objects with subtotal above **$20**.
{
"id": "Q2hlY2tvdXRMaW5lOmU5ZmI3YjY3LTA4ZjctNDQzZi1iMWNjLWE1ZmJlNGU0NjcxMg==",
"quantity": 2,
"isGift": false,
"undiscountedTotalPrice": {
"amount": 40.0
},
Expand All @@ -1226,6 +1227,7 @@ that applies on objects with subtotal above **$20**.
{
"id": "Q2hlY2tvdXRMaW5lOmMwNzhjNGQyLWI1MzUtNDhkMy04MDlmLTA1ZDUyYjY3MWFiNQ==",
"quantity": 1,
"isGift": true,
"undiscountedTotalPrice": {
"amount": 50.0
},
Expand Down Expand Up @@ -1292,6 +1294,7 @@ After completing the checkout we get an order with the gift line:
"lines": [
{
"quantity": 2,
"isGift": false,
"totalPrice": {
"gross": {
"amount": 40.0
Expand All @@ -1313,6 +1316,7 @@ After completing the checkout we get an order with the gift line:
},
{
"quantity": 1,
"isGift": true,
"totalPrice": {
"gross": {
"amount": 0.0
Expand All @@ -1325,11 +1329,11 @@ After completing the checkout we get an order with the gift line:
},
"undiscountedUnitPrice": {
"gross": {
"amount": 500.0
"amount": 50.0
}
},
"unitDiscount": {
"amount": 500.0
"amount": 50.0
}
}
]
Expand Down Expand Up @@ -1359,18 +1363,18 @@ When a voucher code is added, the discount from the order promotion is not appli
graph TD
A(Base undiscounted price) --> B[Apply catalogue discounts]
B --> Z{Voucher code added?}
Z --> |No| K[Apply `order` discount]
Z --> |No| K[Apply order discount]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mermaid cannot render inline code blocks

K --> E
Z --> |Yes| C[Apply lines vouchers - `ONCE_PER_ORDER`, `SPECIFIC_PRODUCT`]
C --> D[Apply `ENTIRE_ORDER` voucher]
Z --> |Yes| C[Apply lines vouchers - ONCE_PER_ORDER, SPECIFIC_PRODUCT]
C --> D[Apply ENTIRE_ORDER voucher]
D --> E[Apply taxes]
```

#### Below the chart shows the process of applying the `ORDER` promotion discount

```mermaid
graph TD
A(Base discounted price) --> B[Collect all `ORDER` promotion rules that apply]
A(Base discounted price) --> B[Collect all order promotion rules that apply]
B --> C[For gift promotion rules choose the available product variant from the assigned gifts, with the highest discounted price]
C --> E[Compare the potential gift prices with other possible discounts]
E --> F[Choose the promotion rule that gives the best saving for the user]
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/discounts/vouchers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Vouchers
sidebar_label: Vouchers
---

Vouchers are a way to apply discounts to orders. They can be used to reduce the cost of a checkout. Vouchers can be applied to the entire order
Vouchers are a way to apply discounts to orders or they can be used to reduce the cost of a checkout. Vouchers can be applied to the entire order
or to specific products. They can also be limited to a minimum quantity of products in the checkout. Vouchers and [promotions](developer/discounts/promotions.mdx) can be used together.

:::info
Expand Down