WC_Geolocation not found inside plugin

When I try with this code in functions.php file WC_Geolocation::geolocate_ip() for getting current user country It’s working fine.

But when I want to do it the same thing from a plugin, It throwing an error Fatal error: Class ‘WC_Geolocation’ not found

I have googled it and tried to find any possible solutions but didn’t get it, please help me out.

Thanks in advance.

Read more here:: WC_Geolocation not found inside plugin

Leave a Reply

Your email address will not be published. Required fields are marked *