Skip to content
Open
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
69 changes: 69 additions & 0 deletions back-office/sell/orders/orders/order-view/add-discount.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# SPECIFICATIONS - Adding discount from "order view" page


Merchant is in "order view" page (/sell/orders/orders/6/view).

Merchant clicks on "Add a discount button".

Merchant is given a modal with a form.



## The form

Form contains 3 inputs.

* Name
* Type
* Value

and 2 buttons (Save and cancel).

#### Name
1- This is a text input field.

2 -It has a label : "Name".

4- Validation:
Comment on lines +23 to +27

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
1- This is a text input field.
2 -It has a label : "Name".
4- Validation:
1 - This is a text input field.
2 - It has a label : "Name".
4 - Validation:


* client-side : this field should not be empty.
* server-side : do not accept empty, or not safe values.


#### Type
1- This is a select input with 3 options.

2 Options are named : "Percent", "Amount" and "Free Shipping" strings.

3- Default option is "Percent".

4- Validation:
Comment on lines +34 to +40

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
1- This is a select input with 3 options.
2 Options are named : "Percent", "Amount" and "Free Shipping" strings.
3- Default option is "Percent".
4- Validation:
1 - This is a select input with 3 options.
2 - Options are named : "Percent", "Amount" and "Free Shipping" strings.
3 - Default option is "Percent".
4 - Validation:


* client-side : None
* server-side : do not accept values out of the above list.



### value

1- This appears only if selected type is "Percent" or "Amount.

2- This is an input for numeric values.
Comment on lines +49 to +51

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
1- This appears only if selected type is "Percent" or "Amount.
2- This is an input for numeric values.
1 - This appears only if selected type is "Percent" or "Amount.
2 - This is an input for numeric values.


3 - It has a label : "Value".

4 - It contains 2 parts:
* a symbol "%" if selected type is "Percent" and "$" if selected type is "Amount".
* a numeric input with up/down arrows.

5 - Validation:
* client-side : this field is required if selected type is "Percent" or "Amount", else, non required.
* server-side : if selected type is "Percent" value should be between 0 and 100, if selected type is "Amount" value should be between 0 and total.
Comment on lines +56 to +61

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think you should choose between spaces before list, or without spaces!


### cancel button
Closes the modal, equivalent to clicking outside the form.



### save button
Redirects to "order view" page (full redirection and not modal closing).