Questions tagged [shopping-cart-price-rules]

Denotes questions about shopping cart price rules.

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

Fixed shoppingcart discount based on a product in the cart

We have a discount action on our webshop where customers get 1 free "Product B" for every "product A" they have in the cart. We don't have a free gift module and right now aren't ...
0 votes
0 answers
10 views

LogicException : Infinite loop detected error when quote data get in sales rule magento 2.4.4

I need to apply discount on another different product based on condition. So that why I was created custom simple action in sales rule. I created custom action class for calculation discount. see my ...
0 votes
0 answers
27 views

How to add custom fee to cart summary on click

I want to add a custom fee to the cart summary when the checkbox is check and remove when unchecked and also adjusting the order total with each checkbox change. How can I achieve this?
0 votes
1 answer
21 views

Magento 2 How to validate newly added field in cart price rule

I have added a new field in the Cart Price Rule form as below. I have saved the value in the table as a new column <?xml version="1.0" encoding="UTF-8"?> <form xmlns:xsi=&...
0 votes
1 answer
19 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() ...
0 votes
2 answers
25 views

How to apply cart rule (free shipping) on custom shipping method

I have created custom shipping method and working fine. I want to know what i have to do for my custom shipping method to set price zero when cart price rule become true for free shipping. For example:...
0 votes
0 answers
16 views

Hierarchy for custom discount and price rule

this is the context: for different reason we apply a custom discount without using the cart price rules. For example if the grandtotal is 100, with our discount (50%) the grandtotal become 50. Now the ...
1 vote
1 answer
68 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
0 answers
75 views

Magento 2 discount value is removed for logged in user using cart rules

I have a problem with discount not subtracted from grand total in checkout. The discount is coming from a cart rule and is displayed correctly on the checkout page but the grand total is without the ...
  • 21
0 votes
1 answer
24 views

Magento 2 Shipping carrier Shipping Cost Vs Shipping Price

What is the purpose of the shipping cost, I can observe the shipping Price is always visible on the frontend calculation. I've tried to edit the below file to verify the shipping cost. But it is not ...
  • 588
0 votes
1 answer
30 views

Cart price rule when buying two items of a specific product

I try to develop a cart price rule for the following scenario: I offer a configurable product in three sizes, i.e. SKU Product_A for the parent and SKU Product_A_Medium, Product_A_Large and ...
0 votes
0 answers
11 views

Cart price rule when buying 2 specific products

colleagues! I am wondering if anyone could advise on topic like cart price rule for which customer can apply only if he/she got in cart only two certain products. The idea is that if customer from SKU ...
0 votes
0 answers
3 views

discount can't do zero shipping amount

Hunter Black Light Weight Rubberised Jacket Qty 1 R2,699.00 R50.00 Delivery to your door Discount (TESTING) R5000 -R2,742.48 Order Total R5.68
1 vote
0 answers
113 views

Task not starting

I am using magento 2.4.3-p2 and created a cart price rule to give free delivery over £50. Since enabling this rule i get notifications at the top of the admin panel saying "Task "Rule ...
0 votes
0 answers
6 views

Option to not give discount on bundle products when their is a cart rule for simple products

Maybe somebody knows how to solve my issue :-) I have a cart price rule for discount when there are more to 2 items in the cart works all fine, but the problem I have is that it's based on a selection ...
1 vote
0 answers
11 views

How to write apply cart rule function

I have some rules applied to my shopping cart. Assuming the rules have id: 1,2,3,4 and the order in which the rules are applied is 3,2,4,1. I want to get cart information detail after applied rule 3,2,...
0 votes
0 answers
19 views

What would be a better solution to amend the discount calculation?

