# Change Request: Toppings
#### Quick data:
**Client interested**: Tower42
**Module involved**: Marketplace / Multishop
**Platforms involved**: All (!)
**Status**: draft
**Deadline**: 2nd half of August (as to allow ample time for testing prior T42 launch scheduled for mid September)
#### Business Case
Restaurant products are sometimes sold in variants:
##### Example:
I'm buying a margherita
- I can have it regular or XL size
- I can have extras like: pepperoni and jalapeno peppers
Our T42 clients like Pizza Pilgrims or Scarpetta expect such features to be active prior The Great Launch. Having such feature will also get us more in line with standard featureset of Restaurant/Food-ordering apps.
#### Implications:
- topping options need a place to be shown like "product details". Why? There's no room to list all toppings with their descriptions. Such view would have to be added on ALL platforms. It also means changes to the flow (product cart view etc.).
- toppings will usually be priced. Prices will have an impact on payments - obvious, and will need some UI space to be shown.
#### Designs
- [Des #1 on Zeplin - Allergies on Web](https://app.zeplin.io/project/5b9fd45a5d7e5b693fb811a7/screen/5d41a954a5e05745115cc8b5)
- [Des #2 on Zeplin - Toppings on Web](https://app.zeplin.io/project/5b9fd45a5d7e5b693fb811a7/screen/5d4940e829b6eb1337be972f)
#### Business doubts and decisions
1) #### Do we want to handle subtracting toppings as well as adding them?
Cons:
- lots of effor for Merchants: If i'd like to order Pizza Quattro Fromaggi without Gorgonzola it'd probably mean that the Merchant would have to manually put in the system its main "subtractable" ingredients eg. tomatoes, ricotta, mozarella, parmigiano, and gorgonzola.
- We might have to price all of those ingredients - headache for us and merchants
:::warning
**[JK]:** suggested way is to do subtractions as notes (in other word not do them at all)
:::
2) Can a certain topping be available for Free, or should each one of them have a price?
> [color=#64aec4] I think 0 is a valid price. This is how pyszne.pl displays the items which have price set to 0: https://drive.google.com/file/d/1bRWmovdaMkUc0j_5f-HO4PtHAZlStdO6/view
> [name=Oksana Macko]
3) should toppings have a description?
> [color=#64aec4] I don't think so. It could take too much UI space.
> [name=Oksana Macko] [confirmed]
4) should they have a picture? If so - Merchant App will need appropriate controls.
> [color=#64aec4] Same as above.
> [name=Oksana Macko] [confirmed]
>
5) Am I right to assume that we should only allow to add 1 piece of every topping per product unity to a product order?
Example:
Customer orders 1 Whopper burger. I can add an extra cheese. And extra jalapeno peppers. - OK
Adding 2x extra cheese and 3x jalapeno peppers - not OK.
only 1 piece of topping per 1 product
6) A GUI doubt: How should we count toppings quantity? Customer ordered 6 Cheeseburgers. He clicked "extra cheese". Should we on backend produce two order items of of it: 6 x Cheeseburger + 6 x "Extra cheese (topping)" and bill him accordingly?
Should the quantity of each topping in order items always be 1 per topping type regardless of product quantity or should it match product quantity?
Problem Example:
We're trying to buy 5 Cheeseburgers, of which one is with extra cheese and jalapenos, one with just extra cheese and the other 3 are just regular, no toppings.
Web GUI, even if we'd extend it by designs above, will not permit you to generate 3 order items
- 1 Cheeseburger + extra cheese + extra jalapenos
- 1 Cheeseburger + extra cheese
- 3 Cheeseburger(s) (regular)
7) Toppings should contain info about allergies
8) There's no subtractive toppings (i.e. without ham
9) There are no shop_product variants (regular pizza, pizza XL etc.)
> [color=#64aec4] 10. Allow cloning topping groups (i.e. restaurant wants to set 2 slightly different topping groups consicting of vegetables: 1 for small pizzas, 2 for big pizzas. The groups have the same items in it, just different prices. To avoid setting the 2nd one from scratch, we could insert a "copy category" button).
> [name=Oksana Macko]
#### Proposed Technical solution - overview
##### Backend
###### Making an order with toppings
>[color=red] `POST /api/v4/shop_orders`
```jsonld=
{
"order": {
"customer_notes": "Lorem ipsum",
"shop_id": 23,
"stripe_card_id": null,
"payment_type": "cash",
"frontend_transaction_uuid": "{{UUID}}",
"order_items": [
{
"product_id": 2,
"quantity": 6,
"topping_ids": [1, 5, 6]
}
]
}
}
```
to which you'd get a response:
```jsonld=
{
"order": {
"id": 7,
"frontend_transaction_uuid": "042a017c-560e-11e9-8647-d663bd873d9e",
"customer_notes": "Lorem ipsum",
"number_of_items": 6,
"order_number": 672,
"status": "new_order",
"net_price": 1380,
"gross_price": 11040,
"tax_value": 9660,
"ordered_at": "2019-04-03T13:46:26Z",
"payment_type": "cash",
"customer": null,
"order_items": [
{
"id": 206,
"name": "Veuve Clicquot Ponsardin Brut Grand Cru 0,75l",
"description": "",
"quantity": 6,
"shop_product_id": 1,
"shop_order_id": 7,
"total_net_price": 1380,
"total_gross_price": 11040,
"tax_rate": 7,
"tax_value": 9660
},
{
"id": 207,
"name": "a gift packing for Veuve Clicquot Ponsardin Brut Grand Cru 0,75l",
"description": "",
"quantity": 6,
"shop_product_id": 1,
"shop_order_id": 7,
"total_net_price": 1380,
"total_gross_price": 11040,
"tax_rate": 7,
"tax_value": 9660
}
]
}
}
```
###### Creating a new topping
>[color=red] `POST /api/v4/merchant/shops/3/products/5/toppings`
```jsonld=
{
"topping": {
"name": "Extra cheese",
"description": "Lorem ipsum sit amet",
"net_price": "1.0",
"tax_rate": "20.0",
"tax_value": "0.2",
"gross_price": "1.2"
}
}
```
(If picture of the topping is to be sent, info will be sent as a FORM-DATA).
###### List of product toppings
>[color=red] `GET /api/v4/merchant/shops/3/products`
```jsonld=
{
"products": [
{
"id": 1,
"name": "Whopper Burger",
"description": "",
"sku": "112233",
"position": 1,
"shop_product_category_id": 3,
"enabled": true,
"photo": null,
"net_price": 7.0,
"tax_rate": 20.0,
"tax_value": 1.4,
"gross_price": 8.4,
"tags": {
"allergy": [
"gluten",
"soy"
],
"trait": [
"halal"
]
},
"toppings": [
{
"id": 1,
"name": "Extra cheese",
"description": "Lorem ipsum sit amet",
"net_price": 1.0,
"tax_rate": 20.0,
"tax_value": 0.2,
"gross_price": 1.2
},
{
"id": 2,
"name": "Extra burger",
"description": "Lorem ipsum sit amet",
"net_price": 2.0,
"tax_rate": 20.0,
"tax_value": 0.4,
"gross_price": 2.4
},
{
"id": 3,
"name": "Extra pickles",
"description": "Lorem ipsum sit amet",
"net_price": 1.0,
"tax_rate": 20.0,
"tax_value": 0.2,
"gross_price": 1.2
}
]
}
]
}
```
## Business ToDo's
- Provide answers for questions listed in **Business doubts and decisions**
## Backend ToDo's
- Add Toppings model (Product has many Toppings)
- Handle pricing of product with toppings
- change Stripe integration accordingly, and storing transaction details.
## Merchant App ToDo's
- Prep controls/UI + API layer to define toppings in Product Create/Edit view
Current modal for that seems too small so very likely major UI changes for this view are necessary
- Change UI in order receiving view to contain topping information
- perhaps change the way incoming orders are displayed so that order notes would stand out, so that people in the kitchen wouldn't miss a thing.
## Web App ToDo's
- provide Product Details view which would contain toppings info (?)
- modify flow so that when you add product to the cart, you can also select toppings to it.
- modify cart summary so that not only selected toppings were shown, but also price was updated accordingly
## Mobile App ToDo's
- pretty much same as for Web