Wordpress LScache Plugin: woocommerce showing price without tax when it shouldnt
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi! Lately we have discovered issues with products showing prices without tax. We have used Litespeed for over 6 months now and it hasnt been an issue before. We relate this issue to geolocation since woocommerce use it to determine the visitors residence and by that if tax should be added. I have searched the support forum here and found two topics where similar issues was discussed. One suggested to add following line to the htaccess file RewriteRule . ? [E= cache-vary:geo-cookie ] Topic: https://wordpress.org/support/topic/geolocation-pricing-and-caching/ The other suggested to add lines in htaccess as mentioned in this article https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscache:geoip-support Topic: https://wordpress.org/support/topic/currency-and-pricing-caching/ The first suggestion seems logical since the specifik cookie geo-cookie is set by woocommerce as explained in the topic. Is that the correct way to handle the problem or should I go with the second solution by any reason? Thanks in advanced. The page I need help with: https://idigdenim.com/ Hi, how exactly does it display price with tax ? I assume its based on country or something ? is this shared hosting or your own server? Best regards, 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 dont use that option since it add redirections. We hope we can use cache-vary:geo-cookie instead. Best regards Hi, well ?. in order to use that vary , you need to have a way , to determinate the users country without invoke PHP , because when page is cached , PHP wont be running you will need to either have one of the following : 1) LiteSpeed webservers 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 users country in HTTP header to be used for vary , like QUIC cloud CDN or CloudFlare Best regards, 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 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, HI, fixed the phpinfo page but didnt found those variables. Even did a test (got it from litespeed documentation) by adding this to the htaccess file: RewriteEngine on RewriteCond % ENV:GEOIP_COUNTRY_CODE ^SE$ RewriteRule ^(. )$ - [F,L] 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 Hi again, it turned that we cant 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 Googled a little and it seems ok to call a php file from htaccess. Could it look like this? RewriteEngine on RewriteRule . ? [E=Cache-Control:vary=% geoip_country_code.php ] 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, 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
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference