PluginUs.Net -WooCommerceとWordPressのビジネスツール





24〜36営業時間以内にメールが届かない場合は、まずスパムボックスをチェックし、サポートからのメールがない場合は、フォーラムに戻ってここで回答を読んでください。 しない] メールでの回答[]フォーラムから!! メールはあなたの情報のためだけのものであり、すべての回答はここでのみ公開する必要があります。


I'm having an issue with the combination of WOOCS + IconicWP Attribute Swatches + Caching.

My issue is that prices inside the swatches (the Fee) do not get converted once a page has been cached.

I can see on initial page load (uncached) it will convert fine back and forth.
But after this, if I close and reopen in a new incognito window, the cached version does not change currency as expected.

  • I've enabled cached mode on WOOCS
  • I've tried both with transient and session mode on WOOCS

I've tried to find out what happens, and what I can see is that on an uncached page we will get the correct markup (<bdi> etc)
However once it's cached, this markup has been stripped out leaving only the price text without markup code.

I have replicated the issue on GridPane Redis Page Cache (server cache) as well as Swift Performance Lite (WP plugin cache)

Any idea what might cause this and how I can fix it?


My plugin redraws cached prices in ajax mode. But unfortunately it doesn't work with third party prices



The plugin in question (IconicWP Attribute Swatches) works with your plugin - only not when cache is used.

Is there some special function they need to wrap around the price display to make it work? Some specific markup?

To take a more simple example:

Let's say I just want to output somewhere on a page, a number, which is a price of something (anything).


グローバル$ WOOCS;

echo woocommerce_price($WOOCS->woocs_exchange_value(floatval(13.99)));


How can I make sure this value is cacheable and will still convert with WOOCS?


Everything is a little more difficult!

there is data on the front (price formatting), there is also data that is used to calculate the new price

Let's say I just want to output somewhere on a page, a number, which is a price of something (anything). - Please  use  this  shortcode -  - and it will work with cache

Thank you! So I can just call do_shortcode() with that shortcode and my value and it should work? I'll try that.

 そしてそれはうまくいくはずですか? - yes



The shortcode works.

Is it acceptable to call the function directly instead of using do_shortcode? Since I'm calling this from inside a different filter call.

Example: $WOOCS->woocs_show_custom_price(['value' => floatval(13.99)]) ?

Or do you recommend the do_shortcode method instead?


yes I recommend using shortcode:

  1. price will work with cache
  2. your code will work correctly regardless of updating and changing the code of our plugin