• Resolved hesaplar

    (@hesaplar)


    Hello, I am using whole sale plugin that sets prices based on user role and sometimes for specific user itself. I can use cache vary for user roles to set correct product prices on cached page but I dont know how to set correct prices for certain users. For example:

    User A has a user role ‘wholesale’ which has a discount %20 so product is $80.

    User B has a user role ‘wholesale’ which has a discount %20 so product is $80.

    User C has a user role ‘wholesale’ but has specific setting that makes %10 additional discount which has a discount %20 + %10 so product is $70.

    But currently, User A and B and C all sees the $80 while user C should see $70.

    I was looking a way to not use cache vary but instead a method to load prices using ajax and use public cache (same cache vary for all users), I could not find any plugin for that. Is there any snippet you can provide that can load prices on the background using ajax, that would solve a huge problem for a lot of people using litespeed and woocommerce. So other cahce plugins has this ajax price loading but I dont want to change litespeed just for that.

    If that is not possible, is there any builtin way for litespeed to solve the user based pricing exception?

    Thanks in advance for your help,

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The “whole sale plugin” must be able to set the price by user role AND by AJAX. Otherwise it is not possible to get what you try to get. Using AJAX is the best and the fastest way to prevent using of any cache vary and it is the best way to keep public cache and to warmup public cache.

    Gravity can’t be switched off.

    • This reply was modified 10 months, 2 weeks ago by mukoka.
    Thread Starter hesaplar

    (@hesaplar)

    Hi @mukoka yes but none of the wholesale plugins have Ajax price loading feature. What I have seen is that some cache plugins such as flyingpress has Ajax woocommerce price loading. Do you know any standalone plugin that ajaxify woocommerce prices so that we can use litespeed and also have dynamic price loading on public pages.

    One of the most important function of LScache (not the LScache plugin) is to provide cache varies (different cache copies) depending on specific parameters. If such parameters (HTTP parameters) can’t be provided by whatever CMS or plugin there is no way to bypass cache varies, but AJAX can do it. If you don’t want to use cache varies you need to use AJAX to provide prices depending on user roles. Sorry, this is the way how a HTTP page cache works.

    Plugin Support qtwrk

    (@qtwrk)

    it’s kind of mission impossible for us here

    option 1) use ajax , but I guess it’s not possible

    option 2) use ESI, this also requires some custom coding , not exactly a simple solution

    option 3) use private cache only , private cache without ESI is per user basis , but private cache is usually short-lived , not very cache efficient

    • This reply was modified 10 months, 1 week ago by qtwrk.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Woocommerce Pricing cache for specific users’ is closed to new replies.