Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [rules]

The tag has no usage guidance.

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

Show Related Product Price rule Products in the Cart Page

I am using this code in the Magento_Catalog (items.phtml. switch ($type = $block->getType()) { case 'related-rule': if ($exist = $block->hasItems()) { $type = 'related'; ...
Rana Zain's user avatar
  • 659
1 vote
1 answer
77 views

Get product's related products based on rule

I am trying to get the related products from a specific product using the function getRelatedProducts. $relatedProductsArray = $productModel->getRelatedProducts(); if($relatedProductsArray &&...
Eliacim DAVILA - CENSERE's user avatar
0 votes
1 answer
80 views

Cart price rules problem

Strange behaviour cart price rules. Situation: I have set price rules for free delivery above some price and its working more or less Let assume that I have different 3 products, different prices. ...
Petka's user avatar
  • 1
1 vote
0 answers
17 views

Cart Price Rules - Quantity in cart equals or greater than 10 (from a same category, but with different sku's)

We face an issue here. We want to create a 5%, 10%, and 15% rebate when customer add 5, 10, or 15 units of a same category. It work well, until magento dont advise that the condition "Quantity in ...
Manuel Bisson's user avatar
0 votes
1 answer
81 views

I have a question regarding shopping cart rule validation

I have multiple active shopping cart rules on my website, including some older rules. The problem is that Magento validates these rules every time there is an update to the shopping cart or when a ...
Magenteiro's user avatar
0 votes
1 answer
59 views

How to create catalog price rule while initializing module?

I'm trying to create catalog rule by installing the module, but it's not working. This is my CreateRule\Setup\InstallData.php file <?php namespace Perspective\CreateRule\Setup; use Exception; use ...
MaxLogic's user avatar
0 votes
1 answer
349 views

How to override Validation.xml from module-customer

I want to override vendor/magento/module-customer/etc/validation.xml This validation.xml in custom module. Baically I want to change below file location with my custom module file <rule name="...
Arun Sharma's user avatar
  • 1,315
0 votes
1 answer
53 views

The cart price rule is not working in magento 2.2.3

The cart price rule is not working in magento 2.How to apply cart price rule for free shipping.
Sonali Ghule's user avatar
0 votes
1 answer
71 views

Cart Price Rules - discount on certain number of products

i am new in Magento, i want to to add discount on certain number of products. I mean, i have products on my store, every product has SKU. I want to make discount 50% for purchasing 12 products on my ...
m_add's user avatar
  • 3
0 votes
1 answer
31 views

Cart Price Rules to allow discount on limited products

I'm really struggling with Cart Price conditions. I want to be able to offer a discount code (say, 10%) to customers, but on limited products. I have created an attribute for my products already, &...
Frances Marshall's user avatar
0 votes
0 answers
239 views

Magento 2.4.2: how to add some charge(such as handling charge) to the FedEx shipping cost in the checkout page?

I would need to add some additional charge to the shipping cost shown by FedEx in the checkout page. In order to do this with custom code, I would like to know if there is an Magento event that gets ...
CodeForGood's user avatar
0 votes
0 answers
406 views

Magento 2.3 programmatically refresh smart rules without saving category

In my magento enterprice I have set a smart rule on a category (let's call it category B) which populates it's products with the product of another category (let' s call it category A). From backend ...
Lou Nik's user avatar
  • 443
0 votes
1 answer
774 views

How to add custom condition in custom rule

I've created a custom rule in my extension using this Now I want to add my custom conditions in a rule like order attribute, order billing address attribute and order shipping address attribute......
Denlier1211's user avatar
4 votes
1 answer
245 views

how to add custom user agent with android in magento 2?

I want to add new custom theme with my Android in app user agent. For exmaple i want to show new theme in my Android app Is there any solution for this
jykmhar123's user avatar
0 votes
3 answers
67 views

Magento2 - Email Marketing Question

We are launching a new e-commerce store soon. When a customer placed an order for first time then we want to give a unique coupon code to customer. In Magento we have option for cart rules and ...
Dinesh's user avatar
  • 552
0 votes
1 answer
233 views

How to remove trailing slash adding in pagination urls

I have added code in my htaccess to add trailing slash in my Magento 2.3.2 website URLs. I want to exclude the pagination pages including questions to add a trailing slash. For example - I have ...
chanchal's user avatar
  • 417
5 votes
5 answers
6k views

Magento 2 : Validate a condition rules based on product attribute

How to validate a condition rules based on product attribute in magento 2 backend: code: $product_id = '3'; // Crown Summit Backpack sku is 24-MB03 $objectManager = \Magento\Framework\...
Divya Sekar's user avatar
  • 1,485
1 vote
0 answers
477 views

Apply Magento\CatalogRule\Model\Rule\Condition\Combine to a collection FAST

I am using Karliuka m2.SmartCategory module for dynamic categories. This seems great to do what I need as was having issues with Smile modules virtual categories and this seemed to offer the same ...
harri's user avatar
  • 5,475
0 votes
1 answer
2k views

Magento 2: Cart price rule condition programmatically

I have a cart price rule whose id is 5. This rule applied for all customers and no condition applied to this. I want to make a condition on this rule is False when the payment method is ...
HaFiz Umer's user avatar
  • 1,661
0 votes
1 answer
265 views

How to disable shipping method if weight is more than 30 Kg

I installed this extension https://landofcoder.com/magento-2-table-rate-shipping-extension.html to manage shipping rates but i want to hide it or disable it if weight is more than 30 kg any ...
Developper Magento 's user avatar
1 vote
0 answers
30 views

Custom shipping rate logic

I have created a custom shipping method. I need to implement the following logic: Shipping rate = Item weight * Item quantity * Zone rate How to get zone rates in collectRates method?
GenZ Dev's user avatar
  • 600
3 votes
2 answers
5k views

Magento2: custom validation Error "Uncaught TypeError: Cannot read property 'call' of undefined"

In my custom validation rules shows ' Uncaught TypeError: Cannot read property 'call' of undefined' errors!!!... . how can i do custom logic and proper validation ? Here is my Code app/...
Shafeel Sha's user avatar
  • 1,395
1 vote
0 answers
74 views

100% Discount for matching products with discount code, Max qty 1 per product, Maximum fixed total, with 5 items

We have a clothing shop and are offering the following discount with a code to select customers only... 1 Free Sweatshirt (any size) 1 Free Polo (any size) 1 Free Fleece (any size) 1 Free Coat (any ...
Alan Coleman's user avatar
4 votes
1 answer
783 views

Magento 2 ui form component switcherConfig value expression

Doe anyone know at all if possible to have expression to evaluate a value in rules E.G : <switcherConfig> <rules> <rule name="0"> <value>EXPRESSION HERE</...
Juliano Vargas's user avatar
5 votes
2 answers
2k views

Magento 2 Can't get the sales rules conditions in my ui form submit

I have a UI form which contains 2 fields one is 'name' and the other is the 'conditions'. I have tried the below code to display the conditions section and it is working fine. But I did not get the ...
Jancy Abraham's user avatar
2 votes
0 answers
25 views

Magento 2 : Category products dynamic rules get scope between 10% and 20% discount

We have a category where we need to add all products from another category with between 10% and 20% discount. The problem is that some of the products have a special price AND a price-rule which ...
Rune's user avatar
  • 21
0 votes
1 answer
38 views

Magento 1.9 multiple pricerules pick the highest discount

At our magento site we have some different price rules where some of the products affected are the same. But it should not apply all rules to the product only one, we want it to set the discount ...
Rune's user avatar
  • 1
2 votes
1 answer
528 views

How to duplicate sales rule programmatically in Magento2

Im try to duplicate some salesrule exist, i can duplicate this, but i can't use setConditionsSerialized and setActionsSerialized with getCondition and getActionCondition, its dont working use ...
heady9x's user avatar
  • 91
3 votes
0 answers
38 views

Different discount for category products

I want to know is there a way to get different discount for the products in the same category if quantity exceeds a limit. For example: I have these products with these prices: A=10 B=15 C=12 And ...
Sebastian's user avatar
0 votes
1 answer
227 views

Cart Rules - Not logged in

I've set up a cart rule that applies if: payment method is Bank Transfer. It is always applied, except when an order is placed as a guest. Can you help me? NB: All the user groups present are ...
Etds's user avatar
  • 1
1 vote
0 answers
384 views

Magento 2.3.0 How to display only product attribute in custom rule condition into the custom admin form using the ui component

I have implement custom condition Rule to my custom module Take refrance from this link and it is working fine. But it is display also other rule like cart attribute, customer attribute, other ...
Chirag Patel's user avatar
  • 6,136
2 votes
5 answers
5k views

Magento 2 How to put a rule condition into the custom admin form using the ui component

Magento 2 custom extension how to put a rule condition into the custom admin form using the ui component with data base interaction. please refer the following rule condition image
Hardik Makwana's user avatar
1 vote
0 answers
95 views

How to get acting to product price rule in Magento 2

/magento-catalog/templates/product/price/final_price.phtml <span class="old-price"> <?php /* @escapeNotVerified */ echo $block->renderAmount($priceModel->getAmount(), [ '...
Kharidas Chebotaryov's user avatar
3 votes
2 answers
4k views

How to Reset Magento Admin Permission

Admin role have no permissions, when I log in I just see only a extensions. How to reset permission in database MAGENTO 2 version?
EK.'s user avatar
  • 81
0 votes
1 answer
349 views

How to set discount code for one country using only?

Can anyone help to teach me how to set specific discount code only for specific country only? Thanks!
Kuson's user avatar
  • 1
3 votes
1 answer
285 views

Apply discount for For every $X spent Programatically in magento 2

I want to apply the discount on every $X spent amount. For example, if $5 discount for every $10, and my cart total is $34 then, I will get the discount of $15. Is it possible by programmatically ...
Pribhav's user avatar
  • 458
1 vote
1 answer
802 views

Magento 1.9 : How to add product with discount automatically in the shopping cart?

Hope you're all doing well. I need some guidance in how or if some tool already exist for this: If an specific product enters the shopping cart, automatically one other specific product appears in ...
Diogo Mello's user avatar
0 votes
1 answer
1k views

Related Product Rules not showing up in magento2?

I am trying to create Related product rules by following below link. https://www.bluefishgroup.com/insights/ecommerce/related-products-rules-in-magento-2/ When i navigate into Marketing i can see ...
Jafar Pinjar's user avatar
  • 1,929
2 votes
0 answers
391 views

Magento 2: How to validate cart price rule in product view?

I'm trying to show the price rules in the product view, but I can not find a way to validate if a product meets the rule... At the moment I just get all the rules. Block: class RuleDescription ...
chdzma's user avatar
  • 952
0 votes
2 answers
706 views

Catalog Price Rules: "Stop Further Rules Processing' (not cart rules) - how does this work? M1

Catalog Price Rules: "Stop Further Rules Processing" (not cart rules) - how does this work? So, How does "Stop Further Rules Processing" work? does this work in product level? set a flag: stop ...
snh_nl's user avatar
  • 5,452
8 votes
1 answer
863 views

Restricting customers to max of (some number) purchases for a certain product in Magento

Is there any good modules out there that can handle this? Or would this be a custom event / observer that needs to be written? Here's an image on a non magento site that shows specifically what i'm ...
getData's user avatar
  • 327
1 vote
1 answer
5k views

Magento 2 - Cart price rules promotion rule based on specific category products added specified

I am new to Magento 2 and working with cart price rules but unable to get the required results. 1- I would like to apply 5% discount if more than 30 and less than 60 units added from specified ...
Abdul's user avatar
  • 31
1 vote
0 answers
41 views

Using QTY in Rule-Based Product Relations

Using Magento EE 1.14 and would like to be able to use the inventory quantity for rule-based product relations (related, upsell, cross sell). However, I don't see a way to make the quantity available ...
shan3's user avatar
  • 11
0 votes
1 answer
65 views

How to set up a promotion rule which enable users to get additional discount for certain bank card holder?

Does anyone know how to set up a promotion rule which enable users to get additional discount for certain bank card holder? Can we create it in Magento 2 default or can anyone suggest an extension if ...
hehe's user avatar
  • 1
1 vote
1 answer
148 views

How to create 2 shopping cart rule in magento 1.9.3.2

We are selling dress where with different Category A and B. Category A need to give buy 2 or more to get 15% Off. Category B is flat 10% off on all products. If people buy Category A 1 product and ...
Suresh Durai's user avatar
1 vote
1 answer
980 views

How to filter Products with activated Flag?

I use the Use for Promo Rule Conditions flag. How can I filter only products having this flag set to yes? Is there a table where it is set so that I can use it for filtering?
Blueblazer172's user avatar
3 votes
0 answers
1k views

How to set shipping rule in magento2?

How to set below rule? Shipping & Handling Fee is 20% if the order is between $50 to $150, 15% if the order is between $150 to $300.
user56661's user avatar
1 vote
2 answers
85 views

How to label products to indicate cart rule has been applied?

I want to display a product label if a cart rule has been applied to a product but the label is being displayed for all products even those who don't qualify for the cart rules. Here is the code I am ...
Guest123's user avatar
1 vote
1 answer
42 views

Bypass Minimum order ammount for downlodable products

It is possible in a store with 500€ minimum order ammount to set a custom cart rule that allow to bypass the minimum order for a certain type of product or a category? I tried to set up a shopping ...
Dario's user avatar
  • 11
1 vote
1 answer
3k views

How to give user agent rule for iPad and Tablet in Magento 2.1?

I have two themes, one for mobile and other for desktop. I have created 2 user agent rules for Mobile and iPad. All mobiles are showing mobile theme. But iPad and Tablets are also showing mobile theme....
Hima Mohan's user avatar