Plugin doesn't work – receive error
-
When I go to the product details it shows:
Price Based on Country
Warning: Invalid argument supplied for foreach() in /home/mymuktav/public_html/wp-content/plugins/woocommerce-product-price-based-on-countries/includes/class-wcpbc-admin.php on line 81
Please advise.
Thanks
https://ww.wp.xz.cn/plugins/woocommerce-product-price-based-on-countries/
-
Hi! Have you added at least one group of countries?
Thanks. My fault for not checking the instructions. However, it would be better if you displayed a message such as ‘Please enter details in the woocommerce ‘Price based on Country’ tab, rather than showing a code error.
I have another issue. I have set my product price for the UK and US. When I use geopeeker.com the price being displayed in the US is the UK price in pounds. It isn’t showing the correct US price in dollars. Any ideass why this is? Is there another tool I can use to see how customers in the US are seeing the product web page?
Thanks
Thanks you for tour feedback, this bug will be fixed in the next update.
You have two ways to test how customers see the products prices:
If you are in a test enviroment, you can configure the debug mode in the setting page otherwise you can use a proxy navigation tool, for example holaI installed the hola plugin and browsed from the USA. The problem is when I arrive at the product page it is showing the English price in pounds. After adding the product to the basket, it then does show the correct price in US dollars. Why isn’t it showing the correct price in dollars immediately? How do I resolve this?
Note, when I browse from within the UK, I immediately see the UK price set by your plugin and not the default regular price of woo commerce. Why, therefore is it not doing this for the USA?
What version of WooCommerce are you using?
You might send me the url of your store to see the problem?
Thanks.Try to do test in a anonymous window to prevent use stored session data and be sure that the check “debug mode” is disable.
I’m using WooCommerce version Version 2.3.5
url is https://www.wonderofherbs.com/product/amla/I have set the prices as follows:
woocommerce – £9.99
your plugin
UK – £14.99
US – $19.99The following error is shown at the top of the page when using hola to browse from the US.
Warning: Invalid argument supplied for foreach() in /home/mymuktav/public_html/wp-content/plugins/woocommerce-product-price-based-on-countries/includes/class-wcpbc-customer.php on line 86
This error occurs when you haven’t added groups of countries but is strange that only occurs in only one product.
Have you installed another plugin that modifies the price or currency?
What is your configuración on “Default Customer Address”?
W3 total cache plugin is causing the issue. When disabled, your plugin works fine.
Turning on w3 cache, I have to disable the following in order for your plugin to work.
page cache
object cache
browser cacheI don’t know if this helps, but if I disable only page cache and object cache your plugin works, but it takes about 10 seconds and then a page refresh to change to the correct price/currency, whereas disabling browser cache as well will instantly change to show the correct currency (using the hula plugin).
Disabling all these options in W3 renders the caching useless.
Any ideas?
I assume you added a _wc_session_ to ignore query stems in database cache options. if you have’nt done it, you must do it.
You can add _oga_wppbc_ to ignore query stems also.
I detect that your widget cart no works fine, if you add a item and then you navigate to other product the widget shows 0 items.
Probably you had to check w3 settings to ensure Woocommerce integration.
I have always had database caching disabled.
In the database cache options under ‘ignored query stems:’ I have the following listed.gdsr_
wp_rg_
_wp_session_
_wc_session_These have always been there. I have not added or removed any details.
I enabled the database cache, then removed the _wp_session_. However this did not resolve the issue. I then tried adding _oga_wppbc_ but this didn’t resolve the issue either.
I have now disabled the database cache again. I am making sure I clear the cache every time I make a modification to W3TC settings.
If you use W3 Total Cache, your server may be serving your visitors stale pages, in such case, the geolocation method is not invoked, thus it seems like plugin doesn’t work properly.
The solution is to disable page caching for product details pages to stay dynamic and display information specific to the current customer.
Oscrgare, can you please tell me how to delete this plugin from my wp installation?
I tried to activate the plugin but it wouldn’t, so I figured, why to have it, I need to uninstall and I get this message anytime I try to do so:
Fatal error: Call to undefined function p_upload_dir() in /home3/ulises/public_html/skype-clases/wp-content/plugins/woocommerce-product-price-based-on-countries/uninstall.php on line 25
If you can help, I would highly appreciate it.Hi tuslibros!I made a mistake when typing the code uninstall file.
Please go to uninstall.php file and replace p_upload_dir() by wp_upload_dir()This plugin does not work with W3 Total cache, WP Super Cache, or my host’s dynamic cache. It seems that dynamic caching is what’s causing the problem. With caching plugins being so important to a great many users isn’t there a workaround you can implement? Yes, the product pages can be isolated from the cache software but this defeats the purpose of caching. I have done this and the page speed reduces by a significant amount.
Thanks
The topic ‘Plugin doesn't work – receive error’ is closed to new replies.