Okay
  Public Ticket #4487008
Dynamic rule issue
Open

Comments

  • Fabrice Gaumont started the conversation

    Hello, 

    I have just noticed than since few days, my dynamic rules stopped working randomly. 

    I attached screenshot of order from the same B2B account. The discount applied on an order and not on the other one. Is see no reason for that ... 

    Can you help please  ?

    Attached files:  dynamic rule.png
      rule OK .png
      rule NOK.png

  •  2,510
    WebWizards replied

    Hi Fabrice,

    Sorry to hear about this,

    To help troubleshoot the issue, it would be helpful if you have a screenshot with the rule configuration itself. It's also important to check whether there may be any other rules affecting this - for example if there's another rule with a higher priority and 0% discount for a product that could explain the issue.

    This could also be a caching issue. If you have any caching plugins active, it's important that each user has a unique cache. You can find more details about this here: https://woocommerce-b2b-plugin.com/docs/users-see-wrong-content-b2c-users-see-b2b-content-or-prices/

    We can help investigate this in more detail if you're able to share backend access to the site or a staging clone site.

    Kind regards,
    Stefan

  • Fabrice Gaumont replied

    Hello, 

    Find attached the screenshot of my rule. This is the only rule that applied so no priority is defined. 

    I don't have any cache plugin so it could not be the reason. 

    I think I have solved the issue by deactivating the rule and create a new one, with the exact same settings. I did not see the issue anymore since yesterday when I created the new rule. 

    I will let you know if the issue raise again. 


    Attached files:  Capture d’écran 2025-09-10 à 10.53.36.png

  •  2,510
    WebWizards replied

    Hi Fabrice,

    Thanks for the update and the screenshot of your rule configuration.

    I've reviewed your rule and don't see any obvious issues - it's a straightforward setup that should work consistently.

    I noticed you're using AWS hosting for simplesim.fr, which is excellent for performance. One thing to double-check though: make sure you don't have any AWS caching rules that might serve static/cached pages for cart and checkout pages. If AWS works similarly to CloudFlare in this regard, it's important to exclude these pages from caching to prevent issues with dynamic pricing.

    If this issue happens again, I think we could try a different approach. We could replace that rule with a minimal code snippet that would achieve the same discount but bypass B2BKing's internal caching mechanisms. This would run more directly and potentially be more reliable. Do you have a large number of rules on the site? if not, I think this would be quite feasible.

    If you encounter the issue again, please let me know and we can review options.

    Kind regards,
    Stefan