=== Postsaver Core ===
Contributors: sozodesign, dr5hn
Donate link: https://sozodesign.co.uk/
Tags: woocommerce, quick buy, calculator, geolocation
Requires at least: 5.0
Tested up to: 6.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Postsaver Core provides a quick buy calculator feature for WooCommerce products on the Postsaver website, with geolocation functionality.

== Description ==

Postsaver Core is a WordPress plugin that adds a quick buy calculator functionality to the Postsaver website. It allows customers to easily find the right products for their job by selecting the post shape, size, and quantity. The plugin also includes geolocation functionality to detect the user's location based on their IP address.

Key features:

* Quick Buy Calculator shortcode: Display the calculator on any page or post using the `[quick_buy_calculator]` shortcode.
* Calculator Widget: Display the calculator in a widget using the provided widget template.
* Customizable settings: Easily select the calculator page and customize the plugin settings from the WordPress admin area.
* User location detection: Determine the user's location (USA, EU, UK) based on their IP address.
* WooCommerce integration: Seamlessly integrates with WooCommerce to calculate and display matching products.
* Geolocation functionality: Retrieve geolocation data for the user's IP address and store it locally for improved performance.

== Installation ==

1. Upload the `postsaver-core` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to the 'Postsaver Core' settings page under the WordPress 'Settings' menu.
4. Select the desired calculator page and customize the plugin settings.
5. Use the `[quick_buy_calculator]` shortcode to display the calculator on any page or post.

== Frequently Asked Questions ==

= How do I display the quick buy calculator? =

You can display the quick buy calculator by using the `[quick_buy_calculator]` shortcode on any page or post. You can also use the provided widget template to display the calculator in a widget area.

= Can I customize the calculator layout? =

Yes, the `[quick_buy_calculator]` shortcode accepts a `layout` attribute that allows you to specify the layout of the calculator. The available options are 'portrait' (default) and 'landscape'.

= How does the user location detection work? =

The plugin uses the user's IP address to determine their location. It makes a request to the ipinfo.io API to retrieve the country information associated with the IP address. The plugin can detect if the user is from the USA, EU, or UK. The geolocation data is stored locally to improve performance and reduce API requests.

= Can I customize the geolocation functionality? =

Yes, you can modify the `getGeoIPData()` function in the `PostsaverCorePublic` class to use a different geolocation API or customize the behavior according to your needs. Make sure to update the API endpoint and token if required.

== Screenshots ==

1. Quick Buy Calculator
2. Plugin Settings Page

== Changelog ==

= 1.0.0 =
* Initial release of the Postsaver Core plugin.
* Added geolocation functionality to detect user location based on IP address.

== Upgrade Notice ==

= 1.0.0 =
Initial release of the Postsaver Core plugin with geolocation functionality.
