Overview
You may want to modify an existing discount code: edit the discount percentage, coupon expiry date, number of uses, add free shipping, add or exclude certain categories, etc.
Solution
- From Symphony Manage, navigate to Discounts > Coupons.
- Locate the required coupon.
- You can change only the following settings for an existing code:
- Start and Expiry Dates - Click on the pencil icon () next to the expiry date, modify the start or end date and time, click Save.
- Number of Maximum Uses - Click on the pencil icon () next to the number of uses, enter the desired number of maximum uses, and click Save.
- Start and Expiry Dates - Click on the pencil icon () next to the expiry date, modify the start or end date and time, click Save.
- If you need to modify any other setting for a coupon, you will need to recreate it by following the steps below:
-
- Select the required coupon and Disable it.
- Copy the coupon code.
- Duplicate the disabled coupon.
- Paste the coupon code that you copied into the Enter A Code field.
- Modify the required settings for the coupon.
For more information about all available configurations for coupons, refer to the article Creating Coupons Manually. - Click Save.
You will have a coupon with the same code but different settings.
- Select the required coupon and Disable it.
-
<supportagent>
Note: There is no need to edit codes from the database when a coupon with the same code can be disabled and recreated with adjusted settings from the UI. Only if there is an issue performing this task from the UI, codes should be modified via the database:
- Connect to the database.
- Create a test coupon with the settings that you need to assign to the target coupon (mentioned by the customer). If the customer provided a code from which you need to copy the settings, proceed to the next step.
- Run the following query to check the settings for the code from which you need to copy the settings values:
select * from CouponCode where code = '<Code from step 2>'
- Copy the name and value of the required field from the query results.
- If you need to update selected items or categories for the code, you can run the following query to review category and product ids configured for the code:
select expression from Rule where ruleSet_id = <ruleSetId value from step 3>
Here is an example of the output:'( lineItem.product.categories.id - 10810 && lineItem.product.categories.id - 10483 && lineItem.product.categories.id - 10805 && lineItem.product.categories.id - 10804 && lineItem.product.categories.id - 10180 && lineItem.product.categories.id - 13446 && lineItem.product.categories.id - 13445) && ( lineItem.type == "SIMPLE" || lineItem.type == "SUBSCRIPTION" || lineItem.type == "KIT")'
- Find and copy the ID of the code that needs to be updated:
select * from CouponCode where code = '<code>'
- Build a query to update the required value for the code:
update CouponCode
For example:
set <name of the field from step 4> = <value of the field from step 4> where id = <coupon ID from step 6>
update CouponCode
set ruleSet_id = 100001 where id = 900001 - Create a Change Request Jira under the SPC project including the query from step 7.
- Run the query from step 6 to check that the required values were updated properly. Also, you can find the coupon under Discounts > Coupons in Manage and review its settings.
</supportagent>
Comments
0 comments
Article is closed for comments.