跳到内容

Multi-Country Products Manager for WooCommerce

v1.0.1

Amigo Dheena · 2025年9月5日 上架

Simple multi-country product management for WooCommerce with manual pricing control and country switching.

正在使用
10 以下
评分
暂无
累计下载
542
最近更新
2026年11月24日
需要 WordPress 6.8+已测试到 7.1.5PHP 7.4+

贡献者

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

Key Features

  • Unlimited Country Configuration: Add as many supported countries as your store needs
  • 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
│ ├── 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 and exchange rates
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

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums