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;








2















In Magento 2.2.6, How to give 5% discount for a newly registered customer ?



Thanks in advanced!










share|improve this question






























    2















    In Magento 2.2.6, How to give 5% discount for a newly registered customer ?



    Thanks in advanced!










    share|improve this question


























      2












      2








      2








      In Magento 2.2.6, How to give 5% discount for a newly registered customer ?



      Thanks in advanced!










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday









      ABHISHEK TRIPATHI

      2,1641828




      2,1641828










      asked yesterday









      Hardik MakwanaHardik Makwana

      11210




      11210




















          3 Answers
          3






          active

          oldest

          votes


















          1














          For this requirement, you have to build a custom module and your custom module have below section.



          1. Run an observer on customer_register_success.On this observer create a Shopping Cart rules programmatically.


          2. 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.






          share|improve this answer

























          • 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


















          1














          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.






          share|improve this answer






























            1














            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.






            share|improve this answer























              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
              );



              );













              draft saved

              draft discarded


















              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









              1














              For this requirement, you have to build a custom module and your custom module have below section.



              1. Run an observer on customer_register_success.On this observer create a Shopping Cart rules programmatically.


              2. 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.






              share|improve this answer

























              • 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















              1














              For this requirement, you have to build a custom module and your custom module have below section.



              1. Run an observer on customer_register_success.On this observer create a Shopping Cart rules programmatically.


              2. 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.






              share|improve this answer

























              • 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













              1












              1








              1







              For this requirement, you have to build a custom module and your custom module have below section.



              1. Run an observer on customer_register_success.On this observer create a Shopping Cart rules programmatically.


              2. 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.






              share|improve this answer















              For this requirement, you have to build a custom module and your custom module have below section.



              1. Run an observer on customer_register_success.On this observer create a Shopping Cart rules programmatically.


              2. 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.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited yesterday









              Rakesh Donga

              2,465316




              2,465316










              answered yesterday









              Amit BeraAmit 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

















              • 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













              1














              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.






              share|improve this answer



























                1














                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.






                share|improve this answer

























                  1












                  1








                  1







                  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.






                  share|improve this answer













                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered yesterday









                  Yash ShahYash Shah

                  79618




                  79618





















                      1














                      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.






                      share|improve this answer



























                        1














                        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.






                        share|improve this answer

























                          1












                          1








                          1







                          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.






                          share|improve this answer













                          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.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered yesterday









                          ABHISHEK TRIPATHIABHISHEK TRIPATHI

                          2,1641828




                          2,1641828



























                              draft saved

                              draft discarded
















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                              Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                              Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form