0

How to create a new coupon for a specific User and SKU using magento 2.2?

0

Native Magento does not have a function to create a coupon code for a specific user account. However, what you could do is create a customer group ( Stores > Other Settings > Customer Groups) and assign that user to the customer group.

Next, create a cart price rule ( >Marketing> Cart Price Rule ) that is just for that customer group. enter image description here

To make the voucher code specific to the SKU firstly go to > Stores > Attributes > Products menu item and search for the SKU in the grid.

Go to the 'Storefront Properties' tab and look for the 'Use for Promo Rule Conditions' setting. Set this to 'Yes' - this will allow you to interrogate this value in the Cart rule.

enter image description here

Go back to the cart rule and under the 'Actions' tab go to the rule builder 'Apply the rule only to cart items matching the following conditions (leave blank for all items).'

Select the green plus and you will see under 'Product Attributes' that SKU is available to interrogate.

Screen shot of Cart rule

The resulting rule will only apply a discount to SKUs you have included in the Actions tab and the customers who are in the customer group(s) applied in the rule information tab.

  • How to do in programmatically – senthil Mar 11 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.