So there is this class vendor/magento/module-sales-rule/Model/Rule/Action/Discount/BuyXGetY.php It has this method: public function calculate($rule, $item, $qty): Data { $discountData = $this->...
  • 145
0 votes
0 answers
21 views

Exclusionary Cart Price Rule - Magento 2

I am trying to set up a exclusionary shopping cart price rule in Magento 2 using a coupon code. e.g. Apply a 10% discount to all products on the store with X coupon code, but NOT to the following ...
0 votes
0 answers
46 views

Magento 2.4.0 = How to I can apply Cart Price Rule Condition in this coupon Code?

I want to Add Cart price rule condition in my custom auto generated Coupon Code. If email is equal to test@gmail.com. How to i'll do this. Please check my code. This code is working Perfectly i just ...
0 votes
0 answers
11 views

Remove Cart Price Rules with type No Coupon

I create a cart price rule with coupon type is No Coupon. I don't wanna change its condition in admin, how can I remove this rule by code? I override function applyRules in module Magento_SalesRule (...
1 vote
2 answers
47 views

exclude some other product in the cart from receiving discount

How to get product value ( product price) if attribute "logitech" is set to yes [attribute is Boolean]. I'm new here, still learning magneto. below code, calculate all items in the cart but ...
  • 167
0 votes
1 answer
66 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
41 views

Cart Price Rules by condition

In my code i can apply 50% discount on cart but i want this discount to apply only when product from a specific category is added. \Magento\Quote\Model\Quote $quote, \Magento\Quote\Api\...
0 votes
0 answers
64 views

Does Magento 2.4.2 Cart Price Rule's Applicability Check Works Fine?

lately I am trying to tweak Magento 2 Cart Price Rule feature for our business requirements and I realized something. First of all, I need to say that we override Magento\SalesRule\Model\Rule\...
0 votes
1 answer
17 views

Include SKU in cart price rule that is being excluded by another condition

I am trying to create the following cart price rule: Exclude all products with certain tax-class Include certain SKUs that have that tax-class I know, sounds weird. But product management wants it ...
0 votes
0 answers
11 views

How do you setup a code to only work if a customer has not placed an order in 'x' amount of days?

We are looking to setup a rule in 'cart price rules' so a code only works if a customer has not place an order in 'x' amount of days. I found a hidden condition under Purchase History > Orders ...
0 votes
0 answers
47 views

Magento 2: Check if a cart price rule conditions have been met

How to programmatically check if a cart price rule condition is met on the cart page?
  • 300
1 vote
1 answer
240 views

Magento Cart Price Rule - How to Sum Specific Category For Discount

I want to create a discount code in Magento 2. The offer is £25 off every £250 spent on Garden Furniture. So, the rules must only apply on products from the garden category in the cart. For example, a ...
1 vote
0 answers
86 views

Magento 2: Remove product from cart when a cart according to cart price rule

I have created an extension which does this: A free product is added to cart when a cart price rule is applied. I want to remove the product when the condition becomes false. Any help would be ...
  • 300
0 votes
0 answers
20 views

Magento 2 cart rules discount on 2 products in a specific product list

my site has 100 products, and I choose 5 products A,B,C,D,E I want to set up a cart rule with the following conditions customer buy randomly 2 of 5 products above can get discount ex: buy 1 A, 1 B -&...
0 votes
1 answer
48 views

Cart price rule to exclude multiple SKU's

I'm not a dev and have very limited experience in M2 but I'm in need of some help, if possible? I need to create a 'cart price rule' to exclude multiple SKU's but have no idea how to do this. So far I ...
0 votes
1 answer
92 views

Cart Price Rule Condition is not working

I am trying to show Free Shipping only for this SKU but its not working below is my condition but the free shipping is visible on All products including above mention sku.
  • 1,722
0 votes
0 answers
32 views

Magento 2 exclude a product from UPS shipping but not from flatrate

For Magento 2 we have created an attribute to exclude that product from shipping methods and that product that is excluded will have an individual shipping price on it. For example, we have 2 products ...
0 votes
0 answers
18 views

configurable product outcomes changed to grouped / bundled items?

i only see that you can replace a configurable product's outcome with a simple product. our store will have about a dozen configurable products that will have 100s of outcomes based on the attributes, ...
0 votes
0 answers
91 views

Magento2 cart price rule with configurable product and simple product

I have a configurable product and 5 simple products Configurable product sku is DF-123 and its child products which are 5 different simple products sku is a,b,c,d,e 5 simple products:- a1,b1,c1,d1,e1 ...
0 votes
0 answers
209 views

Add a custom attribute to Cart Price Rule Coupon

I want to add a boolean attribute published to the coupon rule form (different from activate) but the same kind of attribute. From what I see the only attribute linked are product attributes. I've ...
  • 954
1 vote
2 answers
383 views

Cart price rule issue for uses per customer

I am using Magento ver. 2.4.3 and I have created the coupon code with following configuraion: uses per coupon - 1 uses per customer - 1 Expected result: The coupon should be valid only once for ...
0 votes
0 answers
268 views

Magento 2.3.1 Is there a way to apply discount to only 2nd product added to cart?

We want to achieve or to have below discount rule. Please let us know if it is possible or it can be achieved through any plugin. There are 3 SKU's A, B, C. User added SKU A to the cart. The user will ...
  • 25
0 votes
1 answer
205 views

Getting Unknown Type error for custom option in Cart Price Rule

I have added custom option for 'Apply' in Cart price rule. But when trying add product to cart I get following error place_x_receive_y_free is unknown type {"exception":"[object] (...
0 votes
1 answer
172 views

Cart price rule apply coupon discount for all product not only selected sku magento 2

i have cart price rule ( coupon Code)for 6 products which is working fine but when we add product not under the rule also get the discount
  • 1
0 votes
1 answer
126 views

Cart Price Rules always applied - regardles of storeview, status or even expiry date

I have a problem with Magento 2 (2.4.3-p1) where the Cart Price Rules are always applied to products on the checkout. Regardless of the rule is active, conditions are met, the coupon code was entered ...
  • 15
1 vote
0 answers
47 views

How to validate Cart Price Rule in Custom Module?

I want to validate cart price rule in custom module.
  • 13
0 votes
1 answer
130 views

Cart Price Rules - disable general discount after using code

I have a problem, I want to set up discount with a code which offers 50% on a specific product. But I also have a general discount which offers 20% after buying N products. I want to disable the ...
  • 3
0 votes
1 answer
246 views

Magento 2: Cart price rule conditions not working

I have created a cart price rule with coupon code. The condition should be that the code should be applied for all categories except a few categories like this: I don't know why but this is not ...
  • 300
0 votes
1 answer
240 views

Exclude Product from cart rules if product have catalog rule discount

I have overridden the below function for business logic(Want to exclude a product from cart rule which has catalog rule applied on the product) and it's working fine on the cart page vendor/magento/...
0 votes
1 answer
28 views

Magento 2 shopping cart based on quanity

i want to cart rule setup for specific category product my all product price is $14.99 so i want to rule like when customer buy 1 product price total : $14.99 when customer buy 2 products total : $...
0 votes
1 answer
436 views

Magento 2 Add Condition Rule In A Custom UI Form

Im using Magento 2.3.6. I want to add condition action in my custom module admin form. I use like below code but I have not received condition in var_dump with save action. Please suggest me what i ...
0 votes
0 answers
85 views

Magento 2 : Create duplicate cart price rule using existing cart price rule id

I want to duplicate the cart price rule in magento 2 by using cart price rule id. is there any way?
0 votes
2 answers
251 views

Discount the cart price which product price - Magento 2.4.2 CE

I need to discount the line item's total price in the total when the particular product is added to the cart. How to implement can get any suggestion. Eg: Product A added to the cart at the qty of 5 ...
  • 318
0 votes
0 answers
27 views

Magento Cart Rule: discount increases with number of items in the cart from the same category

I want to make a cart rule where if you put: 1 item in cart you get 20% off 2 items in cart you get 30% off the whole cart 3 or more items in the cart you get 40% off the whole cart All items are ...
  • 1

1
2 3 4 5
18