Title: Wrong prices with Lightspeed cache plugin
Last modified: November 30, 2021

---

# Wrong prices with Lightspeed cache plugin

 *  Resolved [Nauriskolats](https://wordpress.org/support/users/nauriskolats/)
 * (@nauriskolats)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/)
 * Hi Oscar,
 * Thanks for the plugin and your efforts maintaining it!
    I’m having an issue with
   Lightspeed cache plugin. If I disable it – the prices are correctly displayed
   for everyone (checked using geopeeker.com), however if the caching plugin is 
   enabled, it does not render prices correctly (even changing WooCommerce > Geolocate(
   with page caching support) does not solve it for me)
 * Any suggestions?

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Oscar Gare](https://wordpress.org/support/users/oscargare/)
 * (@oscargare)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/#post-15116865)
 * Hi,
 * [https://www.pricebasedcountry.com/docs/getting-started/geolocation-cache-support/](https://www.pricebasedcountry.com/docs/getting-started/geolocation-cache-support/)
 *  Thread Starter [Nauriskolats](https://wordpress.org/support/users/nauriskolats/)
 * (@nauriskolats)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/#post-15116906)
 * Thank you, Oscar, for the link.
    I already followed this guide before testing
   various ways to get it working, but without success until I deactivate Lightspeed
   cache plugin.
 *  Plugin Author [Oscar Gare](https://wordpress.org/support/users/oscargare/)
 * (@oscargare)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/#post-15116947)
 * Hi,
 * The plugin will run an AJAX request per page to refresh the prices if the “load
   product price in the background” option is enabled. Make sure Lightspeed does
   not cache the URLs that contain the query `?wc-ajax=wcpbc_get_location`.
 *  Plugin Author [Oscar Gare](https://wordpress.org/support/users/oscargare/)
 * (@oscargare)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/#post-15116958)
 * Also, Geopeeker does not run the javascript, so it’s not a good way to test. 
   Using a VPN software instead:
    [https://www.pricebasedcountry.com/docs/getting-started/testing/#section-4](https://www.pricebasedcountry.com/docs/getting-started/testing/#section-4)
    -  This reply was modified 4 years, 6 months ago by [Oscar Gare](https://wordpress.org/support/users/oscargare/).
 *  Thread Starter [Nauriskolats](https://wordpress.org/support/users/nauriskolats/)
 * (@nauriskolats)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/#post-15116968)
 * Thanks, Oscar, I will give it a try.
    P.S. I was using a VPN for testing as well.
 *  Thread Starter [Nauriskolats](https://wordpress.org/support/users/nauriskolats/)
 * (@nauriskolats)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/#post-15117106)
 * Thank you Oscar, that seems to have worked now.
 * But now I have another issue – the main price of the product is displayed fine,
   however down below I am outputting related products and use `get_variation_price_by_id()`
   function to display it. It does not seem to be affected by the changes we made
   earlier. Any way to solve this and make the prices appear correct there as well?
 * Are there any hooks that I can use that would help in changing the output there?
 *  Thread Starter [Nauriskolats](https://wordpress.org/support/users/nauriskolats/)
 * (@nauriskolats)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/#post-15117209)
 * Maybe there is a cookie that should be excluded from Lightspeed cache caching
   that would fix this?
 *  Plugin Author [Oscar Gare](https://wordpress.org/support/users/oscargare/)
 * (@oscargare)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/#post-15118043)
 * Hi,
 * `get_variation_price_by_id` does not work. The “load product price in the background”
   option requires the theme to use the `$product->get_price_html()` to output the
   price.
 * Replace `get_variation_price_by_id` with
 *     ```
       $v_product = wc_get_product( $variation_id );
       echo $v_product->get_price_html();
       ```
   
 *  Thread Starter [Nauriskolats](https://wordpress.org/support/users/nauriskolats/)
 * (@nauriskolats)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/#post-15119092)
 * Thank you [@oscargare](https://wordpress.org/support/users/oscargare/), you have
   been very helpful!
    I have adjusted my pricing output and everything works like
   a charm 🙂

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Wrong prices with Lightspeed cache plugin’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-product-price-based-on-countries/assets/icon-
   256x256.png?rev=1976858)
 * [Price Based on Country for WooCommerce](https://wordpress.org/plugins/woocommerce-product-price-based-on-countries/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-product-price-based-on-countries/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)
 * [lightspeed](https://wordpress.org/support/topic-tag/lightspeed/)

 * 9 replies
 * 2 participants
 * Last reply from: [Nauriskolats](https://wordpress.org/support/users/nauriskolats/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/wrong-prices-with-lightspeed-cache-plugin/#post-15119092)
 * Status: resolved