Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    how exactly does it display price with tax ? I assume it’s based on country or something ?

    is this shared hosting or your own server?

    Best regards,

    Thread Starter mats1

    (@mats1)

    Hi,

    Product prices in woocommerce is set with tax included. The tax rules in Woocommerce is set so that all EU countries should have tax. Other countries will have the tax redrawn from the price. To determine if a visitor is from a country outside EU Geolocation is used with Woocomemrce standard functionality. There is a setting in General options named “Default customer location”. That is now recently switched from “Geolocation” to “Geolocation (with cache support)”. We rather don’t use that option since it add redirections. We hope we can use cache-vary:geo-cookie instead.

    Best regards

    • This reply was modified 3 years, 5 months ago by mats1.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    well ….

    in order to use that vary , you need to have a way , to determinate the user’s country without invoke PHP , because when page is cached , PHP won’t be running

    you will need to either have one of the following : 1) LiteSpeed webserver’s GeoIP module , but this is unlikely to happen if you are using shared hosting

    2) set up a CDN service in front that will send user’s country in HTTP header to be used for vary , like QUIC cloud CDN or CloudFlare

    Best regards,

    Thread Starter mats1

    (@mats1)

    Hi,

    I have checked with our hosting company and the GeoIP module is enabled on the shared planes. So how to do next?

    A question about vary cookies. We also use Aeila Currency switcher and have added following line in htaccess file according to your advice:
    RewriteRule .* – [E=Cache-Vary:aelia_cs_selected_currency]
    Is it another principal here since we would have the same problem with php not running?

    Best regards

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Please create a phpinfo page , access and search for string like this , and make sure you see it

    yes, in that case, the plugin will set the cookie

    Best regards,

    Thread Starter mats1

    (@mats1)

    HI,

    fixed the phpinfo page but didn’t found those variables. Even did a test (got it from litespeed documentation) by adding this to the htaccess file:

    <IfModule mod_geoip.c>
    RewriteEngine on
    RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^SE$
    RewriteRule ^(.*)$ - [F,L]
    </IfModule>

    The test failed.
    Contacted the server company again and they claim that the GEOIP module is enabled but they will look into this to see why the variables are not visible.
    If they will fix this what would be the next step to do for me?

    Best regards

    Thread Starter mats1

    (@mats1)

    Hi again,

    it turned that we can’t use the variables in the htaccess file but in php. I guess that makes it hard to cache geolocation because of that or could we do something with php?

    Best regards

    Thread Starter mats1

    (@mats1)

    Googled a little and it seems ok to call a php file from htaccess.
    Could it look like this?

    <IfModule LiteSpeed>
    RewriteEngine on
    RewriteRule .* – [E=Cache-Control:vary=%{geoip_country_code.php}]
    </IfModule>

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    what exactly is the variable name you see in phpinfo ? like my screenshot , what are their name ?

    you can use it like

    
      RewriteRule .* - [E=Cache-Control:vary=%{ENV:THE_NAME_YOU_SEE_IN_PHPINFO}]
    

    replace THE_NAME_YOU_SEE_IN_PHPINFO to what you see in phpinfo page

    Best regards,

    Thread Starter mats1

    (@mats1)

    Hi,

    The variable in your screenshot can not be seen in phpinfo.
    We will go for another approach and use the plugin TAX display by country from Aelia. From what I understand you support Aelia plugins since version 2.6. The plugin sets a cookie $_COOKIE[‘aelia_customer_country’]. Should I add following line in the htaccess file: RewriteRule .* – [E=Cache-Vary:aelia_customer_country]?

    Best regards

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘woocommerce showing price without tax when it shouldn’t’ is closed to new replies.