Questions tagged [sales-rule]
The sales-rule tag has no summary.
34 questions
0 votes
0 answers
41 views
Add Customer Grid Condition in Sales Rule and Validate Coupon for Selected Customers
I am working on a custom module for Magento 2.4.5 that extends the Sales Rule Conditions functionality. My goal is to: Add a new condition to the "Conditions" tab in the Cart Price Rule ...
0 votes
0 answers
60 views
Coupon code is not validating the customer segment condition on cart page?
I have customer segment and sku condition in the cart rule with specific coupon code. This is working fine for sku condition but this is not working for exact customer segment id. Same coupon code is ...
1 vote
1 answer
91 views
Magento 2.4 Restrict Apply Coupon code if cart has item with 0 price
In Magento 2.4, I want to create a cart rule and that can not be applied if any product in the cart with 0 price. For Example, I have created a coupon code that allows a 20% discount on the total of ...
0 votes
2 answers
439 views
Getting coupon codes from sales rule?
Magento 2.4.6 I creates a sales rule, lets say it has ID 123. I am loading it like this for now (yes, I know ObjectManager is bad practice): $objectManager = \Magento\Framework\App\ObjectManager::...
1 vote
0 answers
192 views
Coupon code is not saving at quote table in magento 2
I upgraded my website from 2.3.6-p1 to 2.4.5-p1 . After that when i applied the cart rule with coupon code, it shows the error that The coupon code "GHSDYFEWFCER" is not valid. When ...
4 votes
0 answers
122 views
Discount Calculation Issue Magento 2
I am facing an issue with the discount calculation. There are three coupon which are applied automatically without coupon code (coupon 3, coupon 4, coupon 5) and one more coupon code which i have ...
0 votes
1 answer
56 views
I am new in magento! :: I have task to add a custom field('is_vip') in order columns. please help me?
Programatically, add a custom field('is_vip') in order. If a customer order value over $150 , the field value will be 1 and in order grid it will show yes.
1 vote
1 answer
272 views
how can discount apply on another product Y based on X Product Step Qty
I need to apply discount on another different product Y based on X Product Step Qty. So that why I was created custom simple action in sales rule. I created custom action class for calculation ...
0 votes
1 answer
812 views
Magento 2 How to Get List Products from Cart Price Rule Condition
I want to get the cart price rule applicable products list in my block. How can I get it? For catalog rule, at vendor/magento/module-catalog-rule/Model/Rule We have the method getMatchingProductIds() ...
2 votes
1 answer
1k views
How to validate a custom field in sales rule before the discount applying to cart in magento 2.4
I created three custom fields in salesrule Database Table. apply_on_weekday applicable_time_from applicable_time_to Now I wants to validate that custom fields before the applying the cart price rule ...
1 vote
1 answer
764 views
multiselect custom field does not save in sales rule admin form in magento 2.4
I need to save custom multiselect field value in the apply_on_weekday column which is located in the salesrule Db table. I tried a lot but it doesn't save the data in the database. Below is my code. ...
2 votes
1 answer
1k views
How to save extension attribute in Salesrule Api magento 2.4
I need to save custom field data in apply_on_weekday column which is located in salesrule DB table. I tried too much but it doesn't save it in DB. I share my code below. vendor\Module\etc\...
0 votes
1 answer
278 views
Create Sales Rule With Subtotal condition
I know how to create a sales rule. But i'm failing to add this rule a condition based on the subtotal Which means i Want to reproduce this programmatically I see this is added into the salesrule ...
0 votes
1 answer
466 views
Why Magento not supporting cart price rule per store
Why Magento does not support storeview level sales rules? Is there any way we can create shopping cart price rules based on store-views? Discount should apply only for particular store views
0 votes
0 answers
649 views
Add custom data to SalesRule API
I tried to add custom data to SalesRule through the endpoint V1/salesRules but ended up with getting error My code is below 1- etc/extension_attributes.xml <?xml version="1.0"?> <...