woocommerce-multilingual
Last commit date
addons
1 week ago
classes
1 week ago
compatibility
1 week ago
dist
1 week ago
inc
1 week ago
locale
1 month ago
res
1 week ago
templates
1 week ago
vendor
1 week ago
readme.txt
1 week ago
screenshot-1.png
4 years ago
screenshot-2.png
10 months ago
screenshot-3.png
4 years ago
screenshot-4.png
4 years ago
screenshot-5.png
4 years ago
screenshot-6.png
4 years ago
screenshot-7.png
4 years ago
screenshot-8.png
4 years ago
screenshot-9.png
10 months ago
wpml-config.xml
1 year ago
wpml-dependencies.json
9 months ago
wpml-woocommerce.php
1 week ago
wpml-woocommerce.php
156 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: WPML Multilingual & Multicurrency for WooCommerce |
| 4 | * Plugin URI: https://wpml.org/documentation/related-projects/woocommerce-multilingual/?utm_source=plugin&utm_medium=gui&utm_campaign=wcml |
| 5 | * Description: Make your store multilingual and enable multiple currencies | <a href="https://wpml.org/documentation/related-projects/woocommerce-multilingual/?utm_source=plugin&utm_medium=gui&utm_campaign=wcml">Documentation</a> |
| 6 | * Author: OnTheGoSystems |
| 7 | * Author URI: http://www.onthegosystems.com/ |
| 8 | * Text Domain: woocommerce-multilingual |
| 9 | * Version: 5.5.7 |
| 10 | * Plugin Slug: woocommerce-multilingual |
| 11 | * WC requires at least: 3.9 |
| 12 | * WC tested up to: 11.0 |
| 13 | * |
| 14 | * @package WCML |
| 15 | * @author OnTheGoSystems |
| 16 | */ |
| 17 | |
| 18 | if ( |
| 19 | defined( 'WCML_VERSION' ) |
| 20 | || ( isset( $_SERVER['REQUEST_URI'] ) && '/favicon.ico' === $_SERVER['REQUEST_URI'] ) |
| 21 | ) { |
| 22 | return; |
| 23 | } |
| 24 | |
| 25 | define( 'WCML_VERSION', '5.5.7' ); |
| 26 | define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) ); |
| 27 | define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) ); |
| 28 | define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' ); |
| 29 | define( 'WPML_LOAD_API_SUPPORT', true ); |
| 30 | define( 'WCML_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) ); |
| 31 | |
| 32 | require WCML_PLUGIN_PATH . '/inc/constants.php'; |
| 33 | require WCML_PLUGIN_PATH . '/inc/missing-php-functions.php'; |
| 34 | require WCML_PLUGIN_PATH . '/inc/installer-loader.php'; |
| 35 | require WCML_PLUGIN_PATH . '/inc/functions.php'; |
| 36 | require WCML_PLUGIN_PATH . '/inc/wcml-core-functions.php'; |
| 37 | |
| 38 | require WCML_PLUGIN_PATH . '/vendor/autoload.php'; |
| 39 | |
| 40 | require_once WCML_PLUGIN_PATH . '/vendor/otgs/ui/loader.php'; |
| 41 | otgs_ui_initialize( WCML_PLUGIN_PATH . '/vendor/otgs/ui', WCML_PLUGIN_URL . '/vendor/otgs/ui' ); |
| 42 | |
| 43 | $vendor_root_url = WCML_PLUGIN_URL . '/vendor'; |
| 44 | require_once WCML_PLUGIN_PATH . '/vendor/otgs/icons/loader.php'; |
| 45 | |
| 46 | WCML_Locale::load_locale(); |
| 47 | |
| 48 | if ( WPML_Core_Version_Check::is_ok( WCML_PLUGIN_PATH . '/wpml-dependencies.json' ) ) { |
| 49 | global $woocommerce_wpml; |
| 50 | |
| 51 | if ( defined( 'ICL_SITEPRESS_VERSION' ) && ! ICL_PLUGIN_INACTIVE && class_exists( 'SitePress' ) ) { |
| 52 | ( new WPML_Action_Filter_Loader() )->load( [ |
| 53 | WCML_Switch_Lang_Request::class, |
| 54 | WCML_Cart_Switch_Lang_Functions::class, |
| 55 | WCML\AdminTexts\Hooks::class, |
| 56 | ] ); |
| 57 | } |
| 58 | |
| 59 | $woocommerce_wpml = new woocommerce_wpml(); |
| 60 | $woocommerce_wpml->add_hooks(); |
| 61 | |
| 62 | add_action( 'wpml_loaded', 'wcml_loader' ); |
| 63 | } |
| 64 | |
| 65 | function wcml_loader() { |
| 66 | if ( ! class_exists( 'WooCommerce' ) ) { |
| 67 | \WPML\Container\share( \WCML\Container\Config::getSharedClassesWhenWooCommerceIsInactive() ); |
| 68 | |
| 69 | return; |
| 70 | } |
| 71 | |
| 72 | \WPML\Container\share( \WCML\Container\Config::getSharedInstances() ); |
| 73 | \WPML\Container\share( \WCML\Container\Config::getSharedClasses() ); |
| 74 | \WPML\Container\alias( \WCML\Container\Config::getAliases() ); |
| 75 | \WPML\Container\delegate( \WCML\Container\Config::getDelegated() ); |
| 76 | |
| 77 | $loaders = [ |
| 78 | WCML_xDomain_Data::class, |
| 79 | 'WCML_Privacy_Content_Factory', |
| 80 | \WCML\RewriteRules\Hooks::class, |
| 81 | \WCML\Email\Factory::class, |
| 82 | \WCML\Endpoints\Factory::class, |
| 83 | \WCML\Block\Convert\Hooks::class, |
| 84 | \WCML\CacheInvalidate\Hooks::class, |
| 85 | \WCML\MO\Hooks::class, |
| 86 | \WCML\Multicurrency\Shipping\ShippingHooksFactory::class, |
| 87 | \WCML\Reviews\Backend\Hooks::class, |
| 88 | \WCML\Reviews\Translations\Factory::class, |
| 89 | \WCML\Tax\Strings\Hooks::class, |
| 90 | \WCML\AdminDashboard\Hooks::class, |
| 91 | \WCML\AdminNotices\Review::class, |
| 92 | \WCML\Multicurrency\UI\Factory::class, |
| 93 | \WCML\PaymentGateways\BlockHooksFactory::class, |
| 94 | \WCML\PaymentGateways\Factory::class, |
| 95 | \WCML\Permalinks\Factory::class, |
| 96 | \WCML\CLI\Hooks::class, |
| 97 | \WCML\Reports\Hooks::class, |
| 98 | \WCML\Reports\Products\Query::class, |
| 99 | \WCML\MultiCurrency\GeolocationFrontendHooks::class, |
| 100 | \WCML\MultiCurrency\GeolocationBackendHooks::class, |
| 101 | \WCML\Reports\Categories\Query::class, |
| 102 | \WCML\Reports\Orders\Hooks::class, |
| 103 | \WCML\Multicurrency\Analytics\Factory::class, |
| 104 | \WCML\Setup\BeforeHooks::class, |
| 105 | \WCML\AdminNotices\CurrencySwitcherUseTwigTemplate::class, |
| 106 | \WCML\AdminNotices\MultiCurrencyMissing::class, |
| 107 | \WCML\AdminNotices\TranslationControlMovedNotice::class, |
| 108 | \WCML\Products\Hooks::class, |
| 109 | \WCML\API\VendorAddon\Hooks::class, |
| 110 | \WCML\Attributes\LookupTableFactory::class, |
| 111 | \WCML\Attributes\LookupFiltersFactory::class, |
| 112 | \WCML\HomeScreen\Factory::class, |
| 113 | \WCML\Terms\Count\Hooks::class, |
| 114 | \WCML\Rest\Store\HooksFactory::class, |
| 115 | \WCML\Importer\Products::class, |
| 116 | \WCML\COT\Hooks::class, |
| 117 | \WCML\DisplayAsTranslated\FrontendHooksFactory::class, |
| 118 | \WCML\User\Hooks::class, |
| 119 | \WCML\Exporter\AllLanguagesHooks::class, |
| 120 | \WCML\Exporter\AttributeHeadersHooks::class, |
| 121 | \WCML\AdminNotices\ExportImport::class, |
| 122 | \WCML\TranslationJob\Hooks::class, |
| 123 | \WCML\TMDashboard\Hooks::class, |
| 124 | \WCML\OrderItems\Hooks::class, |
| 125 | \WCML\Multicurrency\WpQueryMcPrice\Factory::class, |
| 126 | \WCML\Synchronization\Hooks::class, |
| 127 | \WCML\PostHog\Hooks::class, |
| 128 | \WCML\WcEmailSettings\MultilingualHooks::class, |
| 129 | \WCML\EditorScopedSync\HooksFactory::class, |
| 130 | ]; |
| 131 | |
| 132 | $loaders[] = 'WCML_Product_Image_Filter_Factory'; |
| 133 | $loaders[] = 'WCML_Product_Gallery_Filter_Factory'; |
| 134 | $loaders[] = 'WCML_Update_Product_Gallery_Translation_Factory'; |
| 135 | $loaders[] = 'WCML_Append_Gallery_To_Post_Media_Ids_Factory'; |
| 136 | |
| 137 | $action_filter_loader = new \WCML\StandAlone\ActionFilterLoader(); |
| 138 | $action_filter_loader->load( $loaders ); |
| 139 | } |
| 140 | |
| 141 | if ( WCML\Rest\Functions::isRestApiRequest() ) { |
| 142 | add_action( 'wpml_before_init', [ WCML\Rest\Generic::class, 'removeHomeUrlFilterOnRestAuthentication' ] ); |
| 143 | } |
| 144 | |
| 145 | function load_wcml_without_wpml() { |
| 146 | if ( ! did_action( 'wpml_loaded' ) ) { |
| 147 | require_once WCML_PLUGIN_PATH . '/addons/load-standalone-dependencies.php'; |
| 148 | |
| 149 | global $woocommerce_wpml; |
| 150 | $woocommerce_wpml = new woocommerce_wpml(); |
| 151 | wcml_loader(); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | add_action( 'plugins_loaded', 'load_wcml_without_wpml', 10000 ); |
| 156 |