Skip to main content
15 votes

How do I apply coupon codes for newly registered customers only in Magento 1.9?

I'll create a module which does this in order to give more insight into how it's done. We're going to use setup scripts (for attribute setup), event observers, condition model and a helper class. I'm ...
versedi's user avatar
  • 2,059
13 votes
Accepted

Message is added to queue, wait to get your coupons soon

try to manually process queue with this command bin/magento queue:consumers:list view a list of all consumers bin/magento queue:consumers:start <queue_name> pass queue_name for process the ...
Chandresh Chauhan's user avatar
7 votes
Accepted

Coupon code only applicable for certain product?

Yes this is possible with magento. You can make a coupon code specific for products, In admin panel Store -> Attributes -> product Search SKU in default label and edit the attribute. In ...
aravind's user avatar
  • 1,854
6 votes
Accepted

Coupon code validation

Take a look at the class Magento\SalesRule\Model\Utility located at the vendor/magento/module-sales-rule/Model/Utility.php. Coupon code validation starts in the method canProcessRule() where it can ...
Siarhey Uchukhlebau's user avatar
6 votes

Message is added to queue, wait to get your coupons soon

Try running the following commands: bin/magento cron:run bin/magento queue:consumers:start codegeneratorProcessor
Siddhant Lohia's user avatar
5 votes
Accepted

Check if coupon code already exist in magento 2

protected $_coupon; in construct add this public function __construct( \Magento\SalesRule\Model\Coupon $coupon ) { $this->_coupon = $coupon; } Now you can use ...
Keyur Shah's user avatar
  • 18.1k
5 votes
Accepted

Magento 2: Get Coupon Code for Order in Order Success Observer

For getting the coupon code of an order, you should use $order->getCouponCode();
Amit Bera's user avatar
  • 77.6k
4 votes

Is there is a way to apply automatic coupon code in Magento 2 if total is greater than 1000?

You can just create a cart price rule that does not have a coupon code and it's valid for orders over 1000. It will not apply a coupon code (because there is none) but the user will see in the ...
Marius's user avatar
  • 198k
3 votes

Promotinal coupon generation problem

Check Coupon * field in edit rule action in admin. You can find it in General Information tab Coupon * should be specific coupon not no coupon Also Use Auto Generation checkbox should be check. Let ...
Suresh Chikani's user avatar
3 votes

Is there a way to pass a coupon code as a URL parameter?

I wrote something that's free and open source which does exactly what you need and doesn't require items to already be in the cart. You can find it here: https://github.com/crankycyclops/...
Crankycyclops's user avatar
3 votes

How to get Coupon Code on Success Page in Magento 2

TL;DR Get the order collection on success page and filter it by the recent order increment id and get the coupon code of the order e.g. $order->getCouponCode(); Good Luck!
PROGOSTECH's user avatar
3 votes
Accepted

how to show Promo code or coupon code on Checkout page in magento 1.9

