• The problem:

    We developed a new international shop with eg the following plugins:

    1.Cache enabler
    2.Autoptimize
    3.Price based on Country (Oscar gare)

    The products in our shop have different prices for each country. So Product A costs €100,- in country A and €110,- in Country B. This is settled by the plugin: Price based on Country.

    On our ‘old’ shop, this was working without a problem, but we didn’t had the cache-enabler plugin installed. Now we have and we see problem with the prices in our shop for the different countries (8 different countries).

    So I investigating the problem, but soon I saw this was an issue with caching. Here starts my first problem:

    Problem 1:
    Deactivating plugin Cache Enabler didn’t solve the pricing issue. I tested this via VPN to switch to different countries so I have an IP in that country to test if the price changed. It didn’t. The last price I saw was the price for all countries. So if I checked the country Germany, all product would have the German prices even if I changed the country to France or The Netherlands. All tested in an incognito browser.

    Problem 2:
    When Cache enabler is deactivated and I also deactivated the plugin Autoptimize, some pages break on my site. No CSS and only a few header links were shown.

    I contacted the plugin developer of AO (Frank Goossen) and told me some sort of caching is still present on the site. It wasn’t because Cache enabler was deactivated. No the caching was active. I also contacted my host about this and confirming no caching was active.

    I remove the line in wp-config ‘cache enabled = true’. That didn’t helped either. Also completely removing the plugin I had no joy.

    By activating cache enabler again, solved problem 2, but problem 1 was still there.

    Solution:
    Because cache enabler have to be active I had a problem, because this caused the wrong prices in the shop. Then I noticed the exclude option in the cache enabler plugin.

    So I excluded the shop and product pages from caching via regex. This works fine for the main language on the site. The other languages have URLs like /en/ /de/ /fr/ etc and this regex wasn’t working to exclude all translated pages of ‘shop’ and ‘product’ from caching:

    /^\/(product\/.*|produkt\/.*|produit\/.*|vare\/.*|termek\/.*|shop\/.*|en/\shop\/.*|boutique\/.*|butik\/.*|sklep\/.*|aruhaz\/.*)$/

    The thing I could do was excluding all pages from all languages on my site by this regex:

    /^\/(en\/.*|fr\/.*|de\/.*|da\/.*|fr\/.*|sv\/.*|pl\/.*|hu\/.*)$/

    A long intro but this is what I ask:

    1. Why is caching still active by deleting the Cache enabler plugin completely? Even the entry in wp-config.php is removed?
    2. Why cache enabler is interfering with the different prices in my shop for the different countries?

    Btw…all test are done in incognito browsers.

    Regards,
    Roland

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anonymous User 16850768

    (@anonymized-16850768)

    Cache Enabler itself won’t cache or deliver cached pages if the plugin is deactivated or deleted. It’s possible what Cache Enabler has cached is cached elsewhere, either by another caching layer, such as a CDN, Varnish, or even the browser itself (a browser cache doesn’t sound like the case if you were using a new incognito browser, though). If the WP_CACHE constant is false the advanced-cache.php file won’t be included by WordPress, which means Cache Enabler will not cache or deliver pages.

    Cache Enabler isn’t interfering with the different prices. Instead, it’s simply caching what has been first requested. Unfortunately there is no cache key for countries, so that means it’s not possible to cache each price version separately at the moment. A way around this would be changing the prices with a JavaScript solution instead.

    Thread Starter quinox

    (@quinox)

    Hi Corey,

    That’s not my experience with the plugin. I even contacted my host if there is some sort of other caching on their site, but it isn’t.
    Also, I can reproduce this on a copy of the the shop on a different host. This also indicates, there’s no caching on the host site.

    But what I do experience is the what I’ve wrote before.
    Yu say it is caching what has been first requested. That’s right. That’s also my experience and this cached price is the price for that product in all languages. It doen’t matter if i’ve set another price for another country.

    Cache enabler is doing something with it. But even disabling the plugin doesn’t solve the issue with no other caching active.
    Again…I can reproduce this on two instances. If you like I can give you login credentials to test yourself (one instance is a test-environment).

    regards,
    Roland

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shop prices and cache enabler’ is closed to new replies.