Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ sidebar_position: 2
# 6.2 Definition of Done for Practical Tasks

* Promotions are created according to the provided scenarios.
* The BFF component is enhanced to support discounts on the Storefront.
* The BFF component is enhanced to provide order list information to the Storefront.
88 changes: 73 additions & 15 deletions docs/6-ecom-solution-enhancement/03-practical-task-1-promotions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,93 @@
sidebar_position: 3
---

import { Highlight } from '/src/components/Shared';

# 6.3 Practical Task - Promotions

## What is this task about
This task involves configuring various promotion conditions in Commercetools to enhance the shopping experience for customers.
Additionally the task involves modifying the Backend For Frontend (BFF) logic to enable promotions functionality on the Storefront.


## What should be done
You will create various promotions for several real-world scenarios in Commercetools.
* Commercetools: You will create various promotions for several real-world scenarios.
* BFF: Implement possibility to apply promotions and extend Cart response to include discount information.


## Task

1. **Percentage Discount on Cart Items.**
As a customer, I want to receive a 10% discount on my entire cart when I apply the code "SAVE10", so that I can save money on my purchase.
1. Create following promotions in Commercetools:

1.1. **Percentage Discount on Cart Items.**
As a customer, I want to receive a 10% discount on my entire cart when I apply the code "SAVE10", so that I can save money on my purchase.
<details>
![promotions-cart-discount-save10-1.png](assets/promotions-cart-discount-save10-1.png)
![promotions-cart-discount-save10-2.png](assets/promotions-cart-discount-save10-2.png)
</details>

1.2. **Fixed Amount Discount on Specific Products.**
As a store administrator, I want to create a promotion where customers get a $20 discount on a specific product when they buy two or more units, so that I can boost sales for that particular product.
<details>
![promotions-cart-discount-quantity-greater-than-1.png](assets/promotions-cart-discount-quantity-greater-than-1.png)
![promotions-cart-discount-quantity-greater-than-2.png](assets/promotions-cart-discount-quantity-greater-than-2.png)
</details>


1.3. **Buy One, Get One (BOGO) Free.**
As a customer, I want to be eligible for a "Buy One, Get One Free" promotion on selected items in my cart, so that I can get additional products at no extra cost.
<details>
![promotions-BOGO.png](assets/promotions-BOGO.png)
</details>

1.4. **Tiered Discount on Order Total.**
As a customer, I want to receive a 5% discount on my order total when it reaches $100, and a 10% discount when it reaches $200, so that I can save money on larger purchases.
<details>
![promotions-tired-discount-1.png](assets/promotions-tired-discount-1.png)
![promotions-tired-discount-2.png](assets/promotions-tired-discount-2.png)
</details>

1.5. **Exclusive Customer Group Discount.**
As a store administrator, I want to create a special discount for VIP customers, providing them with a 15% discount on all products, so that I can reward and retain loyal customers.
<details>
![promotions-vip-customers.png](assets/promotions-vip-customers.png)
</details>

1.6. **Free Shipping Threshold.**
As a customer, I want to qualify for free shipping when my order total reaches $50, so that I can avoid additional shipping costs.
<details>
![promotions-free-shipping.png](assets/promotions-free-shipping.png)
</details>


1.7. **Product Bundle Discount.**
As a customer, I want to receive a discount when I buy a predefined bundle of products, so that I can save money on purchasing them together.
<details>
![promotions-bundle-1.png](assets/promotions-bundle-1.png)
![promotions-bundle-2.png](assets/promotions-bundle-2.png)
</details>

2. **Fixed Amount Discount on Specific Products.**
As a store administrator, I want to create a promotion where customers get a $20 discount on a specific product when they buy two or more units, so that I can boost sales for that particular product.

3. **Buy One, Get One (BOGO) Free.**
As a customer, I want to be eligible for a "Buy One, Get One Free" promotion on selected items in my cart, so that I can get additional products at no extra cost.
2. Extend BFF Cart response to support product discount. Response must contain discounted price. This discounted price will allow user to see both basic price and discounted price on UI. Please refer to request **Get Cart** in the [StoreFront Postman Collection](https://github.com/EPAM-JS-Competency-center/camp-storefront-nuxt/tree/main/postman) to find example of the request and response.

4. **Tiered Discount on Order Total.**
As a customer, I want to receive a 5% discount on my order total when it reaches $100, and a 10% discount when it reaches $200, so that I can save money on larger purchases.
3. Extend BFF Cart update API to support functionality that allows to apply promotions. Please refer to request **Put Cart / AddDiscountCode** in the [StoreFront Postman Collection](https://github.com/EPAM-JS-Competency-center/camp-storefront-nuxt/tree/main/postman) to find example of the request and response.

5. **Exclusive Customer Group Discount.**
As a store administrator, I want to create a special discount for VIP customers, providing them with a 15% discount on all products, so that I can reward and retain loyal customers.
## Commercetools API

6. **Free Shipping Threshold.**
As a customer, I want to qualify for free shipping when my order total reaches $50, so that I can avoid additional shipping costs.
### Cart
#### Get Cart by id
##### <Highlight color="#108a8c">GET</Highlight> `{{host}}/{{project-key}}/carts/{{cart-id}}`

7. **Product Bundle Discount.**
As a customer, I want to receive a discount when I buy a predefined bundle of products, so that I can save money on purchasing them together.
#### Add discount code
##### <Highlight color="#109049">POST</Highlight> `{{host}}/{{project-key}}/carts/{{cart-id}}`
```jsx title="Request Body"
{
"version": {{cart-version}},
"actions": [
{
"action" : "addDiscountCode",
"code" : "mydiscountcode",
}
]
}
```
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.
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.