2022 Developer Survey is open! Take survey.

Questions tagged [sales-rule]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 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"?> <...
user avatar
  • 121
0 votes
1 answer
30 views

Magento 2 Error while canceling the order

I'm facing the below error while canceling the order SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magentodb`.`...
user avatar
  • 1,838
0 votes
0 answers
27 views

Add New Sales Rule Action Logic

I need to add logic to a new action that I have added to the dropdown of a sales rule. Essentially I need to change the Buy X get Y Free rule so that it works differently. So I have added a new action ...
user avatar
  • 11
0 votes
1 answer
212 views

Adding a new auto-increment field to the table `salesrule_coupon_usage` table returns a SQL error on setup:upgrade step

In my custom module (tested on Magento CE 2.4.2-p1) feature of tracking the Sales Coupon usages sometimes have no info about Customer ID, and it is acceptable case. So I need to change table ...
user avatar
0 votes
0 answers
106 views

Cart Price Rules - Discard Subsequent rules with Exceptions

should sound weird, but is there a way to allow another rule to work though discard subsequent rules is set to Yes. I tried giving Priority 1 to my current rule, and priority 0 to the other rule, they ...
user avatar
  • 13
0 votes
1 answer
48 views

How Does magento sales rule validate date and apply rule only if it is within range date

I was looking in to core module for sales rule but was unable to find the logic where it actually apply the filtration of current date and date added in rule that is From and To. If i have created 3 ...
user avatar
0 votes
1 answer
20 views

Where is row_id column definition in magento module-sales-rule module source code?

I looks at salesrule table source code in Magento 2.3.3 vendor/magento/module-sales-rule/etc/db_schema.xml. In that file, it said the table primary key is rule_id column but actually the primary key ...
user avatar
1 vote
1 answer
108 views

Using Subtotal as condition for sales rule is not working in Magento 2.2.6

I have a sales rule that has these conditions. I have to apply a discount if the cart contains at least one product of one of these categories and if the subtotal is more than 25 euro. The rule works ...
user avatar
0 votes
1 answer
411 views

Magento 2: Get attribute at which coupon condition fails and show it in a message

I need to show custom coupon error messages on frontend based on conditions.Where does the validation of coupon occurs when customer applies a coupon on the checkout page? As far as I know, Magento\...
user avatar
  • 548
1 vote
1 answer
388 views

Is there any way to get all Applied Discount (for cart rules and coupons) line items in cart/order in Magento 2?

I need to show all cart/order discounts in the following manner: Subtotal ----------- 100.00 CHRISTMAS10 (Christmas Sale 10 % off) ----------- -10.00 CHDLL1242DK (Coupon ...
user avatar
  • 1,474
2 votes
1 answer
270 views

How to add sales rule action fieldset in customer group area

I want to add sales rule fieldset to customer group form using custom module. can any one please guide me on this how to add this sales rule condition form under customer group edit form and save this ...
user avatar
0 votes
0 answers
40 views

Magento 2 add custom discount before cart rule discount in checkout

Here we add custom discount but here the problem is I want a custom discount to calculate before a cart rule. But here first calculate cart rule then my custom discount.
user avatar
3 votes
0 answers
321 views

Product grid checkbox input at sales rule form Magento 2 not working

I'm using Magento 2.3.4 and want to add product grid with checkbox as an input for sales rule form (shopping cart price rule), i follow the instruction to add product grid input from here but when I ...
user avatar
  • 167
0 votes
1 answer
299 views

Magento 2 salesrule obsersver save after & before

In Magento 1.9 i have an observer salesrule_rule_save_before and salesrule_rule_save_after for the backend area, are there any equivalent observer like this in Magento 2 ?
user avatar
  • 167
1 vote
0 answers
60 views

Magento 2 how to add customer chooser in cart price rules condition

I want to add customer chooser in cart price rules conditions like category and product chooser. Can anyone help me with this?
user avatar
4 votes
0 answers
168 views

Data migration Tool sales rule actions and condition serialized

I'm using Magento Data migration tool to migrate Magento 1.9.3 to Magento 2.3.4, everything went fine until I check the log error when I went to checkout page, I found out that in sales_rule table ...
user avatar
  • 167
4 votes
1 answer
322 views

Custom Cart Rule Action Condition in Magento 2

I have a custom quote item attribute (v_code) and I want to use this when creating a cart sales rule. Scenario: If a cart item has a v_code, it's included/excluded from the discount. I've managed to ...
user avatar
0 votes
1 answer
357 views

Magento 2 get Store Id of a coupon code programmatically

I am using multiple stores, I wanted to get all the coupon code of a particular store. In Magento 2 database, salesrule_website table have stores related information, but their is no model/collection ...
user avatar
  • 934
0 votes
1 answer
258 views

Magento 2: SQL error when redeeming coupon code

Magento 2.2.9 When I try to redeem a coupon code I get an SQL error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'rule_coupons.expiration_date' in 'where clause', query was: SELECT `t`.* ...
user avatar
  • 600
0 votes
1 answer
642 views

Cron Job ebizmarts_ecommerce has an error: in magento2

I have uploaded ebizmarts_ecommerce module in my live server. Cron Job ebizmarts_ecommerce has an error: : Argument 1 passed to Magento\SalesRule\Model\Converter\ToDataModel::...
user avatar
0 votes
1 answer
224 views

How to Get List of Coupons Available for Customer Using REST API

I need to get the List of Coupons Available for Logged in customers using REST API.
user avatar
0 votes
4 answers
197 views

How can I override following file?

In the above attach file I want to change Magento\SalesRule\Model\Rule\Condition\Address to Company\SalesRule\Model\Rule\Condition\Address
user avatar
  • 3,426
0 votes
2 answers
870 views

How to override validate() of module-sales-rule/Model/Rule/Condition/Address.php?

I want to override validate() function of this file vendor/magento/module-sales-rule/Model/Rule/Condition/Address.php in my custom module file app/code/Companyname/Subtotalwithdiscount/Model/Rule/...
user avatar
  • 3,426