Magento 2 New user give the discount The 2019 Stack Overflow Developer Survey Results Are Inapply highest discountCreate discount rule to give rounded discountMaximum discount percent magentoHow to get selected percentage discount all productsdiscount on multiple of X itemShopping Cart Rules for New Sign Up/Registered CustomersHow can i give discount for random 2 products get 10% discountcart total percentage discount in magento 1.9Magento 2 : Automatic Discount For First 100 Customersmagento 2 apply default discount code
How do I free up internal storage if I don't have any apps downloaded?
Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?
How to type a long/em dash `—`
Does HR tell a hiring manager about salary negotiations?
How to support a colleague who finds meetings extremely tiring?
Straighten subgroup lattice
The phrase "to the numbers born"?
Cooking pasta in a water boiler
Accepted by European university, rejected by all American ones I applied to? Possible reasons?
Why can't devices on different VLANs, but on the same subnet, communicate?
What is this business jet?
Worn-tile Scrabble
Can there be female White Walkers?
Does adding complexity mean a more secure cipher?
Why not take a picture of a closer black hole?
If I can cast sorceries at instant speed, can I use sorcery-speed activated abilities at instant speed?
Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?
Kerning for subscripts of sigma?
A word that means fill it to the required quantity
Is Cinnamon a desktop environment or a window manager? (Or both?)
Pokemon Turn Based battle (Python)
Why does the nucleus not repel itself?
How did passengers keep warm on sail ships?
Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?
Magento 2 New user give the discount
The 2019 Stack Overflow Developer Survey Results Are Inapply highest discountCreate discount rule to give rounded discountMaximum discount percent magentoHow to get selected percentage discount all productsdiscount on multiple of X itemShopping Cart Rules for New Sign Up/Registered CustomersHow can i give discount for random 2 products get 10% discountcart total percentage discount in magento 1.9Magento 2 : Automatic Discount For First 100 Customersmagento 2 apply default discount code
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
In Magento 2.2.6, How to give 5% discount for a newly registered customer ?
Thanks in advanced!
customer shopping-cart-price-rules magento2.2.6 discount
add a comment |
In Magento 2.2.6, How to give 5% discount for a newly registered customer ?
Thanks in advanced!
customer shopping-cart-price-rules magento2.2.6 discount
add a comment |
In Magento 2.2.6, How to give 5% discount for a newly registered customer ?
Thanks in advanced!
customer shopping-cart-price-rules magento2.2.6 discount
In Magento 2.2.6, How to give 5% discount for a newly registered customer ?
Thanks in advanced!
customer shopping-cart-price-rules magento2.2.6 discount
customer shopping-cart-price-rules magento2.2.6 discount
edited yesterday
ABHISHEK TRIPATHI
2,1641828
2,1641828
asked yesterday
Hardik MakwanaHardik Makwana
11210
11210
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
For this requirement, you have to build a custom module and your custom module have below section.
Run an observer on
customer_register_success
.On this observer create a Shopping Cart rules programmatically.Send that Coupon to the customer using a custom email.
Observer code:
<?php
namespace StackexchangeMagentoObserver;
use MagentoSalesRuleApiCouponRepositoryInterface;
use MagentoSalesRuleApiDataCouponInterface;
use MagentoSalesRuleApiDataRuleInterface;
use MagentoSalesRuleApiRuleRepositoryInterface;
use MagentoSalesRuleModelCouponFactory;
use MagentoSalesRuleModelRuleFactory;
use MagentoFrameworkMathRandom;
class CreateCouponCustomer implements MagentoFrameworkEventObserverInterface
/**
* @var Random
*/
private $random;
/**
* @var CouponFactory
*/
private $couponFactory;
/**
* @var RuleFactory
*/
private $ruleFactory;
/**
* @var CouponRepositoryInterface
*/
private $couponRepository;
/**
* @var RuleRepositoryInterface
*/
private $RuleRepository;
public function __construct(
CouponRepositoryInterface $couponRepository,
RuleRepositoryInterface $RuleRepository,
CouponFactory $couponFactory,
RuleFactory $ruleFactory,
Random $random
)
$this->RuleRepository = $RuleRepository;
$this->couponRepository = $couponRepository;
$this->ruleFactory = $ruleFactory;
$this->couponFactory = $couponFactory;
$this->random = $random;
public function execute(MagentoFrameworkEventObserver $observer)
$customer = $observer->getEvent()->getCustomer();
$rule = $this->ruleFactory->create();
$rule->setName('5% discount')
->setIsAdvanced(true)
->setStopRulesProcessing(false)
->setDiscountQty(10)
->setCustomerGroupIds([$customer->getGroupId()])
->setWebsiteIds([1])
->setCouponType(RuleInterface::COUPON_TYPE_SPECIFIC_COUPON)
->setSimpleAction(RuleInterface::DISCOUNT_ACTION_FIXED_AMOUNT_FOR_CART)
->setDiscountAmount(10)
->setIsActive(true);
try
$resultRules = $this->RuleRepository->save($rule);
$this->createCouponCode($resultRules);
catch (MagentoFrameworkExceptionLocalizedException $ex)
private function createCouponCode(RuleInterface $rule)
$couponCode = $this->random->getRandomString(8);
$coupon = $this->couponFactory->create();
$coupon->setCode($couponCode)
->setIsPrimary(1)
->setRuleId($rule->getRuleId());
$this->couponRepository->save($coupon);
For sending the email,you can use this link.
any readymate module available for this ?
– Hardik Makwana
yesterday
I don't have the idea on the readymate module
– Amit Bera♦
yesterday
any reference of a extension ?
– Hardik Makwana
yesterday
add a comment |
Based on your question, i assume that you want to give discount to your customer for their first order.
So you can create a shopping cart rule with 5% discount keeping Uses per Customer as 1. So it will apply discount for only one time or for the first order you can say. For the second order, it wont be applicable as per magento default. If you go by this, you do not need to create coupon code and let it entered by custom on cart. You can advertise any where on your site that customer will get 5% discount on their first order. For example, you can show this message to register page. In this case, discount will automatically apply without any custom input.
But in case you want only for customers, signup after certain date, you need to create a plugin and a small function which will do the job for you.
Let me know if above will fulfil your requirement or you still want to create a plugin.
add a comment |
You can achieve this by the following manner.
Create a simple cart price rule.
- Go to Admin > Marketing > Promotions > Cart Price Rule.
- Click on the Add new rule
- Make that cart price rule to have & applied using a specific coupon code set it as you want.
- Allow that coupon code to be applied only once per customer (User Per Customer) & coupon can be used so many times because same coupon is going to be used by multiple users (better leave this field (Uses Per Coupons) empty).
- Define the amount of discount & the expiry date of that coupon code.
Create a custom email template
- Go to Admin > Marketing > Communication > Email Templates section.
- Click on the New Email Template.
- In load default template Template drop-down select New Account from Magento_Customer click on the load template.
- Set the name of the template for proper identification.
- Add your coupon code into that email template with the required text.
- Click on the Preview Template to see the preview of the template & if everything is okay click on the save button.
Now lets replace this custom mail with the default mail.
- Go to Admin > Stores > Settings > Configuration.
- Go to Customer > Customer Configuration.
- In Default Welcome Email drop-down select the custom mail that you have created.
- Save the configuration & flush the cache.
Now to test this create a new customer & test the coupon code on the cart page.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269470%2fmagento-2-new-user-give-the-discount%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
For this requirement, you have to build a custom module and your custom module have below section.
Run an observer on
customer_register_success
.On this observer create a Shopping Cart rules programmatically.Send that Coupon to the customer using a custom email.
Observer code:
<?php
namespace StackexchangeMagentoObserver;
use MagentoSalesRuleApiCouponRepositoryInterface;
use MagentoSalesRuleApiDataCouponInterface;
use MagentoSalesRuleApiDataRuleInterface;
use MagentoSalesRuleApiRuleRepositoryInterface;
use MagentoSalesRuleModelCouponFactory;
use MagentoSalesRuleModelRuleFactory;
use MagentoFrameworkMathRandom;
class CreateCouponCustomer implements MagentoFrameworkEventObserverInterface
/**
* @var Random
*/
private $random;
/**
* @var CouponFactory
*/
private $couponFactory;
/**
* @var RuleFactory
*/
private $ruleFactory;
/**
* @var CouponRepositoryInterface
*/
private $couponRepository;
/**
* @var RuleRepositoryInterface
*/
private $RuleRepository;
public function __construct(
CouponRepositoryInterface $couponRepository,
RuleRepositoryInterface $RuleRepository,
CouponFactory $couponFactory,
RuleFactory $ruleFactory,
Random $random
)
$this->RuleRepository = $RuleRepository;
$this->couponRepository = $couponRepository;
$this->ruleFactory = $ruleFactory;
$this->couponFactory = $couponFactory;
$this->random = $random;
public function execute(MagentoFrameworkEventObserver $observer)
$customer = $observer->getEvent()->getCustomer();
$rule = $this->ruleFactory->create();
$rule->setName('5% discount')
->setIsAdvanced(true)
->setStopRulesProcessing(false)
->setDiscountQty(10)
->setCustomerGroupIds([$customer->getGroupId()])
->setWebsiteIds([1])
->setCouponType(RuleInterface::COUPON_TYPE_SPECIFIC_COUPON)
->setSimpleAction(RuleInterface::DISCOUNT_ACTION_FIXED_AMOUNT_FOR_CART)
->setDiscountAmount(10)
->setIsActive(true);
try
$resultRules = $this->RuleRepository->save($rule);
$this->createCouponCode($resultRules);
catch (MagentoFrameworkExceptionLocalizedException $ex)
private function createCouponCode(RuleInterface $rule)
$couponCode = $this->random->getRandomString(8);
$coupon = $this->couponFactory->create();
$coupon->setCode($couponCode)
->setIsPrimary(1)
->setRuleId($rule->getRuleId());
$this->couponRepository->save($coupon);
For sending the email,you can use this link.
any readymate module available for this ?
– Hardik Makwana
yesterday
I don't have the idea on the readymate module
– Amit Bera♦
yesterday
any reference of a extension ?
– Hardik Makwana
yesterday
add a comment |
For this requirement, you have to build a custom module and your custom module have below section.
Run an observer on
customer_register_success
.On this observer create a Shopping Cart rules programmatically.Send that Coupon to the customer using a custom email.
Observer code:
<?php
namespace StackexchangeMagentoObserver;
use MagentoSalesRuleApiCouponRepositoryInterface;
use MagentoSalesRuleApiDataCouponInterface;
use MagentoSalesRuleApiDataRuleInterface;
use MagentoSalesRuleApiRuleRepositoryInterface;
use MagentoSalesRuleModelCouponFactory;
use MagentoSalesRuleModelRuleFactory;
use MagentoFrameworkMathRandom;
class CreateCouponCustomer implements MagentoFrameworkEventObserverInterface
/**
* @var Random
*/
private $random;
/**
* @var CouponFactory
*/
private $couponFactory;
/**
* @var RuleFactory
*/
private $ruleFactory;
/**
* @var CouponRepositoryInterface
*/
private $couponRepository;
/**
* @var RuleRepositoryInterface
*/
private $RuleRepository;
public function __construct(
CouponRepositoryInterface $couponRepository,
RuleRepositoryInterface $RuleRepository,
CouponFactory $couponFactory,
RuleFactory $ruleFactory,
Random $random
)
$this->RuleRepository = $RuleRepository;
$this->couponRepository = $couponRepository;
$this->ruleFactory = $ruleFactory;
$this->couponFactory = $couponFactory;
$this->random = $random;
public function execute(MagentoFrameworkEventObserver $observer)
$customer = $observer->getEvent()->getCustomer();
$rule = $this->ruleFactory->create();
$rule->setName('5% discount')
->setIsAdvanced(true)
->setStopRulesProcessing(false)
->setDiscountQty(10)
->setCustomerGroupIds([$customer->getGroupId()])
->setWebsiteIds([1])
->setCouponType(RuleInterface::COUPON_TYPE_SPECIFIC_COUPON)
->setSimpleAction(RuleInterface::DISCOUNT_ACTION_FIXED_AMOUNT_FOR_CART)
->setDiscountAmount(10)
->setIsActive(true);
try
$resultRules = $this->RuleRepository->save($rule);
$this->createCouponCode($resultRules);
catch (MagentoFrameworkExceptionLocalizedException $ex)
private function createCouponCode(RuleInterface $rule)
$couponCode = $this->random->getRandomString(8);
$coupon = $this->couponFactory->create();
$coupon->setCode($couponCode)
->setIsPrimary(1)
->setRuleId($rule->getRuleId());
$this->couponRepository->save($coupon);
For sending the email,you can use this link.
any readymate module available for this ?
– Hardik Makwana
yesterday
I don't have the idea on the readymate module
– Amit Bera♦
yesterday
any reference of a extension ?
– Hardik Makwana
yesterday
add a comment |
For this requirement, you have to build a custom module and your custom module have below section.
Run an observer on
customer_register_success
.On this observer create a Shopping Cart rules programmatically.Send that Coupon to the customer using a custom email.
Observer code:
<?php
namespace StackexchangeMagentoObserver;
use MagentoSalesRuleApiCouponRepositoryInterface;
use MagentoSalesRuleApiDataCouponInterface;
use MagentoSalesRuleApiDataRuleInterface;
use MagentoSalesRuleApiRuleRepositoryInterface;
use MagentoSalesRuleModelCouponFactory;
use MagentoSalesRuleModelRuleFactory;
use MagentoFrameworkMathRandom;
class CreateCouponCustomer implements MagentoFrameworkEventObserverInterface
/**
* @var Random
*/
private $random;
/**
* @var CouponFactory
*/
private $couponFactory;
/**
* @var RuleFactory
*/
private $ruleFactory;
/**
* @var CouponRepositoryInterface
*/
private $couponRepository;
/**
* @var RuleRepositoryInterface
*/
private $RuleRepository;
public function __construct(
CouponRepositoryInterface $couponRepository,
RuleRepositoryInterface $RuleRepository,
CouponFactory $couponFactory,
RuleFactory $ruleFactory,
Random $random
)
$this->RuleRepository = $RuleRepository;
$this->couponRepository = $couponRepository;
$this->ruleFactory = $ruleFactory;
$this->couponFactory = $couponFactory;
$this->random = $random;
public function execute(MagentoFrameworkEventObserver $observer)
$customer = $observer->getEvent()->getCustomer();
$rule = $this->ruleFactory->create();
$rule->setName('5% discount')
->setIsAdvanced(true)
->setStopRulesProcessing(false)
->setDiscountQty(10)
->setCustomerGroupIds([$customer->getGroupId()])
->setWebsiteIds([1])
->setCouponType(RuleInterface::COUPON_TYPE_SPECIFIC_COUPON)
->setSimpleAction(RuleInterface::DISCOUNT_ACTION_FIXED_AMOUNT_FOR_CART)
->setDiscountAmount(10)
->setIsActive(true);
try
$resultRules = $this->RuleRepository->save($rule);
$this->createCouponCode($resultRules);
catch (MagentoFrameworkExceptionLocalizedException $ex)
private function createCouponCode(RuleInterface $rule)
$couponCode = $this->random->getRandomString(8);
$coupon = $this->couponFactory->create();
$coupon->setCode($couponCode)
->setIsPrimary(1)
->setRuleId($rule->getRuleId());
$this->couponRepository->save($coupon);
For sending the email,you can use this link.
For this requirement, you have to build a custom module and your custom module have below section.
Run an observer on
customer_register_success
.On this observer create a Shopping Cart rules programmatically.Send that Coupon to the customer using a custom email.
Observer code:
<?php
namespace StackexchangeMagentoObserver;
use MagentoSalesRuleApiCouponRepositoryInterface;
use MagentoSalesRuleApiDataCouponInterface;
use MagentoSalesRuleApiDataRuleInterface;
use MagentoSalesRuleApiRuleRepositoryInterface;
use MagentoSalesRuleModelCouponFactory;
use MagentoSalesRuleModelRuleFactory;
use MagentoFrameworkMathRandom;
class CreateCouponCustomer implements MagentoFrameworkEventObserverInterface
/**
* @var Random
*/
private $random;
/**
* @var CouponFactory
*/
private $couponFactory;
/**
* @var RuleFactory
*/
private $ruleFactory;
/**
* @var CouponRepositoryInterface
*/
private $couponRepository;
/**
* @var RuleRepositoryInterface
*/
private $RuleRepository;
public function __construct(
CouponRepositoryInterface $couponRepository,
RuleRepositoryInterface $RuleRepository,
CouponFactory $couponFactory,
RuleFactory $ruleFactory,
Random $random
)
$this->RuleRepository = $RuleRepository;
$this->couponRepository = $couponRepository;
$this->ruleFactory = $ruleFactory;
$this->couponFactory = $couponFactory;
$this->random = $random;
public function execute(MagentoFrameworkEventObserver $observer)
$customer = $observer->getEvent()->getCustomer();
$rule = $this->ruleFactory->create();
$rule->setName('5% discount')
->setIsAdvanced(true)
->setStopRulesProcessing(false)
->setDiscountQty(10)
->setCustomerGroupIds([$customer->getGroupId()])
->setWebsiteIds([1])
->setCouponType(RuleInterface::COUPON_TYPE_SPECIFIC_COUPON)
->setSimpleAction(RuleInterface::DISCOUNT_ACTION_FIXED_AMOUNT_FOR_CART)
->setDiscountAmount(10)
->setIsActive(true);
try
$resultRules = $this->RuleRepository->save($rule);
$this->createCouponCode($resultRules);
catch (MagentoFrameworkExceptionLocalizedException $ex)
private function createCouponCode(RuleInterface $rule)
$couponCode = $this->random->getRandomString(8);
$coupon = $this->couponFactory->create();
$coupon->setCode($couponCode)
->setIsPrimary(1)
->setRuleId($rule->getRuleId());
$this->couponRepository->save($coupon);
For sending the email,you can use this link.
edited yesterday
Rakesh Donga
2,465316
2,465316
answered yesterday
Amit Bera♦Amit Bera
59.9k1677178
59.9k1677178
any readymate module available for this ?
– Hardik Makwana
yesterday
I don't have the idea on the readymate module
– Amit Bera♦
yesterday
any reference of a extension ?
– Hardik Makwana
yesterday
add a comment |
any readymate module available for this ?
– Hardik Makwana
yesterday
I don't have the idea on the readymate module
– Amit Bera♦
yesterday
any reference of a extension ?
– Hardik Makwana
yesterday
any readymate module available for this ?
– Hardik Makwana
yesterday
any readymate module available for this ?
– Hardik Makwana
yesterday
I don't have the idea on the readymate module
– Amit Bera♦
yesterday
I don't have the idea on the readymate module
– Amit Bera♦
yesterday
any reference of a extension ?
– Hardik Makwana
yesterday
any reference of a extension ?
– Hardik Makwana
yesterday
add a comment |
Based on your question, i assume that you want to give discount to your customer for their first order.
So you can create a shopping cart rule with 5% discount keeping Uses per Customer as 1. So it will apply discount for only one time or for the first order you can say. For the second order, it wont be applicable as per magento default. If you go by this, you do not need to create coupon code and let it entered by custom on cart. You can advertise any where on your site that customer will get 5% discount on their first order. For example, you can show this message to register page. In this case, discount will automatically apply without any custom input.
But in case you want only for customers, signup after certain date, you need to create a plugin and a small function which will do the job for you.
Let me know if above will fulfil your requirement or you still want to create a plugin.
add a comment |
Based on your question, i assume that you want to give discount to your customer for their first order.
So you can create a shopping cart rule with 5% discount keeping Uses per Customer as 1. So it will apply discount for only one time or for the first order you can say. For the second order, it wont be applicable as per magento default. If you go by this, you do not need to create coupon code and let it entered by custom on cart. You can advertise any where on your site that customer will get 5% discount on their first order. For example, you can show this message to register page. In this case, discount will automatically apply without any custom input.
But in case you want only for customers, signup after certain date, you need to create a plugin and a small function which will do the job for you.
Let me know if above will fulfil your requirement or you still want to create a plugin.
add a comment |
Based on your question, i assume that you want to give discount to your customer for their first order.
So you can create a shopping cart rule with 5% discount keeping Uses per Customer as 1. So it will apply discount for only one time or for the first order you can say. For the second order, it wont be applicable as per magento default. If you go by this, you do not need to create coupon code and let it entered by custom on cart. You can advertise any where on your site that customer will get 5% discount on their first order. For example, you can show this message to register page. In this case, discount will automatically apply without any custom input.
But in case you want only for customers, signup after certain date, you need to create a plugin and a small function which will do the job for you.
Let me know if above will fulfil your requirement or you still want to create a plugin.
Based on your question, i assume that you want to give discount to your customer for their first order.
So you can create a shopping cart rule with 5% discount keeping Uses per Customer as 1. So it will apply discount for only one time or for the first order you can say. For the second order, it wont be applicable as per magento default. If you go by this, you do not need to create coupon code and let it entered by custom on cart. You can advertise any where on your site that customer will get 5% discount on their first order. For example, you can show this message to register page. In this case, discount will automatically apply without any custom input.
But in case you want only for customers, signup after certain date, you need to create a plugin and a small function which will do the job for you.
Let me know if above will fulfil your requirement or you still want to create a plugin.
answered yesterday
Yash ShahYash Shah
79618
79618
add a comment |
add a comment |
You can achieve this by the following manner.
Create a simple cart price rule.
- Go to Admin > Marketing > Promotions > Cart Price Rule.
- Click on the Add new rule
- Make that cart price rule to have & applied using a specific coupon code set it as you want.
- Allow that coupon code to be applied only once per customer (User Per Customer) & coupon can be used so many times because same coupon is going to be used by multiple users (better leave this field (Uses Per Coupons) empty).
- Define the amount of discount & the expiry date of that coupon code.
Create a custom email template
- Go to Admin > Marketing > Communication > Email Templates section.
- Click on the New Email Template.
- In load default template Template drop-down select New Account from Magento_Customer click on the load template.
- Set the name of the template for proper identification.
- Add your coupon code into that email template with the required text.
- Click on the Preview Template to see the preview of the template & if everything is okay click on the save button.
Now lets replace this custom mail with the default mail.
- Go to Admin > Stores > Settings > Configuration.
- Go to Customer > Customer Configuration.
- In Default Welcome Email drop-down select the custom mail that you have created.
- Save the configuration & flush the cache.
Now to test this create a new customer & test the coupon code on the cart page.
add a comment |
You can achieve this by the following manner.
Create a simple cart price rule.
- Go to Admin > Marketing > Promotions > Cart Price Rule.
- Click on the Add new rule
- Make that cart price rule to have & applied using a specific coupon code set it as you want.
- Allow that coupon code to be applied only once per customer (User Per Customer) & coupon can be used so many times because same coupon is going to be used by multiple users (better leave this field (Uses Per Coupons) empty).
- Define the amount of discount & the expiry date of that coupon code.
Create a custom email template
- Go to Admin > Marketing > Communication > Email Templates section.
- Click on the New Email Template.
- In load default template Template drop-down select New Account from Magento_Customer click on the load template.
- Set the name of the template for proper identification.
- Add your coupon code into that email template with the required text.
- Click on the Preview Template to see the preview of the template & if everything is okay click on the save button.
Now lets replace this custom mail with the default mail.
- Go to Admin > Stores > Settings > Configuration.
- Go to Customer > Customer Configuration.
- In Default Welcome Email drop-down select the custom mail that you have created.
- Save the configuration & flush the cache.
Now to test this create a new customer & test the coupon code on the cart page.
add a comment |
You can achieve this by the following manner.
Create a simple cart price rule.
- Go to Admin > Marketing > Promotions > Cart Price Rule.
- Click on the Add new rule
- Make that cart price rule to have & applied using a specific coupon code set it as you want.
- Allow that coupon code to be applied only once per customer (User Per Customer) & coupon can be used so many times because same coupon is going to be used by multiple users (better leave this field (Uses Per Coupons) empty).
- Define the amount of discount & the expiry date of that coupon code.
Create a custom email template
- Go to Admin > Marketing > Communication > Email Templates section.
- Click on the New Email Template.
- In load default template Template drop-down select New Account from Magento_Customer click on the load template.
- Set the name of the template for proper identification.
- Add your coupon code into that email template with the required text.
- Click on the Preview Template to see the preview of the template & if everything is okay click on the save button.
Now lets replace this custom mail with the default mail.
- Go to Admin > Stores > Settings > Configuration.
- Go to Customer > Customer Configuration.
- In Default Welcome Email drop-down select the custom mail that you have created.
- Save the configuration & flush the cache.
Now to test this create a new customer & test the coupon code on the cart page.
You can achieve this by the following manner.
Create a simple cart price rule.
- Go to Admin > Marketing > Promotions > Cart Price Rule.
- Click on the Add new rule
- Make that cart price rule to have & applied using a specific coupon code set it as you want.
- Allow that coupon code to be applied only once per customer (User Per Customer) & coupon can be used so many times because same coupon is going to be used by multiple users (better leave this field (Uses Per Coupons) empty).
- Define the amount of discount & the expiry date of that coupon code.
Create a custom email template
- Go to Admin > Marketing > Communication > Email Templates section.
- Click on the New Email Template.
- In load default template Template drop-down select New Account from Magento_Customer click on the load template.
- Set the name of the template for proper identification.
- Add your coupon code into that email template with the required text.
- Click on the Preview Template to see the preview of the template & if everything is okay click on the save button.
Now lets replace this custom mail with the default mail.
- Go to Admin > Stores > Settings > Configuration.
- Go to Customer > Customer Configuration.
- In Default Welcome Email drop-down select the custom mail that you have created.
- Save the configuration & flush the cache.
Now to test this create a new customer & test the coupon code on the cart page.
answered yesterday
ABHISHEK TRIPATHIABHISHEK TRIPATHI
2,1641828
2,1641828
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269470%2fmagento-2-new-user-give-the-discount%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown