PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

WOOCS Global Variable not initialize

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello,

I use Woocommerece Currency Switcher in the frontend is working well but when I use some files and use Global Variable it gives me a NULL value.

For ex

global $WOOCS;

$WOOCS->get_currencies()

Thanks

Hello

So you use this object before it was initialized (too early)

Not sure

but after migrating our site one server to another server I'm facing this issue.

Both servers use PHP version 7.4  and other version are

WordPress Version: 6.1.1
WooCommerce Version: 7.3.0

ok! Visibility of global variables on your server does not depend on my plugin

Are you using RESTAPI?

Yes

in log in file i have received message

 

[16-Feb-2023 10:27:44 UTC] PHP Fatal error: Uncaught Error: Call to a member function reset_currency() on null in /home/theraci1/public_html/wp-content/plugins/racing-emporium/api/class-racing-emporium-api.php:165
Stack trace:
#0 /home/theraci1/public_html/wp-includes/rest-api/class-wp-rest-server.php(1171): Racing_Emporium_API->{closure}(Object(WP_REST_Request))
#1 /home/theraci1/public_html/wp-includes/rest-api/class-wp-rest-server.php(1018): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/v1/features', Array, NULL)
#2 /home/theraci1/public_html/wp-includes/rest-api/class-wp-rest-server.php(442): WP_REST_Server->dispatch(Object(WP_REST_Request))
#3 /home/theraci1/public_html/wp-includes/rest-api.php(410): WP_REST_Server->serve_request('/v1/features')
#4 /home/theraci1/public_html/wp-includes/class-wp-hook.php(308): rest_api_loaded(Object(WP))
#5 /home/theraci1/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#6 /home/theraci1/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#7 /home/t in /home/theraci1/public_html/wp-content/plugins/racing-emporium/api/class-racing-emporium-api.php on line 165

In  file - wp-content\plugins\woocommerce-currency-switcher\index.php - delete/comment  this  code - https://c2n.me/4hQXcAj.png

Ok i'll test and get back to you

Now it's working fine. Thanks for support

Hello

Great!  Welcome;)