docs: create docs workspace (#5174)

* docs: migrate ui docs to docs universe

* created yarn workspace

* added eslint and tsconfig configurations

* fix eslint configurations

* fixed eslint configurations

* shared tailwind configurations

* added shared ui package

* added more shared components

* migrating more components

* made details components shared

* move InlineCode component

* moved InputText

* moved Loading component

* Moved Modal component

* moved Select components

* Moved Tooltip component

* moved Search components

* moved ColorMode provider

* Moved Notification components and providers

* used icons package

* use UI colors in api-reference

* moved Navbar component

* used Navbar and Search in UI docs

* added Feedback to UI docs

* general enhancements

* fix color mode

* added copy colors file from ui-preset

* added features and enhancements to UI docs

* move Sidebar component and provider

* general fixes and preparations for deployment

* update docusaurus version

* adjusted versions

* fix output directory

* remove rootDirectory property

* fix yarn.lock

* moved code component

* added vale for all docs MD and MDX

* fix tests

* fix vale error

* fix deployment errors

* change ignore commands

* add output directory

* fix docs test

* general fixes

* content fixes

* fix announcement script

* added changeset

* fix vale checks

* added nofilter option

* fix vale error
This commit is contained in:
Shahed Nasser
2023-09-21 20:57:15 +03:00
committed by GitHub
parent 19c5d5ba36
commit fa7c94b4cc
3209 changed files with 32188 additions and 31018 deletions
@@ -0,0 +1,9 @@
{
"position": 6,
"collapsed": false,
"link": null,
"label": "Discounts",
"customProps": {
"sidebar_is_group_headline": true
}
}
@@ -0,0 +1,101 @@
---
sidebar_position: 2
description: 'This user guide explains how to create a discount on the Medusa admin.'
addHowToData: true
---
import UiIcon from '@site/src/components/UiIcon';
# Create a Discount
In this document, youll learn how to create a discount.
## How to Create a Discount
To create a discount:
1. Go to Discounts.
2. Click on the Add Discount button.
This opens a form with collapsible sections to fill in different information about the discount.
### Discount Type
In this section, you have to select the discount type. There are three types:
1. **Percentage:** discount a specific percentage of the price of each item that complies with the discount conditions.
2. **Fixed amount:** discount a specific amount either from the cart total or from the price each item that complies with the discount conditions. After choosing this type, a new field Allocation will show where you can choose how the discount should be applied.
3. **Free shipping:** Remove any shipping amount available during checkout.
Choose the type of the discount and fill in any additional fields if necessary.
### General
In this section, you have to enter general but required information related to the discount:
1. In the “Choose valid regions” field, choose the regions this discount should be applied in. You must select at least one region. For the Fixed Discount type, you can only pick one region. For other types you can select more than one region.
2. In the Code field, enter the code that the customers have to enter during checkout for the discount to be applied. Only uppercase letters and numbers are allowed.
3. If you chose Percentage for Discount Type earlier, enter the percentage that should be discounted in the Percentage field.
4. If you chose Fixed Amount for Discount Type earlier, enter the amount that should be discounted in the Amount field.
5. In the Description field, enter a description for the discount.
6. You can check the “This is a template discount” checkbox to create a template discount. You can use template discounts to reuse discount rules and configurations across a group of discounts.
### Configuration
In this section, you can set configurations that limit the application of the discount:
1. Toggle the Start date field if you want to set the date and time the customers can start using this discount. If you dont set a start date, the discount can be used once its published.
2. Toggle the “Discount has an expiry date?” field if you want to set the date and time the discount ends. If you dont set an expiry date, the discount can be used forever while its published.
3. Toggle the “Limit the number of redemptions?” field if you want to limit how many times the discount can be used. This number is used across customers, and not per customer. If you dont set a limit, the discount can be used unlimitedly.
4. If you chose to make the discount a template discount earlier, you can toggle the “Availability duration?” field to set the duration of the discount in years, months, days, hours, and minutes.
### Conditions
In this section, you can set the conditions that define when the discount can be applied. When the discount is used on a cart, it will only be applied if the items in the cart and the customer fit the discounts conditions.
The following condition types can be used:
1. **Product:** specify products that this discount can/cant be used with.
2. **Customer groups:** specify customer groups that this discount can/cant be used with.
3. **Tag:** specify tags that this discount can/cant be used with.
4. **Collection:** specify the collection that this discount can/cant be used with.
5. **Type:** specify the product type that this discount can/cant be used with.
To add a condition to the discount:
1. Click on the Add Condition button.
2. Click on the condition type.
3. In the new list that opens:
1. Choose at the top either “In” or “Not In,” where “In” indicates that the discount can be applied to the items selected in this list, and “Not In” indicates that the discount can be applied to all items except those selected in this list.
2. Select the items from the list.
4. Once done, click “Save and add more” to add more conditions, or click “Save and close” to close the conditions window.
:::info
You can use a condition type for only one condition. After using a condition type, you will not be able to use it again for another condition. Youll need to edit the condition you added if you need to make any changes.
:::
To edit a condition you already added to the discount:
1. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon next to the condition.
2. Click on Edit from the dropdown.
3. Make changes to the condition in the new window that opens.
4. Once done, click on the Save button.
To delete a condition you already added to the discount:
1. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon next to the condition.
2. Click on “Delete condition” from the dropdown.
### Metadata
Under the Metadata section, you can attach custom data to the discount as key-value pairs. This is mostly useful for developers and technical teams.
### Save Discount
After filling out previous sections, you can save the discount by either clicking the “Save as draft” or “Publish discount” buttons.
If you save the discount as a draft, customers will not be able to use it but all of the information, configurations, and conditions will be saved. You can publish it at a later point.
If you publish the discount, customers will be able to use it within the configurations and conditions youve set. You can change the status of the discount back to draft later on as well.
@@ -0,0 +1,35 @@
---
sidebar_position: 1
description: 'Medusa admin allows merchants to manage discounts. Merchants can create discounts and manage their conditions.'
---
# Discounts Overview
In this document, youll get an overview of the customer listing page and everything you can do with it.
## Overview
You can create discounts of different types in Medusa that customers use on checkout:
- **Percentage Discounts** to deduct a percentage of the total amount of an order.
- **Fixed Discounts** to deduct a fixed amount from the total amount of an order.
- **Free Shipping** to override the delivery amount of an order and make it free.
Discounts are in the form of a code that your customers can use. You can set options for a discount such as a start and an end date.
You can also specify conditions for discounts, such as applying them for specific products or shipping options.
---
## View List of Discounts
You can view the list of available discounts in your ecommerce store by clicking on Discounts from the sidebar menu.
In the list, you can see discount details such as the code, description, amount, and status.
---
## Learn More About Discounts
- [Create a Discount](./create.mdx)
- [Manage Discounts](./manage.mdx)
@@ -0,0 +1,142 @@
---
sidebar_position: 3
description: 'This user guide explains how to manage discounts on the Medusa admin. Learn how to edit and delete discounts'
addHowToData: true
---
import UiIcon from '@site/src/components/UiIcon';
# Manage Discounts
In this document, youll learn how to manage discounts including editing and deleting a discount.
## View Discount Details
To view a discounts details:
1. Go to Discounts.
2. Click on the discount you want to view its details
This opens the discounts details page.
---
## Edit a Discount
### Change Discount Status
:::info
Changing a discounts status to published makes it available for customers to use. Changing a discounts status to draft makes it unavailable for customers to use.
:::
To change a discounts status:
1. Go to the discount details page.
2. At the top right of the first section, youll see the status of the discount (for example, Published). Click on it.
3. Choose from the dropdown the opposite status (for example, Draft)
### Edit General Information
To edit a discounts general information:
1. Go to the discount details page.
2. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon at the top right of the first section.
3. Click on “Edit general information” from the dropdown.
4. In the pop-up, you can edit any of the discount information.
5. Once done, click on the "Save and close" button.
---
## Manage Discount Configurations
### Edit Configurations
To edit a discounts configuration:
1. Go to the discount details page.
2. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon at the top right of the Configurations section.
3. Click on “Edit configurations” from the dropdown.
4. In the pop-up, you can edit any of the configurations.
5. Once done, click on the Save button.
### Delete Configurations
Other than the start date, you can delete any of the configurations if youve set them.
To delete a configuration:
1. Go to the discount details page.
2. In the Configurations section, click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon next to the configuration you want to delete.
3. Click on “Delete configuration” from the dropdown.
---
## Manage Discount Conditions
### Add Conditions
:::info
You can use a condition type for only one condition. After using a condition type, you will not be able to use it again for another condition. You must [edit the condition](#edit-a-condition) that you added before of that type if you need to make any changes.
:::
To add a condition to a discount:
1. Go to the discount details page.
2. In the Conditions section, click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon.
3. Click on “Add condition” from the dropdown.
4. In the pop-up, find the condition type from the list of conditions and click on it.
5. In the new list that opens:
1. Choose at the top either “In” or “Not In,” where “In” indicates that the discount can be applied to the items selected in this list, and “Not In” indicates that the discount can be applied to all items except those selected in this list.
2. Select the items from the list.
6. Once done, click “Save and add more” to add more conditions, or click “Save and close” to close the conditions window.
### Edit a Condition
To edit a discounts condition:
1. Go to the discount details page.
2. In the Conditions section, click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon next to the condition you want to edit.
3. Click on “Edit condition” from the dropdown.
4. In the pop-up that opens:
1. To add new items to the list:
1. Click on the Add button at the top right.
2. Choose the items you want to add.
3. Click on either the “Save and go back” or the “Save and close” button.
2. To remove items from the list:
1. Choose the items you want to remove.
2. Click on the Remove button at the top right.
### Delete a Condition
:::caution
Deleting a condition can't be undone. You can still add a new condition of the same type afterward.
:::
To delete a discounts condition:
1. Go to the discount details page.
2. In the Conditions section, click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon next to the condition you want to delete.
3. Click on “Delete condition” from the dropdown.
---
## Delete a Discount
:::warning
Deleting a discount can't be undone.
:::
To delete a discount:
1. Go to the discount details page.
2. Click on the <UiIcon lightIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999308/Medusa%20Docs/UI%20Icons/1ordBC6_ssysel.png" darkIcon="https://res.cloudinary.com/dza7lstvk/image/upload/v1667999326/Medusa%20Docs/UI%20Icons/dSwWYBH_stzgoi.png" alt="three dots" /> icon at the top right of the first section.
3. Click on “Delete discount” from the dropdown.
4. Confirm deleting the discount by clicking the “Yes, confirm” button in the pop-up.