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 ...
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 ...
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 ...
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 ...
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
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 ...
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();
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 ...
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 ...
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/...
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!
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/...
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}\{...
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-...
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
...
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/...
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()->...
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\...
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 ...
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 ...
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 ...
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.
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\...
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()
->...
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'));
}
...
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 ...
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>
<...
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->...
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 $...
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 \...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
coupon-codes × 276coupon × 79
magento2 × 75
shopping-cart-price-rules × 68
magento-1.9 × 53
discount × 29
checkout × 24
promotions × 13
cart × 12
magento-1 × 10
magento-2.1 × 9
magento-1.8 × 9
magento-enterprise × 8
magento2.3 × 7
magento-1.7 × 7
ce-1.9.0.1 × 7
shopping-cart × 7
free-shipping × 7
sales-rule × 7
onepage-checkout × 6
price-rules × 6
magento2.2 × 5
orders × 5
sales-order × 5
rest-api × 5