• Resolved Tallal Henaui

    (@thenaui)


    Hi

    There is a problem that I got on my page between dynamic prices and cache.

    I have Litespeed cache, and I assigned a tiered price to a category by a dynamic rule, when applied for the first time it grabs the correct price according to the quantity, but when going to the cart and increase or decrease the quantity, the price no longer responds to the dynamic rule, unless I clear the cache that comes with B2Bking.

    The only solution I got was to use a code (snippets) that I found in the help article of b2bking (IMPORT OR SETUP DYNAMIC RULES PROGRAMATICALLY: Clearing the Rules Cache) with running this code the dynamic rules work fine as they should be, this is the Code :

    b2bking()->clear_caches_transients(); require_once B2BKING_DIR . ‘/admin/class-b2bking-admin.php’; B2bking_Admin::b2bking_calculate_rule_numbers_database();

    The question is:

    is that solution correct? Or is there another way, for example to make changes in the Litespeed configuration and not to lose the benefits of the internal cache of the B2Bking prices?

    • This topic was modified 1 year, 3 months ago by Tallal Henaui. Reason: I add the CODE

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author WebWizards

    (@webwizardsdev)

    Hi there,

    Thanks for using our plugin,

    I’m not entirely sure why that happens, but it’s not really normal. For example, I tested on my local site with the Storefront theme and no other plugins except B2BKing and WooCommerce. This is what I see:

    https://www.loom.com/share/fd6a812ca29e468e8b67bd02228b98fe?sid=dc226c9e-3ba0-49ca-b716-bab4de17b325

    (the price adapts in the cart instantly to tiered pricing).

    On your site, it could be caused by Litespeed cache. I would suggest disabling that plugin at least temporarily for testing. I would advise to try and deactivate all other site plugins / switch to the Storefront theme to see if this issue persists. Hopefully this could help you identify where this is coming from. It could also for example be a conflict with some other plugin that affects pricing.

    Once you know more about what causes this (theme conflict, plugin conflict etc), please let us know and we can investigate further.

    Thread Starter Tallal Henaui

    (@thenaui)

    Hi there again

    I deactivated the Litespeed cache and the problem continued, the only way to fix it so far was with your snippet that I indicated earlier in my first message.
    I have not tried disabling all plugins and/or changing the theme.

    The curious thing is the following: If you used a WordPress administrator profile along with a B2Bking (Group) profile, the price change based on the dynamic rule works well and without using the snippet.

    Plugin Author WebWizards

    (@webwizardsdev)

    In my local tests, the price changes the same way for administrator users as it does for logged out users for example.

    Is it possible that on your site you have some other caching that does not apply to administrator users? Maybe some caching at your hosting level?

    I would still advise trying to disable plugins / theme, even if it’s not caching, it could be some kind of plugin conflict with another plugin that has effects on price.

    Thread Starter Tallal Henaui

    (@thenaui)

    hi
    I used the stage and deactivated all the plugins, then activated one by one, the surprise was that the error or problem that we are dealing with here never occurred. I have disabled the snippet that I mentioned in the first message of this conversation: “Clearing the Rules Cache”, and although I am not using this snippet, the dynamic price works fine without errors.
    So on the live site I’m not going to change anything, I’ll leave the ‘Clearing the Rules Cache’ snippet on while it’s doing its job, because I don’t know how it worked on the stage site without the snippet.
    I give up, maybe later someone will come and find out what is happening.
    Thank you for your attention and best regards.

    Plugin Author WebWizards

    (@webwizardsdev)

    Possibly one of the other plugins on the site has some pricing effects and something changed with it when you deactivated and reactivated it.

    I am not sure what it is – if you would like, our team can investigate it further if you’d like to open a ticket with us at https://webwizards.ticksy.com and share site access.

    Have a nice day,

    Thread Starter Tallal Henaui

    (@thenaui)

    Very possible, the only plugin I know that has some pricing effects is: WooCommerce Attribute Swatches by Iconic, but I have that specification disabled with the following snappet:
    /*
    Disable Attribute Swatches fee functionality.
    */
    add_filter( ‘iconic_was_disable_fees’, ‘__return_true’ );

    And yes, I’d like to open a ticket with your team for you to review on my stage, but later, because I’d also like to explain a problem with coupons, with or without specified coupon plugins that’s happening right now.

    Well, I thank you very much and we will be in contact later in order to improve B2Bking to infinity.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Problem with Dynamic price and cache’ is closed to new replies.