A bit old, and hopefully you have found a solution by now.
I have a similar requirement- A bundle with dynamic pricing that applies a percent discount to the bundle. Items can be purchased separately at full price, but if they are purchased in the bundle they are discounted by %2
Use the special price of the bundle product. For bundle products it is changed to a % - It is the percent the product will be discounted TO. ( For my 2%, I needed the special price to be 98)
It auto populates Special Price From Date, but if you leave Special Price to Date blank it will always give the special price.
Now your requirement is a dollar amount off, and this allows for a percentage off. If you are locked on to the dollar amount I am sure you could extend the special price calculation logic to allow you to make it a dollar amount off.
I moved my comments to answer, so this question can be shown as having an answer, as it seems solved.
You need to definitively determine if those old rules are causing the problem.
Are the expired rules active?
If so, set them as inactive. This should help determine if they are still being applied.
Also line items in cart will hold a list of applied rule ids.
In the cart output the value of ->getAppliedRuleIds()
to see what rules applied to the item
As per your comment above, deleting those rules fixed the problem.
All good and well, but if I were you I'd do a new test, to determine if this is just an upgrade issue (old rules not working/compatible to site db/code changes), or if you have an underlying issue with your site.
Create a new rule, marked it as expired - test if it also applies.
Mark it as inactive - test if it also applies.
If they do, you need to dig a bit further, as something is not right, and you'd run into issues later (and forget about this issue possible)
It could also potentially point to other issues after the upgrade.
Nothing worse than having strange inconsistencies 6 months down the line, and not knowing why....
Best Answer
Create observer that starts on collection products loading. get event with this collection. Idea is next - you have yours database, where you have rules ( name, amount, id of product).Then you get collection of product from observer,just compare product id from observer collection with yours product id
s in your
s custom created database.If id from observer = id from database, we set discount/special_price/price/regullar price (that you can get from your db).for me it works perfect.
and also you can read more about Rules Tutorials here :
https://www.mageplaza.com/kb/how-create-a-cart-price-rule-in-magento-2.html
https://docs.magento.com/m2/ce/user_guide/marketing/price-rules-catalog.html