Multi-Country Products Manager for WooCommerce

Popis

Multi-Country Products Manager enables WooCommerce stores to manage products for up to 2 countries with manual pricing control and country-specific product availability.

Key Features

  • 2-Country Support: Support for US (base) + 1 additional country
  • Manual Pricing Control: Set specific prices for each country manually
  • Country Switching: Simple country selection interface
  • Product Filtering: Show only products available in user’s country
  • Admin Interface: Clean settings and product management
  • Cart Integration: Country information preserved in orders

Supported Countries

Choose from 60+ predefined countries including:
* Major economies (US, UK, EU countries, Japan, China, India)
* ASEAN countries (Singapore, Malaysia, Thailand, Philippines)
* Middle East (UAE, Saudi Arabia, Qatar)
* Africa (Nigeria, South Africa, Kenya)
* And many more

Exchange Rates

  • Manual exchange rate entry only
  • Store owners set their own rates
  • No automatic updates

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

External services

This plugin uses the following external geolocation services to detect user’s country for automatic country switching:

  1. IP-API

    • Service: IP-API provides country geolocation based on IP address
    • Data sent: User’s IP address for country lookup
    • When used: When user first visits the site or when country detection is triggered
    • Provider information: IP-API (see their privacy policy at ip-api.com/docs/legal)
  2. IPAPI.co

    • Service: IPAPI.co provides IP geolocation and country detection
    • Data sent: User’s IP address for country lookup
    • When used: When IP-API fails or as a fallback service
    • Provider information: IPAPI.co (terms at ipapi.co/terms, privacy policy at ipapi.co/privacy)
  3. IPinfo.io

    • Service: IPinfo.io provides IP address to country detection
    • Data sent: User’s IP address for country lookup
    • When used: When both IP-API and IPAPI.co fail or as a final fallback service
    • Provider information: IPinfo.io (terms at ipinfo.io/terms, privacy policy at ipinfo.io/privacy-policy)

Note: The plugin attempts to use these services in sequence until successful country detection occurs. If all services fail, the default country (US) is used. User’s IP is transmitted only for determining the country code, and no personal information is stored on these external services.

Developer Documentation

Plugin Architecture

The plugin follows a modular architecture:

`

multi-country-products-manager-for-woocommerce/

├── multi-country-products-manager-for-woocommerce.php # Main plugin bootstrap file
├── includes/
│ ├── class-mcpmwoo-core.php # Core plugin loader and initialization
│ ├── class-mcpmwoo-country.php # Country management (2-country limit)
│ ├── class-mcpmwoo-admin.php # Admin interface and settings
│ ├── class-mcpmwoo-product.php # Product pricing and filtering
│ ├── class-mcpmwoo-ajax.php # AJAX handlers for country switching
│ ├── class-mcpmwoo-hooks.php # WordPress/WooCommerce hooks
│ └── helpers.php # Helper functions
├── assets/
│ ├── css/
│ │ ├── mcpmwoo-admin.css # Admin styling
│ │ └── mcpmwoo-frontend.css # Frontend styling
│ └── js/
│ ├── mcpmwoo-dropdown.js # Country switching
│ └── mcpmwoo-multi-country.js # Admin functionality
└── languages/ # Translation files
└── multi-country-products-manager-for-woocommerce.pot # Translation template
`

Class Structure

MCPMWOO_Core: Main plugin loader and dependency manager
MCPMWOO_Country: Country data management (2-country limitation)
MCPMWOO_Admin: WordPress admin interface and settings
MCPMWOO_Product: Product-specific functionality and WooCommerce integration
MCPMWOO_Ajax: AJAX request handling
MCPMWOO_Hooks: WordPress and WooCommerce hooks registration

Helper Functions

The plugin provides helper functions for developers:

`php

// Get current user’s country
$country = mcpmwoo_get_current_country();

// Check if product is available in a country
$available = mcpmwoo_is_product_available_in_country($product_id, ‚US‘);

// Get country-specific price
$price = mcpmwoo_get_product_country_price($product_id, ‚GB‘, ‚regular‘);

// Get all countries (max 2)
$countries = mcpmwoo_get_countries();
`

Hooks and Filters

The plugin provides hooks for customization:

  • mcpmwoo_before_country_switch – Action before country switching
  • mcpmwoo_after_country_switch – Action after country switching
  • mcpmwoo_country_currencies – Filter to modify available currencies

Security Features

  • WordPress nonces for all AJAX requests
  • Input sanitization and validation
  • Capability checks for admin functions
  • SQL injection prevention through WordPress APIs

Inštalácia

  1. Upload the plugin files to /wp-content/plugins/multi-country-products-manager-for-woocommerce, or install via WordPress plugins screen.
  2. Activate the plugin through the ‚Plugins‘ screen in WordPress.
  3. Ensure WooCommerce is installed and activated.
  4. Use WooCommerce -> Multi Country to configure your 2 countries and pricing.

Časté otázky

How many countries can I use?

Now it supports 2 countries: US (base currency) plus one additional country of your choice.

Can I set different prices for each country?

Yes, you can manually set country-specific regular and sale prices for each product in the „Country Pricing“ tab.

Are exchange rates automatic?

No, you must manually enter and update exchange rates as needed.

Can I change my second country?

Yes, you can remove your current second country and add a different one, but you can only have 2 countries total.

Recenzie

Pre tento plugin nie sú žiadne recenzie.

Prispievatelia a vývojári

“Multi-Country Products Manager for WooCommerce” je softvér s otvoreným zdrojovým kódom. Do tohto pluginu prispeli nasledujúci ľudia.

Prispievatelia

Zoznam zmien

1.0.0

  • Initial version release
  • 2-country product management
  • Manual pricing control
  • Country switching functionality
  • Country-specific pricing
  • Clean admin interface
  • 60+ predefined countries
  • Manual exchange rate entry
  • Translation support