You can call coupon code at checkout by following code: <div class="custom-coupan"> <?php echo $this->getLayout()->createBlock('checkout/cart_coupon') ->setTemplate('checkout/...
Pawan's user avatar
  • 5,961
3 votes
Accepted

Get RuleId from Coupon Code in checkout\cart\item\default.phtml

Yes, you can get rule_id by coupon_code Try this to get the rule id using helper In your helper <?php namespace {Vendor}\{...
Prathap Gunasekaran's user avatar
3 votes

how to get all coupon code which can apply on cart page in magento 2

There is already a full fledged free extension available on magento's marketplace and github magento: https://marketplace.magento.com/ambab-module-couponlist.html github: https://github.com/ambab-...
Yash Patadia's user avatar
3 votes

Magento2.3 generate coupon codes not generating

To view a list of all consumers, execute the below command in terminal bin/magento queue:consumers:list The above command will give list as below : product_action_attribute.update ...
Madani Hardik's user avatar
2 votes
Accepted

where to change Coupon code is not valid error message

Show custom error messages on cart page Hi in this article i will try to tell you all about how to show custom error messages or popups on cartpage in the below folder app/code/core/Mage/Checkout/...
Chandan Dubey's user avatar
2 votes
Accepted

How to get applied coupon code in observer Magento 2?

In your execute() method of your observer you can call the following code to get the coupon code: $controller = $observer->getControllerAction(); $couponCode = $controller->getRequest()->...
Raphael at Digital Pianism's user avatar
2 votes
Accepted

Magento 2:- Apply custom coupon code

First you need to inject a few classes in your constructor: protected $cart; protected $quoteRepository; public function __construct( ... \Magento\Checkout\Model\Cart $cart, \Magento\...
Raphael at Digital Pianism's user avatar
2 votes

How many coupon codes I can create at a time in Magento?

It sounds like you reached the maximum execution time in PHP. You can update this by updating your PHP ini file setting. This can be done a number of ways depending on your PHP install. By default PHP ...
philwinkle's user avatar
  • 35.8k
2 votes
Accepted

Promotinal coupon generation problem

You can generate coupon code by simply selecting Specific Coupon option under Rule Information tab You can only use Manage coupon codes if Use Auto Generation option was selected in first step. If ...
Devtype's user avatar
  • 3,008
2 votes
Accepted

Magento 2 - How to generate coupon code?

The process of generating coupon code in Magento 2 is almost similar to Magento previous versions such as 1.9 etc You can generate it under Marketing -> Cart Price Rules -> Add New Rule For ...
Pankaj Sharma's user avatar
2 votes

Apply free shipping coupon code only for spefic shipping method

Magento Provide Shipping Method condition it self, You need to select that shipping method into condition section, For which you want to generate coupen code. See the screen-sort.
Dhiren Vasoya's user avatar
2 votes

How to generate a coupon code for a specific rule in magento 2?

We need to know: \Magento\SalesRule\Api\CouponManagementInterface - \Magento\SalesRule\Model\Service\CouponManagementService to generate coupon code. \Magento\SalesRule\Api\Data\...
Khoa TruongDinh's user avatar
2 votes
Accepted

How to remove applied coupon code in a custom controller on Magento 2

You should try setCouponCode('') with empty value. $this->checkoutSession->getQuote()->setCouponCode('') ->collectTotals() ->...
Khoa TruongDinh's user avatar
2 votes
Accepted

Magento 1.9.3.2 coupon code active remove cash on delivery

I got the solution go to /app/code/local/Mage/Payment/Model/Method/Cashondelivery.php After this line public function getInstructions() { return trim($this->getConfigData('instructions')); } ...
Ramesh S's user avatar
  • 1,235
2 votes

Magento 1.9.3.2 coupon code active remove cash on delivery

Better than overriding the Model Class , we can use the Event and Observer for this purpose. We can use payment_method_is_active public function HideCODforCouponCode($observer) { $event ...
Rahul's user avatar
  • 331
2 votes

Magento 1.9.3.2 coupon code active remove cash on delivery

Inside your custom module's config.xml under add the following code. <events> <payment_method_is_active> <observers> <...
Rahul's user avatar
  • 331
2 votes
Accepted

Magento 2.2.2: Discount code not showing in invoice

Managed to get this resolved. The issue was not with Magento Core, but with the MageWorx Magento 2 Gift Cards Extension. The extension came with a custom discount model to use in $invoice->...
sduif's user avatar
  • 975
2 votes

How to get Coupon Code on Success Page in Magento 2

Create File Coupon.php in app/code/Vendor/Module/Block <?php namespace Vendor\Module\Block; use Magento\Framework\View\Element\Template; class Coupon extends Template { protected $...
Ansar Husain's user avatar
  • 3,469
2 votes
Accepted

How to get Coupon Code on Success Page in Magento 2

question is not clear about coupon code. but after reading the comment it make clear you want to get coupon code based on rule id. namespace QaisarSatti\Module\Block; class CouponCode extends \...
Qaisar Satti's user avatar
  • 32.5k

Only top scored, non community-wiki answers of a minimum length are eligible