Version Description
- Fix shipping cost conversion issue specific to PHP 5.6
- Bug fix: an incorrect shipping cost was displayed on the backend when the order was placed in a secondary currency
- Bug fix: users with the Shop Manager role were not able to translate products
- Bug fix: changing an order language in the backend did not change the language for attributes in the order
- Bug fix: for every e-mail action took when editing an order a new order e-mail was sent to the admin
Download this release
Release Info
Developer | mihaimihai |
Plugin | WooCommerce Multilingual – run WooCommerce with WPML |
Version | 3.8.6 |
Comparing to | |
See all releases |
Code changes from version 3.8.5 to 3.8.6
- compatibility/class-wcml-table-rate-shipping.php +17 -0
- embedded/autoload_52.php +1 -1
- embedded/composer/autoload_real_52.php +3 -3
- embedded/composer/installed.json +46 -41
- embedded/composer/installers/README.md +8 -2
- embedded/composer/installers/composer.json +5 -0
- embedded/composer/installers/src/Composer/Installers/AsgardInstaller.php +6 -2
- embedded/composer/installers/src/Composer/Installers/AttogramInstaller.php +9 -0
- embedded/composer/installers/src/Composer/Installers/CockpitInstaller.php +34 -0
- embedded/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php +2 -2
- embedded/composer/installers/src/Composer/Installers/Installer.php +7 -1
- embedded/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php +29 -0
- embedded/composer/installers/src/Composer/Installers/ReIndexInstaller.php +10 -0
- embedded/composer/installers/src/Composer/Installers/ShopwareInstaller.php +3 -1
- embedded/composer/installers/src/Composer/Installers/VanillaInstaller.php +10 -0
- embedded/composer/installers/src/Composer/Installers/YawikInstaller.php +32 -0
- embedded/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php +22 -4
- embedded/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php +76 -0
- embedded/composer/installers/tests/Composer/Installers/Test/InstallerTest.php +22 -2
- embedded/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php +64 -0
- embedded/otgs/installer/changelog.txt +3 -0
- embedded/otgs/installer/includes/installer.class.php +35 -15
- embedded/otgs/installer/installer.php +1 -1
- embedded/otgs/installer/loader.php +1 -1
- embedded/otgs/installer/res/css/admin.css +25 -10
- inc/admin-menus/class-wcml-admin-menus.php +14 -1
- inc/class-wcml-emails.php +15 -9
- inc/class-wcml-orders.php +66 -14
- inc/class-wcml-products.php +11 -0
- inc/class-wcml-terms.php +12 -1
- inc/class-wcml-url-translation.php +60 -0
- inc/class-wcml-wc-strings.php +7 -63
- inc/currencies/class-wcml-multi-currency-orders.php +4 -14
- inc/currencies/class-wcml-multi-currency-prices.php +4 -1
- inc/currencies/class-wcml-multi-currency-shipping.php +11 -47
- inc/translation-editor/class-wcml-translation-editor.php +1 -1
- readme.txt +8 -1
- res/js/wcml-multi-currency.js +1 -1
- res/js/wcml-multi-currency.min.js +1 -1
- wpml-config.xml +1 -0
- wpml-woocommerce.php +2 -2
compatibility/class-wcml-table-rate-shipping.php
CHANGED
@@ -27,6 +27,10 @@ class WCML_Table_Rate_Shipping {
|
|
27 |
add_action( 'init', array( $this, 'init' ), 9 );
|
28 |
add_filter( 'get_the_terms',array( $this, 'shipping_class_id_in_default_language' ), 10, 3 );
|
29 |
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
/**
|
@@ -69,4 +73,17 @@ class WCML_Table_Rate_Shipping {
|
|
69 |
return $terms;
|
70 |
}
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
}
|
27 |
add_action( 'init', array( $this, 'init' ), 9 );
|
28 |
add_filter( 'get_the_terms',array( $this, 'shipping_class_id_in_default_language' ), 10, 3 );
|
29 |
|
30 |
+
if( wcml_is_multi_currency_on() ){
|
31 |
+
add_filter( 'woocommerce_table_rate_query_rates_args', array( $this, 'filter_query_rates_args' ) );
|
32 |
+
}
|
33 |
+
|
34 |
}
|
35 |
|
36 |
/**
|
73 |
return $terms;
|
74 |
}
|
75 |
|
76 |
+
/**
|
77 |
+
* It's not possible to filter rate_min and rate_max so we use the original price to compare against these values
|
78 |
+
*/
|
79 |
+
public function filter_query_rates_args( $args ){
|
80 |
+
|
81 |
+
if( isset( $args['price'] ) && get_option( 'woocommerce_currency') != $this->woocommerce_wpml->multi_currency->get_client_currency() ){
|
82 |
+
$args['price'] = $this->woocommerce_wpml->multi_currency->prices->unconvert_price_amount( $args['price'] );
|
83 |
+
}
|
84 |
+
|
85 |
+
return $args;
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
}
|
embedded/autoload_52.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit8d01bd8b1aab996b15028e141224e73f::getLoader();
|
embedded/composer/autoload_real_52.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
-
class
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit3e6faae5084bf837bfc9888926348dac {
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
+
class ComposerAutoloaderInit8d01bd8b1aab996b15028e141224e73f {
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit8d01bd8b1aab996b15028e141224e73f', 'loadClassLoader'), true /*, true */);
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit8d01bd8b1aab996b15028e141224e73f', 'loadClassLoader'));
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
embedded/composer/installed.json
CHANGED
@@ -1,17 +1,50 @@
|
|
1 |
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
{
|
3 |
"name": "composer/installers",
|
4 |
-
"version": "v1.
|
5 |
-
"version_normalized": "1.
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/composer/installers.git",
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/composer/installers/zipball/
|
14 |
-
"reference": "
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
@@ -25,7 +58,7 @@
|
|
25 |
"composer/composer": "1.0.*@dev",
|
26 |
"phpunit/phpunit": "4.1.*"
|
27 |
},
|
28 |
-
"time": "2016-
|
29 |
"type": "composer-plugin",
|
30 |
"extra": {
|
31 |
"class": "Composer\\Installers\\Plugin",
|
@@ -60,6 +93,7 @@
|
|
60 |
"MODX Evo",
|
61 |
"Mautic",
|
62 |
"OXID",
|
|
|
63 |
"RadPHP",
|
64 |
"SMF",
|
65 |
"Thelia",
|
@@ -67,9 +101,11 @@
|
|
67 |
"agl",
|
68 |
"aimeos",
|
69 |
"annotatecms",
|
|
|
70 |
"bitrix",
|
71 |
"cakephp",
|
72 |
"chef",
|
|
|
73 |
"codeigniter",
|
74 |
"concrete5",
|
75 |
"croogo",
|
@@ -93,12 +129,14 @@
|
|
93 |
"piwik",
|
94 |
"ppi",
|
95 |
"puppet",
|
|
|
96 |
"roundcube",
|
97 |
"shopware",
|
98 |
"silverstripe",
|
99 |
"symfony",
|
100 |
"typo3",
|
101 |
"wordpress",
|
|
|
102 |
"zend",
|
103 |
"zikula"
|
104 |
]
|
@@ -110,7 +148,7 @@
|
|
110 |
"source": {
|
111 |
"type": "git",
|
112 |
"url": "ssh://git@git.onthegosystems.com:10022/installer/installer.git",
|
113 |
-
"reference": "
|
114 |
},
|
115 |
"require": {
|
116 |
"composer/installers": "~1.0",
|
@@ -119,7 +157,7 @@
|
|
119 |
"require-dev": {
|
120 |
"phpunit/phpunit": "~4.5"
|
121 |
},
|
122 |
-
"time": "2016-08-
|
123 |
"type": "library",
|
124 |
"extra": {
|
125 |
"branch-alias": {
|
@@ -151,38 +189,5 @@
|
|
151 |
"update",
|
152 |
"utils"
|
153 |
]
|
154 |
-
},
|
155 |
-
{
|
156 |
-
"name": "xrstf/composer-php52",
|
157 |
-
"version": "v1.0.20",
|
158 |
-
"version_normalized": "1.0.20.0",
|
159 |
-
"source": {
|
160 |
-
"type": "git",
|
161 |
-
"url": "https://github.com/composer-php52/composer-php52.git",
|
162 |
-
"reference": "bd41459d5e27df8d33057842b32377c39e97a5a8"
|
163 |
-
},
|
164 |
-
"dist": {
|
165 |
-
"type": "zip",
|
166 |
-
"url": "https://api.github.com/repos/composer-php52/composer-php52/zipball/bd41459d5e27df8d33057842b32377c39e97a5a8",
|
167 |
-
"reference": "bd41459d5e27df8d33057842b32377c39e97a5a8",
|
168 |
-
"shasum": ""
|
169 |
-
},
|
170 |
-
"time": "2016-04-16 21:52:24",
|
171 |
-
"type": "library",
|
172 |
-
"extra": {
|
173 |
-
"branch-alias": {
|
174 |
-
"dev-default": "1.x-dev"
|
175 |
-
}
|
176 |
-
},
|
177 |
-
"installation-source": "dist",
|
178 |
-
"autoload": {
|
179 |
-
"psr-0": {
|
180 |
-
"xrstf\\Composer52": "lib/"
|
181 |
-
}
|
182 |
-
},
|
183 |
-
"notification-url": "https://packagist.org/downloads/",
|
184 |
-
"license": [
|
185 |
-
"MIT"
|
186 |
-
]
|
187 |
}
|
188 |
]
|
1 |
[
|
2 |
+
{
|
3 |
+
"name": "xrstf/composer-php52",
|
4 |
+
"version": "v1.0.20",
|
5 |
+
"version_normalized": "1.0.20.0",
|
6 |
+
"source": {
|
7 |
+
"type": "git",
|
8 |
+
"url": "https://github.com/composer-php52/composer-php52.git",
|
9 |
+
"reference": "bd41459d5e27df8d33057842b32377c39e97a5a8"
|
10 |
+
},
|
11 |
+
"dist": {
|
12 |
+
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/composer-php52/composer-php52/zipball/bd41459d5e27df8d33057842b32377c39e97a5a8",
|
14 |
+
"reference": "bd41459d5e27df8d33057842b32377c39e97a5a8",
|
15 |
+
"shasum": ""
|
16 |
+
},
|
17 |
+
"time": "2016-04-16 21:52:24",
|
18 |
+
"type": "library",
|
19 |
+
"extra": {
|
20 |
+
"branch-alias": {
|
21 |
+
"dev-default": "1.x-dev"
|
22 |
+
}
|
23 |
+
},
|
24 |
+
"installation-source": "dist",
|
25 |
+
"autoload": {
|
26 |
+
"psr-0": {
|
27 |
+
"xrstf\\Composer52": "lib/"
|
28 |
+
}
|
29 |
+
},
|
30 |
+
"notification-url": "https://packagist.org/downloads/",
|
31 |
+
"license": [
|
32 |
+
"MIT"
|
33 |
+
]
|
34 |
+
},
|
35 |
{
|
36 |
"name": "composer/installers",
|
37 |
+
"version": "v1.2.0",
|
38 |
+
"version_normalized": "1.2.0.0",
|
39 |
"source": {
|
40 |
"type": "git",
|
41 |
"url": "https://github.com/composer/installers.git",
|
42 |
+
"reference": "d78064c68299743e0161004f2de3a0204e33b804"
|
43 |
},
|
44 |
"dist": {
|
45 |
"type": "zip",
|
46 |
+
"url": "https://api.github.com/repos/composer/installers/zipball/d78064c68299743e0161004f2de3a0204e33b804",
|
47 |
+
"reference": "d78064c68299743e0161004f2de3a0204e33b804",
|
48 |
"shasum": ""
|
49 |
},
|
50 |
"require": {
|
58 |
"composer/composer": "1.0.*@dev",
|
59 |
"phpunit/phpunit": "4.1.*"
|
60 |
},
|
61 |
+
"time": "2016-08-13 20:53:52",
|
62 |
"type": "composer-plugin",
|
63 |
"extra": {
|
64 |
"class": "Composer\\Installers\\Plugin",
|
93 |
"MODX Evo",
|
94 |
"Mautic",
|
95 |
"OXID",
|
96 |
+
"Plentymarkets",
|
97 |
"RadPHP",
|
98 |
"SMF",
|
99 |
"Thelia",
|
101 |
"agl",
|
102 |
"aimeos",
|
103 |
"annotatecms",
|
104 |
+
"attogram",
|
105 |
"bitrix",
|
106 |
"cakephp",
|
107 |
"chef",
|
108 |
+
"cockpit",
|
109 |
"codeigniter",
|
110 |
"concrete5",
|
111 |
"croogo",
|
129 |
"piwik",
|
130 |
"ppi",
|
131 |
"puppet",
|
132 |
+
"reindex",
|
133 |
"roundcube",
|
134 |
"shopware",
|
135 |
"silverstripe",
|
136 |
"symfony",
|
137 |
"typo3",
|
138 |
"wordpress",
|
139 |
+
"yawik",
|
140 |
"zend",
|
141 |
"zikula"
|
142 |
]
|
148 |
"source": {
|
149 |
"type": "git",
|
150 |
"url": "ssh://git@git.onthegosystems.com:10022/installer/installer.git",
|
151 |
+
"reference": "a44c885a44923f64dde00e24e257ff0384e5238a"
|
152 |
},
|
153 |
"require": {
|
154 |
"composer/installers": "~1.0",
|
157 |
"require-dev": {
|
158 |
"phpunit/phpunit": "~4.5"
|
159 |
},
|
160 |
+
"time": "2016-08-05 08:23:27",
|
161 |
"type": "library",
|
162 |
"extra": {
|
163 |
"branch-alias": {
|
189 |
"update",
|
190 |
"utils"
|
191 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
193 |
]
|
embedded/composer/installers/README.md
CHANGED
@@ -35,6 +35,7 @@ is not needed to install packages with these frameworks:
|
|
35 |
| --------- | -----
|
36 |
| Aimeos | `aimeos-extension`
|
37 |
| Asgard | `asgard-module`<br>`asgard-theme`
|
|
|
38 |
| AGL | `agl-module`
|
39 |
| Bonefish | `bonefish-package`
|
40 |
| AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
|
@@ -42,6 +43,7 @@ is not needed to install packages with these frameworks:
|
|
42 |
| CakePHP 2+ | **`cakephp-plugin`**
|
43 |
| Chef | `chef-cookbook`<br>`chef-role`
|
44 |
| CCFramework | `ccframework-ship`<br>`ccframework-theme`
|
|
|
45 |
| CodeIgniter | `codeigniter-library`<br>`codeigniter-third-party`<br>`codeigniter-module`
|
46 |
| concrete5 | `concrete5-block`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-update`
|
47 |
| Craft | `craft-plugin`
|
@@ -75,20 +77,24 @@ is not needed to install packages with these frameworks:
|
|
75 |
| Piwik | `piwik-plugin`
|
76 |
| phpBB | `phpbb-extension`<br>`phpbb-style`<br>`phpbb-language`
|
77 |
| Pimcore | `pimcore-plugin`
|
|
|
78 |
| PPI | **`ppi-module`**
|
79 |
| Puppet | `puppet-module`
|
80 |
| RadPHP | `radphp-bundle`
|
81 |
| REDAXO | `redaxo-addon`
|
|
|
82 |
| Roundcube | `roundcube-plugin`
|
83 |
-
| shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`
|
84 |
| SilverStripe | `silverstripe-module`<br>`silverstripe-theme`
|
85 |
| SMF | `smf-module`<br>`smf-theme`
|
86 |
| symfony1 | **`symfony1-plugin`**
|
87 |
| Tusk | `tusk-task`<br>`tusk-command`<br>`tusk-asset`
|
88 |
| TYPO3 Flow | `typo3-flow-package`<br>`typo3-flow-framework`<br>`typo3-flow-plugin`<br>`typo3-flow-site`<br>`typo3-flow-boilerplate`<br>`typo3-flow-build`
|
89 |
| TYPO3 CMS | `typo3-cms-extension` (Deprecated in this package, use the [TYPO3 CMS Installers](https://packagist.org/packages/typo3/cms-composer-installers) instead)
|
|
|
90 |
| Wolf CMS | `wolfcms-plugin`
|
91 |
| WordPress | <b>`wordpress-plugin`<br>`wordpress-theme`</b><br>`wordpress-muplugin`
|
|
|
92 |
| Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
|
93 |
| Zikula | `zikula-module`<br>`zikula-theme`
|
94 |
| Prestashop | `prestashop-module`<br>`prestashop-theme`
|
@@ -187,7 +193,7 @@ not be inflected.
|
|
187 |
## Contribute!
|
188 |
|
189 |
* [Fork and clone](https://help.github.com/articles/fork-a-repo).
|
190 |
-
* Run the command `php composer.phar install` to install the dependencies.
|
191 |
This will also install the dev dependencies. See [Composer](https://getcomposer.org/doc/03-cli.md#install).
|
192 |
* Use the command `phpunit` to run the tests. See [PHPUnit](http://phpunit.de).
|
193 |
* Create a branch, commit, push and send us a
|
35 |
| --------- | -----
|
36 |
| Aimeos | `aimeos-extension`
|
37 |
| Asgard | `asgard-module`<br>`asgard-theme`
|
38 |
+
| Attogram | `attogram-module`
|
39 |
| AGL | `agl-module`
|
40 |
| Bonefish | `bonefish-package`
|
41 |
| AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
|
43 |
| CakePHP 2+ | **`cakephp-plugin`**
|
44 |
| Chef | `chef-cookbook`<br>`chef-role`
|
45 |
| CCFramework | `ccframework-ship`<br>`ccframework-theme`
|
46 |
+
| Cockpit | `cockpit-module`
|
47 |
| CodeIgniter | `codeigniter-library`<br>`codeigniter-third-party`<br>`codeigniter-module`
|
48 |
| concrete5 | `concrete5-block`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-update`
|
49 |
| Craft | `craft-plugin`
|
77 |
| Piwik | `piwik-plugin`
|
78 |
| phpBB | `phpbb-extension`<br>`phpbb-style`<br>`phpbb-language`
|
79 |
| Pimcore | `pimcore-plugin`
|
80 |
+
| Plentymarkets | `plentymarkets-plugin`
|
81 |
| PPI | **`ppi-module`**
|
82 |
| Puppet | `puppet-module`
|
83 |
| RadPHP | `radphp-bundle`
|
84 |
| REDAXO | `redaxo-addon`
|
85 |
+
| ReIndex | **`reindex-plugin`** <br> **`reindex-theme`**
|
86 |
| Roundcube | `roundcube-plugin`
|
87 |
+
| shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`<br/>`shopware-plugin`<br/>`shopware-frontend-theme`
|
88 |
| SilverStripe | `silverstripe-module`<br>`silverstripe-theme`
|
89 |
| SMF | `smf-module`<br>`smf-theme`
|
90 |
| symfony1 | **`symfony1-plugin`**
|
91 |
| Tusk | `tusk-task`<br>`tusk-command`<br>`tusk-asset`
|
92 |
| TYPO3 Flow | `typo3-flow-package`<br>`typo3-flow-framework`<br>`typo3-flow-plugin`<br>`typo3-flow-site`<br>`typo3-flow-boilerplate`<br>`typo3-flow-build`
|
93 |
| TYPO3 CMS | `typo3-cms-extension` (Deprecated in this package, use the [TYPO3 CMS Installers](https://packagist.org/packages/typo3/cms-composer-installers) instead)
|
94 |
+
| Vanilla | `vanilla-plugin`<br>`vanilla-theme`
|
95 |
| Wolf CMS | `wolfcms-plugin`
|
96 |
| WordPress | <b>`wordpress-plugin`<br>`wordpress-theme`</b><br>`wordpress-muplugin`
|
97 |
+
| YAWIK | `yawik-module`
|
98 |
| Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
|
99 |
| Zikula | `zikula-module`<br>`zikula-theme`
|
100 |
| Prestashop | `prestashop-module`<br>`prestashop-theme`
|
193 |
## Contribute!
|
194 |
|
195 |
* [Fork and clone](https://help.github.com/articles/fork-a-repo).
|
196 |
+
* Run the command `php composer.phar install` to install the dependencies.
|
197 |
This will also install the dev dependencies. See [Composer](https://getcomposer.org/doc/03-cli.md#install).
|
198 |
* Use the command `phpunit` to run the tests. See [PHPUnit](http://phpunit.de).
|
199 |
* Create a branch, commit, push and send us a
|
embedded/composer/installers/composer.json
CHANGED
@@ -8,9 +8,11 @@
|
|
8 |
"Aimeos",
|
9 |
"AGL",
|
10 |
"AnnotateCms",
|
|
|
11 |
"Bitrix",
|
12 |
"CakePHP",
|
13 |
"Chef",
|
|
|
14 |
"CodeIgniter",
|
15 |
"concrete5",
|
16 |
"Craft",
|
@@ -38,9 +40,11 @@
|
|
38 |
"Moodle",
|
39 |
"Piwik",
|
40 |
"phpBB",
|
|
|
41 |
"PPI",
|
42 |
"Puppet",
|
43 |
"RadPHP",
|
|
|
44 |
"Roundcube",
|
45 |
"shopware",
|
46 |
"SilverStripe",
|
@@ -50,6 +54,7 @@
|
|
50 |
"TYPO3",
|
51 |
"WolfCMS",
|
52 |
"WordPress",
|
|
|
53 |
"Zend",
|
54 |
"Zikula"
|
55 |
],
|
8 |
"Aimeos",
|
9 |
"AGL",
|
10 |
"AnnotateCms",
|
11 |
+
"Attogram",
|
12 |
"Bitrix",
|
13 |
"CakePHP",
|
14 |
"Chef",
|
15 |
+
"Cockpit",
|
16 |
"CodeIgniter",
|
17 |
"concrete5",
|
18 |
"Craft",
|
40 |
"Moodle",
|
41 |
"Piwik",
|
42 |
"phpBB",
|
43 |
+
"Plentymarkets",
|
44 |
"PPI",
|
45 |
"Puppet",
|
46 |
"RadPHP",
|
47 |
+
"ReIndex",
|
48 |
"Roundcube",
|
49 |
"shopware",
|
50 |
"SilverStripe",
|
54 |
"TYPO3",
|
55 |
"WolfCMS",
|
56 |
"WordPress",
|
57 |
+
"YAWIK",
|
58 |
"Zend",
|
59 |
"Zikula"
|
60 |
],
|
embedded/composer/installers/src/Composer/Installers/AsgardInstaller.php
CHANGED
@@ -31,14 +31,18 @@ class AsgardInstaller extends BaseInstaller
|
|
31 |
|
32 |
protected function inflectPluginVars($vars)
|
33 |
{
|
34 |
-
$vars['name'] =
|
|
|
|
|
35 |
|
36 |
return $vars;
|
37 |
}
|
38 |
|
39 |
protected function inflectThemeVars($vars)
|
40 |
{
|
41 |
-
$vars['name'] =
|
|
|
|
|
42 |
|
43 |
return $vars;
|
44 |
}
|
31 |
|
32 |
protected function inflectPluginVars($vars)
|
33 |
{
|
34 |
+
$vars['name'] = preg_replace('/-module$/', '', $vars['name']);
|
35 |
+
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
36 |
+
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
37 |
|
38 |
return $vars;
|
39 |
}
|
40 |
|
41 |
protected function inflectThemeVars($vars)
|
42 |
{
|
43 |
+
$vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
|
44 |
+
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
45 |
+
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
46 |
|
47 |
return $vars;
|
48 |
}
|
embedded/composer/installers/src/Composer/Installers/AttogramInstaller.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class AttogramInstaller extends BaseInstaller
|
5 |
+
{
|
6 |
+
protected $locations = array(
|
7 |
+
'module' => 'modules/{$name}/',
|
8 |
+
);
|
9 |
+
}
|
embedded/composer/installers/src/Composer/Installers/CockpitInstaller.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class CockpitInstaller extends BaseInstaller
|
5 |
+
{
|
6 |
+
protected $locations = array(
|
7 |
+
'module' => 'cockpit/modules/addons/{$name}/',
|
8 |
+
);
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Format module name.
|
12 |
+
*
|
13 |
+
* Strip `module-` prefix from package name.
|
14 |
+
*
|
15 |
+
* @param array @vars
|
16 |
+
*
|
17 |
+
* @return array
|
18 |
+
*/
|
19 |
+
public function inflectPackageVars($vars)
|
20 |
+
{
|
21 |
+
if ($vars['type'] == 'cockpit-module') {
|
22 |
+
return $this->inflectModuleVars($vars);
|
23 |
+
}
|
24 |
+
|
25 |
+
return $vars;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function inflectModuleVars($vars)
|
29 |
+
{
|
30 |
+
$vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name']));
|
31 |
+
|
32 |
+
return $vars;
|
33 |
+
}
|
34 |
+
}
|
embedded/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php
CHANGED
@@ -9,8 +9,8 @@ class ExpressionEngineInstaller extends BaseInstaller
|
|
9 |
protected $locations = array();
|
10 |
|
11 |
private $ee2Locations = array(
|
12 |
-
'addon' => 'system/expressionengine/
|
13 |
-
'theme' => 'themes/
|
14 |
);
|
15 |
|
16 |
private $ee3Locations = array(
|
9 |
protected $locations = array();
|
10 |
|
11 |
private $ee2Locations = array(
|
12 |
+
'addon' => 'system/expressionengine/third_party/{$name}/',
|
13 |
+
'theme' => 'themes/third_party/{$name}/',
|
14 |
);
|
15 |
|
16 |
private $ee3Locations = array(
|
embedded/composer/installers/src/Composer/Installers/Installer.php
CHANGED
@@ -16,6 +16,7 @@ class Installer extends LibraryInstaller
|
|
16 |
private $supportedTypes = array(
|
17 |
'aimeos' => 'AimeosInstaller',
|
18 |
'asgard' => 'AsgardInstaller',
|
|
|
19 |
'agl' => 'AglInstaller',
|
20 |
'annotatecms' => 'AnnotateCmsInstaller',
|
21 |
'bitrix' => 'BitrixInstaller',
|
@@ -23,6 +24,7 @@ class Installer extends LibraryInstaller
|
|
23 |
'cakephp' => 'CakePHPInstaller',
|
24 |
'chef' => 'ChefInstaller',
|
25 |
'ccframework' => 'ClanCatsFrameworkInstaller',
|
|
|
26 |
'codeigniter' => 'CodeIgniterInstaller',
|
27 |
'concrete5' => 'Concrete5Installer',
|
28 |
'craft' => 'CraftInstaller',
|
@@ -49,7 +51,7 @@ class Installer extends LibraryInstaller
|
|
49 |
'mako' => 'MakoInstaller',
|
50 |
'mautic' => 'MauticInstaller',
|
51 |
'mediawiki' => 'MediaWikiInstaller',
|
52 |
-
'microweber'
|
53 |
'modulework' => 'MODULEWorkInstaller',
|
54 |
'modxevo' => 'MODXEvoInstaller',
|
55 |
'moodle' => 'MoodleInstaller',
|
@@ -58,11 +60,13 @@ class Installer extends LibraryInstaller
|
|
58 |
'phpbb' => 'PhpBBInstaller',
|
59 |
'pimcore' => 'PimcoreInstaller',
|
60 |
'piwik' => 'PiwikInstaller',
|
|
|
61 |
'ppi' => 'PPIInstaller',
|
62 |
'puppet' => 'PuppetInstaller',
|
63 |
'radphp' => 'RadPHPInstaller',
|
64 |
'phifty' => 'PhiftyInstaller',
|
65 |
'redaxo' => 'RedaxoInstaller',
|
|
|
66 |
'roundcube' => 'RoundcubeInstaller',
|
67 |
'shopware' => 'ShopwareInstaller',
|
68 |
'silverstripe' => 'SilverStripeInstaller',
|
@@ -72,9 +76,11 @@ class Installer extends LibraryInstaller
|
|
72 |
'tusk' => 'TuskInstaller',
|
73 |
'typo3-cms' => 'TYPO3CmsInstaller',
|
74 |
'typo3-flow' => 'TYPO3FlowInstaller',
|
|
|
75 |
'whmcs' => 'WHMCSInstaller',
|
76 |
'wolfcms' => 'WolfCMSInstaller',
|
77 |
'wordpress' => 'WordPressInstaller',
|
|
|
78 |
'zend' => 'ZendInstaller',
|
79 |
'zikula' => 'ZikulaInstaller',
|
80 |
'prestashop' => 'PrestashopInstaller'
|
16 |
private $supportedTypes = array(
|
17 |
'aimeos' => 'AimeosInstaller',
|
18 |
'asgard' => 'AsgardInstaller',
|
19 |
+
'attogram' => 'AttogramInstaller',
|
20 |
'agl' => 'AglInstaller',
|
21 |
'annotatecms' => 'AnnotateCmsInstaller',
|
22 |
'bitrix' => 'BitrixInstaller',
|
24 |
'cakephp' => 'CakePHPInstaller',
|
25 |
'chef' => 'ChefInstaller',
|
26 |
'ccframework' => 'ClanCatsFrameworkInstaller',
|
27 |
+
'cockpit' => 'CockpitInstaller',
|
28 |
'codeigniter' => 'CodeIgniterInstaller',
|
29 |
'concrete5' => 'Concrete5Installer',
|
30 |
'craft' => 'CraftInstaller',
|
51 |
'mako' => 'MakoInstaller',
|
52 |
'mautic' => 'MauticInstaller',
|
53 |
'mediawiki' => 'MediaWikiInstaller',
|
54 |
+
'microweber' => 'MicroweberInstaller',
|
55 |
'modulework' => 'MODULEWorkInstaller',
|
56 |
'modxevo' => 'MODXEvoInstaller',
|
57 |
'moodle' => 'MoodleInstaller',
|
60 |
'phpbb' => 'PhpBBInstaller',
|
61 |
'pimcore' => 'PimcoreInstaller',
|
62 |
'piwik' => 'PiwikInstaller',
|
63 |
+
'plentymarkets'=> 'PlentymarketsInstaller',
|
64 |
'ppi' => 'PPIInstaller',
|
65 |
'puppet' => 'PuppetInstaller',
|
66 |
'radphp' => 'RadPHPInstaller',
|
67 |
'phifty' => 'PhiftyInstaller',
|
68 |
'redaxo' => 'RedaxoInstaller',
|
69 |
+
'reindex' => 'ReIndexInstaller',
|
70 |
'roundcube' => 'RoundcubeInstaller',
|
71 |
'shopware' => 'ShopwareInstaller',
|
72 |
'silverstripe' => 'SilverStripeInstaller',
|
76 |
'tusk' => 'TuskInstaller',
|
77 |
'typo3-cms' => 'TYPO3CmsInstaller',
|
78 |
'typo3-flow' => 'TYPO3FlowInstaller',
|
79 |
+
'vanilla' => 'VanillaInstaller',
|
80 |
'whmcs' => 'WHMCSInstaller',
|
81 |
'wolfcms' => 'WolfCMSInstaller',
|
82 |
'wordpress' => 'WordPressInstaller',
|
83 |
+
'yawik' => 'YawikInstaller',
|
84 |
'zend' => 'ZendInstaller',
|
85 |
'zikula' => 'ZikulaInstaller',
|
86 |
'prestashop' => 'PrestashopInstaller'
|
embedded/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class PlentymarketsInstaller extends BaseInstaller
|
5 |
+
{
|
6 |
+
protected $locations = array(
|
7 |
+
'plugin' => '{$name}/'
|
8 |
+
);
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Remove hyphen, "plugin" and format to camelcase
|
12 |
+
* @param array $vars
|
13 |
+
*
|
14 |
+
* @return array
|
15 |
+
*/
|
16 |
+
public function inflectPackageVars($vars)
|
17 |
+
{
|
18 |
+
$vars['name'] = explode("-", $vars['name']);
|
19 |
+
foreach ($vars['name'] as $key => $name) {
|
20 |
+
$vars['name'][$key] = ucfirst($vars['name'][$key]);
|
21 |
+
if (strcasecmp($name, "Plugin") == 0) {
|
22 |
+
unset($vars['name'][$key]);
|
23 |
+
}
|
24 |
+
}
|
25 |
+
$vars['name'] = implode("",$vars['name']);
|
26 |
+
|
27 |
+
return $vars;
|
28 |
+
}
|
29 |
+
}
|
embedded/composer/installers/src/Composer/Installers/ReIndexInstaller.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class ReIndexInstaller extends BaseInstaller
|
5 |
+
{
|
6 |
+
protected $locations = array(
|
7 |
+
'theme' => 'themes/{$name}/',
|
8 |
+
'plugin' => 'plugins/{$name}/'
|
9 |
+
);
|
10 |
+
}
|
embedded/composer/installers/src/Composer/Installers/ShopwareInstaller.php
CHANGED
@@ -11,7 +11,9 @@ class ShopwareInstaller extends BaseInstaller
|
|
11 |
'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
|
12 |
'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
|
13 |
'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
|
14 |
-
'theme' => 'templates/{$name}/'
|
|
|
|
|
15 |
);
|
16 |
|
17 |
/**
|
11 |
'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
|
12 |
'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
|
13 |
'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
|
14 |
+
'theme' => 'templates/{$name}/',
|
15 |
+
'plugin' => 'custom/plugins/{$name}/',
|
16 |
+
'frontend-theme' => 'themes/Frontend/{$name}/',
|
17 |
);
|
18 |
|
19 |
/**
|
embedded/composer/installers/src/Composer/Installers/VanillaInstaller.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class VanillaInstaller extends BaseInstaller
|
5 |
+
{
|
6 |
+
protected $locations = array(
|
7 |
+
'plugin' => 'plugins/{$name}/',
|
8 |
+
'theme' => 'themes/{$name}/',
|
9 |
+
);
|
10 |
+
}
|
embedded/composer/installers/src/Composer/Installers/YawikInstaller.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: cbleek
|
5 |
+
* Date: 25.03.16
|
6 |
+
* Time: 20:55
|
7 |
+
*/
|
8 |
+
|
9 |
+
namespace Composer\Installers;
|
10 |
+
|
11 |
+
|
12 |
+
class YawikInstaller extends BaseInstaller
|
13 |
+
{
|
14 |
+
protected $locations = array(
|
15 |
+
'module' => 'module/{$name}/',
|
16 |
+
);
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Format package name to CamelCase
|
20 |
+
* @param array $vars
|
21 |
+
*
|
22 |
+
* @return array
|
23 |
+
*/
|
24 |
+
public function inflectPackageVars($vars)
|
25 |
+
{
|
26 |
+
$vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
|
27 |
+
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
|
28 |
+
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
|
29 |
+
|
30 |
+
return $vars;
|
31 |
+
}
|
32 |
+
}
|
embedded/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php
CHANGED
@@ -8,7 +8,7 @@ use Composer\Composer;
|
|
8 |
class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
|
9 |
{
|
10 |
/**
|
11 |
-
* @var
|
12 |
*/
|
13 |
private $installer;
|
14 |
|
@@ -26,14 +26,20 @@ class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
|
|
26 |
public function testInflectPackageVars($type, $name, $expected)
|
27 |
{
|
28 |
$this->assertEquals(
|
29 |
-
|
30 |
-
array('name' => $
|
31 |
);
|
32 |
}
|
33 |
|
34 |
public function packageNameInflectionProvider()
|
35 |
{
|
36 |
return array(
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
array(
|
38 |
'asgard-module',
|
39 |
'asgard-module',
|
@@ -44,11 +50,17 @@ class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
|
|
44 |
'blog',
|
45 |
'Blog'
|
46 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
// tests that exactly one '-theme' is cut off
|
48 |
array(
|
49 |
'asgard-theme',
|
50 |
'some-theme-theme',
|
51 |
-
'
|
52 |
),
|
53 |
// tests that names without '-theme' suffix stay valid
|
54 |
array(
|
@@ -56,6 +68,12 @@ class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
|
|
56 |
'someothertheme',
|
57 |
'Someothertheme',
|
58 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
);
|
60 |
}
|
61 |
}
|
8 |
class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
|
9 |
{
|
10 |
/**
|
11 |
+
* @var AsgardInstaller
|
12 |
*/
|
13 |
private $installer;
|
14 |
|
26 |
public function testInflectPackageVars($type, $name, $expected)
|
27 |
{
|
28 |
$this->assertEquals(
|
29 |
+
array('name' => $expected, 'type' => $type),
|
30 |
+
$this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
|
31 |
);
|
32 |
}
|
33 |
|
34 |
public function packageNameInflectionProvider()
|
35 |
{
|
36 |
return array(
|
37 |
+
// Should keep module name StudlyCase
|
38 |
+
array(
|
39 |
+
'asgard-module',
|
40 |
+
'user-profile',
|
41 |
+
'UserProfile'
|
42 |
+
),
|
43 |
array(
|
44 |
'asgard-module',
|
45 |
'asgard-module',
|
50 |
'blog',
|
51 |
'Blog'
|
52 |
),
|
53 |
+
// tests that exactly one '-module' is cut off
|
54 |
+
array(
|
55 |
+
'asgard-module',
|
56 |
+
'some-module-module',
|
57 |
+
'SomeModule',
|
58 |
+
),
|
59 |
// tests that exactly one '-theme' is cut off
|
60 |
array(
|
61 |
'asgard-theme',
|
62 |
'some-theme-theme',
|
63 |
+
'SomeTheme',
|
64 |
),
|
65 |
// tests that names without '-theme' suffix stay valid
|
66 |
array(
|
68 |
'someothertheme',
|
69 |
'Someothertheme',
|
70 |
),
|
71 |
+
// Should keep theme name StudlyCase
|
72 |
+
array(
|
73 |
+
'asgard-theme',
|
74 |
+
'adminlte-advanced',
|
75 |
+
'AdminlteAdvanced'
|
76 |
+
),
|
77 |
);
|
78 |
}
|
79 |
}
|
embedded/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Composer\Installers\Test;
|
4 |
+
|
5 |
+
use Composer\Installers\BitrixInstaller;
|
6 |
+
use Composer\Package\PackageInterface;
|
7 |
+
use Composer\Package\Package;
|
8 |
+
use Composer\Composer;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Tests for the BitrixInstaller Class
|
12 |
+
*
|
13 |
+
* @coversDefaultClass Composer\Installers\BitrixInstaller
|
14 |
+
*/
|
15 |
+
class BitrixInstallerTest extends TestCase
|
16 |
+
{
|
17 |
+
/** @var BitrixInstaller */
|
18 |
+
private $installer;
|
19 |
+
|
20 |
+
/** @var Composer */
|
21 |
+
private $composer;
|
22 |
+
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Sets up the fixture, for example, instantiate the class-under-test.
|
26 |
+
*
|
27 |
+
* This method is called before a test is executed.
|
28 |
+
*/
|
29 |
+
final function setUp()
|
30 |
+
{
|
31 |
+
$this->composer = new Composer();
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @param string $vars
|
36 |
+
* @param string $expectedVars
|
37 |
+
*
|
38 |
+
* @covers ::inflectPackageVars
|
39 |
+
*
|
40 |
+
* @dataProvider provideExpectedInflectionResults
|
41 |
+
*/
|
42 |
+
final public function testInflectPackageVars($vars, $expectedVars)
|
43 |
+
{
|
44 |
+
|
45 |
+
$this->installer = new BitrixInstaller(
|
46 |
+
new Package($vars['name'], '4.2', '4.2'),
|
47 |
+
$this->composer
|
48 |
+
);
|
49 |
+
$actual = $this->installer->inflectPackageVars($vars);
|
50 |
+
$this->assertEquals($actual, $expectedVars);
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Provides various parameters for packages and the expected result after inflection
|
55 |
+
*
|
56 |
+
* @return array
|
57 |
+
*/
|
58 |
+
final public function provideExpectedInflectionResults()
|
59 |
+
{
|
60 |
+
return array(
|
61 |
+
//check bitrix-dir is correct
|
62 |
+
array(
|
63 |
+
array('name' => 'Nyan/Cat'),
|
64 |
+
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
|
65 |
+
),
|
66 |
+
array(
|
67 |
+
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix'),
|
68 |
+
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
|
69 |
+
),
|
70 |
+
array(
|
71 |
+
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local'),
|
72 |
+
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local')
|
73 |
+
),
|
74 |
+
);
|
75 |
+
}
|
76 |
+
}
|
embedded/composer/installers/tests/Composer/Installers/Test/InstallerTest.php
CHANGED
@@ -89,6 +89,7 @@ class InstallerTest extends TestCase
|
|
89 |
array('annotatecms-module', true),
|
90 |
array('annotatecms-component', true),
|
91 |
array('annotatecms-service', true),
|
|
|
92 |
array('bitrix-module', true),
|
93 |
array('bitrix-component', true),
|
94 |
array('bitrix-theme', true),
|
@@ -99,6 +100,7 @@ class InstallerTest extends TestCase
|
|
99 |
array('cakephp-plugin', true),
|
100 |
array('chef-cookbook', true),
|
101 |
array('chef-role', true),
|
|
|
102 |
array('codeigniter-app', false),
|
103 |
array('codeigniter-library', true),
|
104 |
array('codeigniter-third-party', true),
|
@@ -151,6 +153,7 @@ class InstallerTest extends TestCase
|
|
151 |
array('piwik-plugin', true),
|
152 |
array('phpbb-extension', true),
|
153 |
array('pimcore-plugin', true),
|
|
|
154 |
array('ppi-module', true),
|
155 |
array('prestashop-module', true),
|
156 |
array('prestashop-theme', true),
|
@@ -158,11 +161,15 @@ class InstallerTest extends TestCase
|
|
158 |
array('radphp-bundle', true),
|
159 |
array('redaxo-addon', true),
|
160 |
array('redaxo-bestyle-plugin', true),
|
|
|
|
|
161 |
array('roundcube-plugin', true),
|
162 |
array('shopware-backend-plugin', true),
|
163 |
array('shopware-core-plugin', true),
|
164 |
array('shopware-frontend-plugin', true),
|
165 |
array('shopware-theme', true),
|
|
|
|
|
166 |
array('silverstripe-module', true),
|
167 |
array('silverstripe-theme', true),
|
168 |
array('smf-module', true),
|
@@ -176,10 +183,13 @@ class InstallerTest extends TestCase
|
|
176 |
array('tusk-asset', true),
|
177 |
array('typo3-flow-plugin', true),
|
178 |
array('typo3-cms-extension', true),
|
|
|
|
|
179 |
array('whmcs-gateway', true),
|
180 |
array('wolfcms-plugin', true),
|
181 |
array('wordpress-plugin', true),
|
182 |
array('wordpress-core', false),
|
|
|
183 |
array('zend-library', true),
|
184 |
array('zikula-module', true),
|
185 |
array('zikula-theme', true),
|
@@ -217,6 +227,7 @@ class InstallerTest extends TestCase
|
|
217 |
array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),
|
218 |
array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),
|
219 |
array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),
|
|
|
220 |
array('bitrix-module', 'bitrix/modules/my_module/', 'author/my_module'),
|
221 |
array('bitrix-component', 'bitrix/components/my_component/', 'author/my_component'),
|
222 |
array('bitrix-theme', 'bitrix/templates/my_theme/', 'author/my_theme'),
|
@@ -227,6 +238,7 @@ class InstallerTest extends TestCase
|
|
227 |
array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
|
228 |
array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
|
229 |
array('chef-role', 'Chef/roles/my_role/', 'mre/my_role'),
|
|
|
230 |
array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),
|
231 |
array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),
|
232 |
array('concrete5-block', 'blocks/concrete5_block/', 'remo/concrete5_block'),
|
@@ -247,8 +259,8 @@ class InstallerTest extends TestCase
|
|
247 |
array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
|
248 |
array('ee3-addon', 'system/user/addons/ee_theme/', 'author/ee_theme'),
|
249 |
array('ee3-theme', 'themes/user/ee_package/', 'author/ee_package'),
|
250 |
-
array('ee2-addon', 'system/expressionengine/
|
251 |
-
array('ee2-theme', 'themes/
|
252 |
array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
|
253 |
array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
|
254 |
array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
|
@@ -289,17 +301,22 @@ class InstallerTest extends TestCase
|
|
289 |
array('phpbb-style', 'styles/foo/', 'test/foo'),
|
290 |
array('phpbb-language', 'language/foo/', 'test/foo'),
|
291 |
array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
|
|
|
292 |
array('ppi-module', 'modules/foo/', 'test/foo'),
|
293 |
array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
|
294 |
array('radphp-bundle', 'src/Migration/', 'atkrad/migration'),
|
295 |
array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
|
296 |
array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
|
|
|
|
|
297 |
array('roundcube-plugin', 'plugins/base/', 'test/base'),
|
298 |
array('roundcube-plugin', 'plugins/replace_dash/', 'test/replace-dash'),
|
299 |
array('shopware-backend-plugin', 'engine/Shopware/Plugins/Local/Backend/ShamaMyBackendPlugin/', 'shama/my-backend-plugin'),
|
300 |
array('shopware-core-plugin', 'engine/Shopware/Plugins/Local/Core/ShamaMyCorePlugin/', 'shama/my-core-plugin'),
|
301 |
array('shopware-frontend-plugin', 'engine/Shopware/Plugins/Local/Frontend/ShamaMyFrontendPlugin/', 'shama/my-frontend-plugin'),
|
302 |
array('shopware-theme', 'templates/my_theme/', 'shama/my-theme'),
|
|
|
|
|
303 |
array('silverstripe-module', 'my_module/', 'shama/my_module'),
|
304 |
array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),
|
305 |
array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),
|
@@ -318,6 +335,8 @@ class InstallerTest extends TestCase
|
|
318 |
array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),
|
319 |
array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),
|
320 |
array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),
|
|
|
|
|
321 |
array('whmcs-gateway', 'modules/gateways/gateway_name/', 'vendor/gateway_name'),
|
322 |
array('wolfcms-plugin', 'wolf/plugins/my_plugin/', 'shama/my_plugin'),
|
323 |
array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),
|
@@ -330,6 +349,7 @@ class InstallerTest extends TestCase
|
|
330 |
array('phifty-bundle', 'bundles/core/', 'shama/core'),
|
331 |
array('phifty-library', 'libraries/my-lib/', 'shama/my-lib'),
|
332 |
array('phifty-framework', 'frameworks/my-framework/', 'shama/my-framework'),
|
|
|
333 |
);
|
334 |
}
|
335 |
|
89 |
array('annotatecms-module', true),
|
90 |
array('annotatecms-component', true),
|
91 |
array('annotatecms-service', true),
|
92 |
+
array('attogram-module', true),
|
93 |
array('bitrix-module', true),
|
94 |
array('bitrix-component', true),
|
95 |
array('bitrix-theme', true),
|
100 |
array('cakephp-plugin', true),
|
101 |
array('chef-cookbook', true),
|
102 |
array('chef-role', true),
|
103 |
+
array('cockpit-module', true),
|
104 |
array('codeigniter-app', false),
|
105 |
array('codeigniter-library', true),
|
106 |
array('codeigniter-third-party', true),
|
153 |
array('piwik-plugin', true),
|
154 |
array('phpbb-extension', true),
|
155 |
array('pimcore-plugin', true),
|
156 |
+
array('plentymarkets-plugin', true),
|
157 |
array('ppi-module', true),
|
158 |
array('prestashop-module', true),
|
159 |
array('prestashop-theme', true),
|
161 |
array('radphp-bundle', true),
|
162 |
array('redaxo-addon', true),
|
163 |
array('redaxo-bestyle-plugin', true),
|
164 |
+
array('reindex-theme', true),
|
165 |
+
array('reindex-plugin', true),
|
166 |
array('roundcube-plugin', true),
|
167 |
array('shopware-backend-plugin', true),
|
168 |
array('shopware-core-plugin', true),
|
169 |
array('shopware-frontend-plugin', true),
|
170 |
array('shopware-theme', true),
|
171 |
+
array('shopware-plugin', true),
|
172 |
+
array('shopware-frontend-theme', true),
|
173 |
array('silverstripe-module', true),
|
174 |
array('silverstripe-theme', true),
|
175 |
array('smf-module', true),
|
183 |
array('tusk-asset', true),
|
184 |
array('typo3-flow-plugin', true),
|
185 |
array('typo3-cms-extension', true),
|
186 |
+
array('vanilla-plugin', true),
|
187 |
+
array('vanilla-theme', true),
|
188 |
array('whmcs-gateway', true),
|
189 |
array('wolfcms-plugin', true),
|
190 |
array('wordpress-plugin', true),
|
191 |
array('wordpress-core', false),
|
192 |
+
array('yawik-module', true),
|
193 |
array('zend-library', true),
|
194 |
array('zikula-module', true),
|
195 |
array('zikula-theme', true),
|
227 |
array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),
|
228 |
array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),
|
229 |
array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),
|
230 |
+
array('attogram-module', 'modules/my_module/', 'author/my_module'),
|
231 |
array('bitrix-module', 'bitrix/modules/my_module/', 'author/my_module'),
|
232 |
array('bitrix-component', 'bitrix/components/my_component/', 'author/my_component'),
|
233 |
array('bitrix-theme', 'bitrix/templates/my_theme/', 'author/my_theme'),
|
238 |
array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
|
239 |
array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
|
240 |
array('chef-role', 'Chef/roles/my_role/', 'mre/my_role'),
|
241 |
+
array('cockpit-module', 'cockpit/modules/addons/My_module/', 'piotr-cz/cockpit-my_module'),
|
242 |
array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),
|
243 |
array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),
|
244 |
array('concrete5-block', 'blocks/concrete5_block/', 'remo/concrete5_block'),
|
259 |
array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
|
260 |
array('ee3-addon', 'system/user/addons/ee_theme/', 'author/ee_theme'),
|
261 |
array('ee3-theme', 'themes/user/ee_package/', 'author/ee_package'),
|
262 |
+
array('ee2-addon', 'system/expressionengine/third_party/ee_theme/', 'author/ee_theme'),
|
263 |
+
array('ee2-theme', 'themes/third_party/ee_package/', 'author/ee_package'),
|
264 |
array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
|
265 |
array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
|
266 |
array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
|
301 |
array('phpbb-style', 'styles/foo/', 'test/foo'),
|
302 |
array('phpbb-language', 'language/foo/', 'test/foo'),
|
303 |
array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
|
304 |
+
array('plentymarkets-plugin', 'HelloWorld/', 'plugin-hello-world'),
|
305 |
array('ppi-module', 'modules/foo/', 'test/foo'),
|
306 |
array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
|
307 |
array('radphp-bundle', 'src/Migration/', 'atkrad/migration'),
|
308 |
array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
|
309 |
array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
|
310 |
+
array('reindex-theme', 'themes/my_module/', 'author/my_module'),
|
311 |
+
array('reindex-plugin', 'plugins/my_module/', 'author/my_module'),
|
312 |
array('roundcube-plugin', 'plugins/base/', 'test/base'),
|
313 |
array('roundcube-plugin', 'plugins/replace_dash/', 'test/replace-dash'),
|
314 |
array('shopware-backend-plugin', 'engine/Shopware/Plugins/Local/Backend/ShamaMyBackendPlugin/', 'shama/my-backend-plugin'),
|
315 |
array('shopware-core-plugin', 'engine/Shopware/Plugins/Local/Core/ShamaMyCorePlugin/', 'shama/my-core-plugin'),
|
316 |
array('shopware-frontend-plugin', 'engine/Shopware/Plugins/Local/Frontend/ShamaMyFrontendPlugin/', 'shama/my-frontend-plugin'),
|
317 |
array('shopware-theme', 'templates/my_theme/', 'shama/my-theme'),
|
318 |
+
array('shopware-frontend-theme', 'themes/Frontend/ShamaMyFrontendTheme/', 'shama/my-frontend-theme'),
|
319 |
+
array('shopware-plugin', 'custom/plugins/ShamaMyPlugin/', 'shama/my-plugin'),
|
320 |
array('silverstripe-module', 'my_module/', 'shama/my_module'),
|
321 |
array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),
|
322 |
array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),
|
335 |
array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),
|
336 |
array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),
|
337 |
array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),
|
338 |
+
array('vanilla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
|
339 |
+
array('vanilla-theme', 'themes/my_theme/', 'shama/my_theme'),
|
340 |
array('whmcs-gateway', 'modules/gateways/gateway_name/', 'vendor/gateway_name'),
|
341 |
array('wolfcms-plugin', 'wolf/plugins/my_plugin/', 'shama/my_plugin'),
|
342 |
array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),
|
349 |
array('phifty-bundle', 'bundles/core/', 'shama/core'),
|
350 |
array('phifty-library', 'libraries/my-lib/', 'shama/my-lib'),
|
351 |
array('phifty-framework', 'frameworks/my-framework/', 'shama/my-framework'),
|
352 |
+
array('yawik-module', 'module/MyModule/', 'shama/my_module'),
|
353 |
);
|
354 |
}
|
355 |
|
embedded/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers\Test;
|
3 |
+
|
4 |
+
use Composer\Composer;
|
5 |
+
use Composer\Installers\YawikInstaller;
|
6 |
+
use Composer\Package\Package;
|
7 |
+
use Composer\Package\PackageInterface;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class YawikInstallerTest
|
11 |
+
*
|
12 |
+
* @package Composer\Installers\Test
|
13 |
+
*/
|
14 |
+
class YawikInstallerTest extends TestCase
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* @varComposer
|
18 |
+
*/
|
19 |
+
private $composer;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @var PackageInterface
|
23 |
+
*/
|
24 |
+
private $io;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @var Package
|
28 |
+
*/
|
29 |
+
private $package;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* setUp
|
33 |
+
*
|
34 |
+
* @return void
|
35 |
+
*/
|
36 |
+
public function setUp()
|
37 |
+
{
|
38 |
+
$this->package = new Package('YawikCompanyRegistration', '1.0', '1.0');
|
39 |
+
$this->io = $this->getMock('Composer\IO\PackageInterface');
|
40 |
+
$this->composer = new Composer();
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* testInflectPackageVars
|
45 |
+
*
|
46 |
+
* @dataProvider packageNameProvider
|
47 |
+
* @return void
|
48 |
+
*/
|
49 |
+
public function testInflectPackageVars($input)
|
50 |
+
{
|
51 |
+
$installer = new YawikInstaller($this->package, $this->composer);
|
52 |
+
$result = $installer->inflectPackageVars(array('name' => $input));
|
53 |
+
$this->assertEquals($result, array('name' => 'YawikCompanyRegistration'));
|
54 |
+
}
|
55 |
+
|
56 |
+
public function packageNameProvider()
|
57 |
+
{
|
58 |
+
return array(
|
59 |
+
array('yawik-company-registration'),
|
60 |
+
array('yawik_company_registration'),
|
61 |
+
array('YawikCompanyRegistration')
|
62 |
+
);
|
63 |
+
}
|
64 |
+
}
|
embedded/otgs/installer/changelog.txt
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
= 1.7.10 =
|
2 |
* Fixed a notice that was appearing when the site key registration failed
|
3 |
|
1 |
+
= 1.7.11 =
|
2 |
+
* Fixed styling for 'must-register' warnings on the plugins page
|
3 |
+
|
4 |
= 1.7.10 =
|
5 |
* Fixed a notice that was appearing when the site key registration failed
|
6 |
|
embedded/otgs/installer/includes/installer.class.php
CHANGED
@@ -1040,7 +1040,8 @@ final class WP_Installer{
|
|
1040 |
$this->settings['repositories'][$repository_id]['subscription'] = array('key' => $site_key, 'data' => $subscription_data);
|
1041 |
$this->save_settings();
|
1042 |
} else {
|
1043 |
-
$error = __( 'Invalid site key for the current site.', 'installer' )
|
|
|
1044 |
}
|
1045 |
|
1046 |
} catch (Exception $e ){
|
@@ -2100,23 +2101,42 @@ final class WP_Installer{
|
|
2100 |
}
|
2101 |
|
2102 |
}
|
2103 |
-
|
2104 |
public function show_purchase_notice_under_plugin($plugin_file, $plugin_data, $status){
|
2105 |
-
|
2106 |
$wp_list_table = _get_list_table('WP_Plugins_List_Table');
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
<?php
|
2112 |
-
printf(__('You need to have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s.', 'installer'),
|
2113 |
-
'<a href="' . $this->menu_url() . '">', '</a>');
|
2114 |
?>
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2120 |
}
|
2121 |
|
2122 |
public function localize_strings(){
|
1040 |
$this->settings['repositories'][$repository_id]['subscription'] = array('key' => $site_key, 'data' => $subscription_data);
|
1041 |
$this->save_settings();
|
1042 |
} else {
|
1043 |
+
$error = __( 'Invalid site key for the current site.', 'installer' )
|
1044 |
+
. '<br /><div class="installer-footnote">' . __('Please note that the site key is case sensitive.', 'installer') . '</div>';
|
1045 |
}
|
1046 |
|
1047 |
} catch (Exception $e ){
|
2101 |
}
|
2102 |
|
2103 |
}
|
2104 |
+
|
2105 |
public function show_purchase_notice_under_plugin($plugin_file, $plugin_data, $status){
|
2106 |
+
|
2107 |
$wp_list_table = _get_list_table('WP_Plugins_List_Table');
|
2108 |
+
$wp_version = preg_replace( '/-(.+)$/', '', $GLOBALS['wp_version'] );
|
2109 |
+
|
2110 |
+
if( version_compare( $wp_version, '4.6', '>=' ) ){
|
2111 |
+
|
|
|
|
|
|
|
2112 |
?>
|
2113 |
+
<tr class="plugin-update-tr installer-plugin-update-tr">
|
2114 |
+
<td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="plugin-update colspanchange">
|
2115 |
+
<div class="notice inline notice-warning notice-alt">
|
2116 |
+
<p class="installer-q-icon">
|
2117 |
+
<?php printf( __('You must have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s.', 'installer'),
|
2118 |
+
'<a href="' . $this->menu_url() . '">', '</a>'); ?>
|
2119 |
+
</p>
|
2120 |
+
</div>
|
2121 |
+
</td>
|
2122 |
+
</tr>
|
2123 |
+
<?php
|
2124 |
+
|
2125 |
+
} else {
|
2126 |
+
|
2127 |
+
?>
|
2128 |
+
<tr class="plugin-update-tr">
|
2129 |
+
<td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="plugin-update colspanchange">
|
2130 |
+
<div class="update-message installer-q-icon">
|
2131 |
+
<?php printf( __('You must have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s.', 'installer'),
|
2132 |
+
'<a href="' . $this->menu_url() . '">', '</a>'); ?>
|
2133 |
+
</div>
|
2134 |
+
</td>
|
2135 |
+
</tr>
|
2136 |
+
<?php
|
2137 |
+
|
2138 |
+
}
|
2139 |
+
|
2140 |
}
|
2141 |
|
2142 |
public function localize_strings(){
|
embedded/otgs/installer/installer.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
define('WP_INSTALLER_VERSION', '1.7.
|
3 |
|
4 |
include_once dirname(__FILE__) . '/includes/installer.class.php';
|
5 |
|
1 |
<?php
|
2 |
+
define('WP_INSTALLER_VERSION', '1.7.11');
|
3 |
|
4 |
include_once dirname(__FILE__) . '/includes/installer.class.php';
|
5 |
|
embedded/otgs/installer/loader.php
CHANGED
@@ -19,7 +19,7 @@ $wp_installer_instance = dirname(__FILE__) . '/installer.php';
|
|
19 |
global $wp_installer_instances;
|
20 |
$wp_installer_instances[$wp_installer_instance] = array(
|
21 |
'bootfile' => $wp_installer_instance,
|
22 |
-
'version' => '1.7.
|
23 |
);
|
24 |
|
25 |
|
19 |
global $wp_installer_instances;
|
20 |
$wp_installer_instances[$wp_installer_instance] = array(
|
21 |
'bootfile' => $wp_installer_instance,
|
22 |
+
'version' => '1.7.11'
|
23 |
);
|
24 |
|
25 |
|
embedded/otgs/installer/res/css/admin.css
CHANGED
@@ -15,20 +15,28 @@
|
|
15 |
.installer-status-activated{color: #333366; font-weight: bold; }
|
16 |
|
17 |
.js-status-success p{
|
18 |
-
color: #FF9900;
|
19 |
padding: 4px;
|
20 |
}
|
21 |
|
22 |
.installer-green-text{
|
23 |
-
color:#006600;
|
24 |
font-weight:bold;
|
25 |
}
|
26 |
|
27 |
.installer-red-text{
|
28 |
-
color:#b22121;
|
29 |
font-weight:bold;
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
.installer-products-list li{
|
33 |
display: inline;
|
34 |
margin-right: 20px;
|
@@ -85,6 +93,13 @@
|
|
85 |
|
86 |
.installer-q-icon:before{
|
87 |
content: '\f223' !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
|
90 |
.otgsi_yellow_bg{
|
@@ -95,12 +110,12 @@
|
|
95 |
width:480px;
|
96 |
border: solid 1px #999;
|
97 |
padding:10px;
|
98 |
-
border-radius: 5px;
|
99 |
}
|
100 |
|
101 |
.installer-plugins-list-compact{
|
102 |
background-color: #fff;
|
103 |
-
border-collapse: collapse;
|
104 |
border:solid 1px #C1DAD7;
|
105 |
width:100%;
|
106 |
}
|
@@ -128,17 +143,17 @@
|
|
128 |
width:16px;
|
129 |
}
|
130 |
|
131 |
-
.otgs_wp_installer_table_compact .installer-status-downloading,
|
132 |
-
.otgs_wp_installer_table_compact .installer-status-downloaded,
|
133 |
-
.otgs_wp_installer_table_compact .installer-status-activating,
|
134 |
.otgs_wp_installer_table_compact .installer-status-activated{
|
135 |
-
display: none;
|
136 |
color:transparent; width: 12px; padding:2px;
|
137 |
}
|
138 |
|
139 |
.otgs_wp_installer_table_compact .installer-status-success,
|
140 |
.otgs_wp_installer_table_compact .installer-status-fail{
|
141 |
-
display: none;
|
142 |
}
|
143 |
|
144 |
.installer-status-success{
|
15 |
.installer-status-activated{color: #333366; font-weight: bold; }
|
16 |
|
17 |
.js-status-success p{
|
18 |
+
color: #FF9900;
|
19 |
padding: 4px;
|
20 |
}
|
21 |
|
22 |
.installer-green-text{
|
23 |
+
color:#006600;
|
24 |
font-weight:bold;
|
25 |
}
|
26 |
|
27 |
.installer-red-text{
|
28 |
+
color:#b22121;
|
29 |
font-weight:bold;
|
30 |
}
|
31 |
|
32 |
+
.installer-footnote{
|
33 |
+
color:#3d5e69;
|
34 |
+
display:block;
|
35 |
+
float: left;
|
36 |
+
font-style: italic;
|
37 |
+
font-size: 90%;
|
38 |
+
}
|
39 |
+
|
40 |
.installer-products-list li{
|
41 |
display: inline;
|
42 |
margin-right: 20px;
|
93 |
|
94 |
.installer-q-icon:before{
|
95 |
content: '\f223' !important;
|
96 |
+
font-family: dashicons !important;
|
97 |
+
color: #f56e28;
|
98 |
+
font: 20px/1 "dashicons";
|
99 |
+
}
|
100 |
+
|
101 |
+
.installer-plugin-update-tr td{
|
102 |
+
padding-left:3px !important;
|
103 |
}
|
104 |
|
105 |
.otgsi_yellow_bg{
|
110 |
width:480px;
|
111 |
border: solid 1px #999;
|
112 |
padding:10px;
|
113 |
+
border-radius: 5px;
|
114 |
}
|
115 |
|
116 |
.installer-plugins-list-compact{
|
117 |
background-color: #fff;
|
118 |
+
border-collapse: collapse;
|
119 |
border:solid 1px #C1DAD7;
|
120 |
width:100%;
|
121 |
}
|
143 |
width:16px;
|
144 |
}
|
145 |
|
146 |
+
.otgs_wp_installer_table_compact .installer-status-downloading,
|
147 |
+
.otgs_wp_installer_table_compact .installer-status-downloaded,
|
148 |
+
.otgs_wp_installer_table_compact .installer-status-activating,
|
149 |
.otgs_wp_installer_table_compact .installer-status-activated{
|
150 |
+
display: none;
|
151 |
color:transparent; width: 12px; padding:2px;
|
152 |
}
|
153 |
|
154 |
.otgs_wp_installer_table_compact .installer-status-success,
|
155 |
.otgs_wp_installer_table_compact .installer-status-fail{
|
156 |
+
display: none;
|
157 |
}
|
158 |
|
159 |
.installer-status-success{
|
inc/admin-menus/class-wcml-admin-menus.php
CHANGED
@@ -28,13 +28,26 @@ class WCML_Admin_Menus{
|
|
28 |
}
|
29 |
|
30 |
public static function register_menus(){
|
|
|
|
|
31 |
if( self::$woocommerce_wpml->check_dependencies && self::$woocommerce_wpml->check_design_update){
|
32 |
$top_page = apply_filters('icl_menu_main_page', basename(ICL_PLUGIN_PATH) .'/menu/languages.php');
|
33 |
|
34 |
-
if(current_user_can('wpml_manage_woocommerce_multilingual')){
|
35 |
add_submenu_page($top_page, __('WooCommerce Multilingual', 'woocommerce-multilingual'),
|
36 |
__('WooCommerce Multilingual', 'woocommerce-multilingual'), 'wpml_manage_woocommerce_multilingual', 'wpml-wcml', array(__CLASS__, 'render_menus'));
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}else{
|
39 |
$user_lang_pairs = get_user_meta(get_current_user_id(), self::$wpdb->prefix.'language_pairs', true);
|
40 |
if( !empty( $user_lang_pairs ) ){
|
28 |
}
|
29 |
|
30 |
public static function register_menus(){
|
31 |
+
global $WPML_Translation_Management;
|
32 |
+
|
33 |
if( self::$woocommerce_wpml->check_dependencies && self::$woocommerce_wpml->check_design_update){
|
34 |
$top_page = apply_filters('icl_menu_main_page', basename(ICL_PLUGIN_PATH) .'/menu/languages.php');
|
35 |
|
36 |
+
if( current_user_can('wpml_manage_woocommerce_multilingual') ){
|
37 |
add_submenu_page($top_page, __('WooCommerce Multilingual', 'woocommerce-multilingual'),
|
38 |
__('WooCommerce Multilingual', 'woocommerce-multilingual'), 'wpml_manage_woocommerce_multilingual', 'wpml-wcml', array(__CLASS__, 'render_menus'));
|
39 |
|
40 |
+
}elseif( current_user_can('wpml_operate_woocommerce_multilingual') ){
|
41 |
+
add_menu_page( __( 'WooCommerce Multilingual', 'woocommerce-multilingual' ), __( 'WooCommerce Multilingual', 'woocommerce-multilingual' ),
|
42 |
+
'wpml_operate_woocommerce_multilingual', 'wpml-wcml', array(__CLASS__, 'render_menus'), WCML_PLUGIN_URL . '/res/images/icon16.png' );
|
43 |
+
|
44 |
+
//force add translations-queue page for shop manager
|
45 |
+
$wp_api = self::$sitepress->get_wp_api();
|
46 |
+
if ( !$wp_api->current_user_can( 'wpml_manage_translation_management' ) ) {
|
47 |
+
$wp_api->add_submenu_page( null,
|
48 |
+
__( 'Translations', 'wpml-translation-management' ), __( 'Translations', 'wpml-translation-management' ),
|
49 |
+
'wpml_operate_woocommerce_multilingual', WPML_TM_FOLDER . '/menu/translations-queue.php', array( $WPML_Translation_Management, 'translation_queue_page' ) );
|
50 |
+
}
|
51 |
}else{
|
52 |
$user_lang_pairs = get_user_meta(get_current_user_id(), self::$wpdb->prefix.'language_pairs', true);
|
53 |
if( !empty( $user_lang_pairs ) ){
|
inc/class-wcml-emails.php
CHANGED
@@ -44,14 +44,14 @@ class WCML_Emails{
|
|
44 |
add_action('woocommerce_order_partially_refunded_notification', array($this,'refresh_email_lang'), 9);
|
45 |
|
46 |
|
47 |
-
//
|
48 |
-
add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, '
|
49 |
-
add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, '
|
50 |
-
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $this, '
|
51 |
-
add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, '
|
52 |
-
add_action( 'woocommerce_order_status_failed_to_completed_notification', array( $this, '
|
53 |
-
add_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $this, '
|
54 |
-
add_action( 'woocommerce_before_resend_order_emails', array( $this, '
|
55 |
|
56 |
add_filter( 'icl_st_admin_string_return_cached', array( $this, 'admin_string_return_cached' ), 10, 2 );
|
57 |
|
@@ -205,7 +205,7 @@ class WCML_Emails{
|
|
205 |
}
|
206 |
|
207 |
|
208 |
-
function
|
209 |
global $woocommerce;
|
210 |
if(isset( $woocommerce->mailer()->emails['WC_Email_New_Order'] )){
|
211 |
$recipients = explode(',',$woocommerce->mailer()->emails['WC_Email_New_Order']->get_recipient());
|
@@ -232,6 +232,12 @@ class WCML_Emails{
|
|
232 |
}
|
233 |
}
|
234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
function filter_payment_method_string( $check, $object_id, $meta_key, $single ){
|
236 |
if( $meta_key == '_payment_method_title' ){
|
237 |
|
44 |
add_action('woocommerce_order_partially_refunded_notification', array($this,'refresh_email_lang'), 9);
|
45 |
|
46 |
|
47 |
+
//new order admins email
|
48 |
+
add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'new_order_admin_email' ), 9 );
|
49 |
+
add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, 'new_order_admin_email' ), 9 );
|
50 |
+
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $this, 'new_order_admin_email' ), 9 );
|
51 |
+
add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, 'new_order_admin_email' ), 9 );
|
52 |
+
add_action( 'woocommerce_order_status_failed_to_completed_notification', array( $this, 'new_order_admin_email' ), 9 );
|
53 |
+
add_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $this, 'new_order_admin_email' ), 9 );
|
54 |
+
add_action( 'woocommerce_before_resend_order_emails', array( $this, 'backend_new_order_admin_email' ), 9 );
|
55 |
|
56 |
add_filter( 'icl_st_admin_string_return_cached', array( $this, 'admin_string_return_cached' ), 10, 2 );
|
57 |
|
205 |
}
|
206 |
|
207 |
|
208 |
+
function new_order_admin_email($order_id){
|
209 |
global $woocommerce;
|
210 |
if(isset( $woocommerce->mailer()->emails['WC_Email_New_Order'] )){
|
211 |
$recipients = explode(',',$woocommerce->mailer()->emails['WC_Email_New_Order']->get_recipient());
|
232 |
}
|
233 |
}
|
234 |
|
235 |
+
public function backend_new_order_admin_email( $order_id ){
|
236 |
+
if( isset( $_POST[ 'wc_order_action' ] ) && $_POST[ 'wc_order_action' ] == 'send_email_new_order' ){
|
237 |
+
$this->new_order_admin_email( $order_id );
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
function filter_payment_method_string( $check, $object_id, $meta_key, $single ){
|
242 |
if( $meta_key == '_payment_method_title' ){
|
243 |
|
inc/class-wcml-orders.php
CHANGED
@@ -36,20 +36,23 @@ class WCML_Orders{
|
|
36 |
//special case for wcml-741
|
37 |
add_action('updated_post_meta', array($this,'update_order_currency'), 100,4);
|
38 |
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
function filtered_woocommerce_new_order_note_data($translations, $text, $domain ){
|
42 |
if(in_array($text,$this->standart_order_notes)){
|
43 |
-
global $
|
44 |
|
45 |
$language = $woocommerce_wpml->strings->get_string_language( $text, 'woocommerce' );
|
46 |
|
47 |
-
if( $
|
48 |
|
49 |
$string_id = icl_get_string_id( $text, 'woocommerce');
|
50 |
$strings = icl_get_string_translations_by_id( $string_id );
|
51 |
if($strings){
|
52 |
-
$translations = $strings[ $
|
53 |
}
|
54 |
|
55 |
}else{
|
@@ -89,19 +92,21 @@ class WCML_Orders{
|
|
89 |
}
|
90 |
|
91 |
function woocommerce_order_get_items($items){
|
92 |
-
|
93 |
-
|
|
|
|
|
94 |
foreach($items as $index=>$item){
|
95 |
foreach($item as $key=>$item_data){
|
96 |
if($key == 'product_id'){
|
97 |
-
$tr_product_id = apply_filters( 'translate_object_id',$item_data,'product',false,$
|
98 |
if(!is_null($tr_product_id)){
|
99 |
$items[$index][$key] = $tr_product_id;
|
100 |
$items[$index]['name'] = get_the_title($tr_product_id);
|
101 |
}
|
102 |
}
|
103 |
if($key == 'variation_id'){
|
104 |
-
$tr_variation_id = apply_filters( 'translate_object_id',$item_data,'product_variation',false,$
|
105 |
if(!is_null($tr_variation_id)){
|
106 |
$items[$index][$key] = $tr_variation_id;
|
107 |
}
|
@@ -110,21 +115,68 @@ class WCML_Orders{
|
|
110 |
if (substr($key, 0, 3) == 'pa_') {
|
111 |
global $wpdb, $woocommerce_wpml;
|
112 |
//attr is taxonomy
|
113 |
-
|
114 |
$term_id = $woocommerce_wpml->terms->wcml_get_term_id_by_slug( $key, $item_data );
|
115 |
-
$
|
116 |
|
117 |
-
|
118 |
-
$translated_slug = $wpdb->get_var($wpdb->prepare("
|
119 |
-
SELECT t.slug FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $tr_id, $key));
|
120 |
-
$items[$index][$key] = $translated_slug;
|
121 |
-
}
|
122 |
}
|
123 |
}
|
124 |
}
|
125 |
}
|
126 |
return $items;
|
127 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
// Fix for shipping update on the checkout page.
|
130 |
function fix_shipping_update($amount){
|
36 |
//special case for wcml-741
|
37 |
add_action('updated_post_meta', array($this,'update_order_currency'), 100,4);
|
38 |
|
39 |
+
add_action( 'woocommerce_before_order_itemmeta', array( $this, 'backend_before_order_itemmeta' ), 100, 3 );
|
40 |
+
add_action( 'woocommerce_after_order_itemmeta', array( $this, 'backend_after_order_itemmeta' ), 100, 3 );
|
41 |
+
|
42 |
}
|
43 |
|
44 |
function filtered_woocommerce_new_order_note_data($translations, $text, $domain ){
|
45 |
if(in_array($text,$this->standart_order_notes)){
|
46 |
+
global $sitepress, $wpdb, $woocommerce_wpml;
|
47 |
|
48 |
$language = $woocommerce_wpml->strings->get_string_language( $text, 'woocommerce' );
|
49 |
|
50 |
+
if( $sitepress->get_user_admin_language( get_current_user_id(), true ) != $language ){
|
51 |
|
52 |
$string_id = icl_get_string_id( $text, 'woocommerce');
|
53 |
$strings = icl_get_string_translations_by_id( $string_id );
|
54 |
if($strings){
|
55 |
+
$translations = $strings[ $sitepress->get_user_admin_language( get_current_user_id(), true ) ]['value'];
|
56 |
}
|
57 |
|
58 |
}else{
|
92 |
}
|
93 |
|
94 |
function woocommerce_order_get_items($items){
|
95 |
+
global $sitepress;
|
96 |
+
|
97 |
+
if( isset( $_GET[ 'post' ] ) && get_post_type( $_GET[ 'post' ] ) == 'shop_order' ){
|
98 |
+
|
99 |
foreach($items as $index=>$item){
|
100 |
foreach($item as $key=>$item_data){
|
101 |
if($key == 'product_id'){
|
102 |
+
$tr_product_id = apply_filters( 'translate_object_id',$item_data,'product',false,$sitepress->get_user_admin_language( get_current_user_id(), true ) );
|
103 |
if(!is_null($tr_product_id)){
|
104 |
$items[$index][$key] = $tr_product_id;
|
105 |
$items[$index]['name'] = get_the_title($tr_product_id);
|
106 |
}
|
107 |
}
|
108 |
if($key == 'variation_id'){
|
109 |
+
$tr_variation_id = apply_filters( 'translate_object_id',$item_data,'product_variation',false,$sitepress->get_user_admin_language( get_current_user_id(), true ) );
|
110 |
if(!is_null($tr_variation_id)){
|
111 |
$items[$index][$key] = $tr_variation_id;
|
112 |
}
|
115 |
if (substr($key, 0, 3) == 'pa_') {
|
116 |
global $wpdb, $woocommerce_wpml;
|
117 |
//attr is taxonomy
|
|
|
118 |
$term_id = $woocommerce_wpml->terms->wcml_get_term_id_by_slug( $key, $item_data );
|
119 |
+
$translated_term = $woocommerce_wpml->terms->wcml_get_translated_term( $term_id, $item_data, $sitepress->get_user_admin_language( get_current_user_id(), true ) );
|
120 |
|
121 |
+
$items[$index][$key] = $translated_term->slug;
|
|
|
|
|
|
|
|
|
122 |
}
|
123 |
}
|
124 |
}
|
125 |
}
|
126 |
return $items;
|
127 |
}
|
128 |
+
|
129 |
+
public function backend_before_order_itemmeta( $item_id, $item, $product ){
|
130 |
+
global $sitepress;
|
131 |
+
|
132 |
+
if( $this->get_order_language_by_item_id( $item_id ) != $sitepress->get_user_admin_language( get_current_user_id(), true ) ){
|
133 |
+
foreach( $item[ 'item_meta' ] as $key => $item_meta ){
|
134 |
+
if ( taxonomy_exists( wc_attribute_taxonomy_name( $key ) ) || substr( $key, 0, 3 ) == 'pa_' ) {
|
135 |
+
foreach( $item_meta as $value ){
|
136 |
+
$this->force_update_itemmeta( $item_id, $key, $value, $sitepress->get_user_admin_language( get_current_user_id(), true ) );
|
137 |
+
}
|
138 |
+
}
|
139 |
+
}
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
public function backend_after_order_itemmeta( $item_id, $item, $product ){
|
144 |
+
global $sitepress;
|
145 |
+
|
146 |
+
$order_languge = $this->get_order_language_by_item_id( $item_id );
|
147 |
+
if( $order_languge != $sitepress->get_user_admin_language( get_current_user_id(), true ) ){
|
148 |
+
foreach( $item[ 'item_meta' ] as $key => $item_meta ){
|
149 |
+
if ( taxonomy_exists( wc_attribute_taxonomy_name( $key ) ) || substr( $key, 0, 3 ) == 'pa_' ) {
|
150 |
+
foreach( $item_meta as $value ){
|
151 |
+
$this->force_update_itemmeta( $item_id, $key, $value, $order_languge );
|
152 |
+
}
|
153 |
+
}
|
154 |
+
}
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
public function get_order_language_by_item_id( $item_id ){
|
159 |
+
global $wpdb;
|
160 |
+
|
161 |
+
$order_id = $wpdb->get_var( $wpdb->prepare( "SELECT order_id FROM {$wpdb->prefix}woocommerce_order_items WHERE order_item_id = %d", $item_id ) );
|
162 |
+
|
163 |
+
return get_post_meta( $order_id, 'wpml_language', true );
|
164 |
+
}
|
165 |
+
|
166 |
+
//force update to display attribute in correct language on edit order page
|
167 |
+
public function force_update_itemmeta( $item_id, $key, $value, $languge ){
|
168 |
+
global $wpdb, $woocommerce_wpml;
|
169 |
+
|
170 |
+
$taxonomy = substr( $key, 0, 3 ) != 'pa_' ? wc_attribute_taxonomy_name( $key ) : $key;
|
171 |
+
$term_id = $woocommerce_wpml->terms->wcml_get_term_id_by_slug( $taxonomy, $value );
|
172 |
+
$translated_term = $woocommerce_wpml->terms->wcml_get_translated_term( $term_id, $taxonomy, $languge );
|
173 |
+
$translated_term = $woocommerce_wpml->terms->wcml_get_translated_term( $term_id, $taxonomy, $languge );
|
174 |
+
|
175 |
+
if( $translated_term ){
|
176 |
+
$value = $translated_term->slug;
|
177 |
+
$wpdb->update( $wpdb->prefix.'woocommerce_order_itemmeta', array( 'meta_value' => $value ), array( 'order_item_id' => $item_id, 'meta_key' => $key ) );
|
178 |
+
}
|
179 |
+
}
|
180 |
|
181 |
// Fix for shipping update on the checkout page.
|
182 |
function fix_shipping_update($amount){
|
inc/class-wcml-products.php
CHANGED
@@ -47,6 +47,8 @@ class WCML_Products{
|
|
47 |
add_action( 'woocommerce_after_product_ordering', array( $this, 'update_all_products_translations_ordering' ) );
|
48 |
//filter to copy excerpt value
|
49 |
add_filter( 'wpml_copy_from_original_custom_fields', array( $this, 'filter_excerpt_field_content_copy' ) );
|
|
|
|
|
50 |
}
|
51 |
|
52 |
// Check if original product
|
@@ -221,6 +223,15 @@ class WCML_Products{
|
|
221 |
<?php }
|
222 |
}
|
223 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
//product quickedit
|
225 |
public function filter_product_actions( $actions, $post ){
|
226 |
if(
|
47 |
add_action( 'woocommerce_after_product_ordering', array( $this, 'update_all_products_translations_ordering' ) );
|
48 |
//filter to copy excerpt value
|
49 |
add_filter( 'wpml_copy_from_original_custom_fields', array( $this, 'filter_excerpt_field_content_copy' ) );
|
50 |
+
|
51 |
+
add_filter( 'wpml_override_is_translator', array( $this, 'wcml_override_is_translator' ), 10, 3 );
|
52 |
}
|
53 |
|
54 |
// Check if original product
|
223 |
<?php }
|
224 |
}
|
225 |
|
226 |
+
public function wcml_override_is_translator( $is_translator, $user_id, $args ){
|
227 |
+
|
228 |
+
if( current_user_can( 'wpml_operate_woocommerce_multilingual' ) ){
|
229 |
+
return true;
|
230 |
+
}
|
231 |
+
|
232 |
+
return $is_translator;
|
233 |
+
}
|
234 |
+
|
235 |
//product quickedit
|
236 |
public function filter_product_actions( $actions, $post ){
|
237 |
if(
|
inc/class-wcml-terms.php
CHANGED
@@ -1002,7 +1002,7 @@ class WCML_Terms{
|
|
1002 |
INNER JOIN {$this->wpdb->term_taxonomy} AS tt
|
1003 |
ON t.term_id = tt.term_id
|
1004 |
WHERE tt.taxonomy = %s AND t.slug = %s LIMIT 1",
|
1005 |
-
$taxonomy, $slug )
|
1006 |
);
|
1007 |
}
|
1008 |
|
@@ -1018,4 +1018,15 @@ class WCML_Terms{
|
|
1018 |
);
|
1019 |
}
|
1020 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1021 |
}
|
1002 |
INNER JOIN {$this->wpdb->term_taxonomy} AS tt
|
1003 |
ON t.term_id = tt.term_id
|
1004 |
WHERE tt.taxonomy = %s AND t.slug = %s LIMIT 1",
|
1005 |
+
$taxonomy, sanitize_title( $slug ) )
|
1006 |
);
|
1007 |
}
|
1008 |
|
1018 |
);
|
1019 |
}
|
1020 |
|
1021 |
+
public function wcml_get_translated_term( $term_id, $taxonomy, $language ){
|
1022 |
+
|
1023 |
+
$tr_id = apply_filters( 'translate_object_id', $term_id, $taxonomy, false, $language );
|
1024 |
+
|
1025 |
+
if( !is_null( $tr_id ) ) {
|
1026 |
+
$term_id = $tr_id;
|
1027 |
+
}
|
1028 |
+
|
1029 |
+
return $this->wcml_get_term_by_id( $term_id, $taxonomy );
|
1030 |
+
}
|
1031 |
+
|
1032 |
}
|
inc/class-wcml-url-translation.php
CHANGED
@@ -34,6 +34,10 @@ class WCML_Url_Translation {
|
|
34 |
|
35 |
add_filter( 'redirect_canonical', array( $this, 'check_wc_tax_url_on_redirect' ), 10, 2 );
|
36 |
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
|
39 |
function set_up() {
|
@@ -706,4 +710,60 @@ class WCML_Url_Translation {
|
|
706 |
|
707 |
return $redirect_url;
|
708 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
709 |
}
|
34 |
|
35 |
add_filter( 'redirect_canonical', array( $this, 'check_wc_tax_url_on_redirect' ), 10, 2 );
|
36 |
|
37 |
+
add_filter( 'query_vars', array( $this, 'translate_query_var_for_product' ) );
|
38 |
+
|
39 |
+
add_filter( 'wp_redirect', array( $this, 'encode_shop_slug' ), 10, 2 );
|
40 |
+
|
41 |
}
|
42 |
|
43 |
function set_up() {
|
710 |
|
711 |
return $redirect_url;
|
712 |
}
|
713 |
+
|
714 |
+
public function translate_query_var_for_product($public_query_vars){
|
715 |
+
global $woocommerce_wpml, $sitepress;
|
716 |
+
|
717 |
+
$product_permalink = $woocommerce_wpml->strings->product_permalink_slug();
|
718 |
+
$string_language = $woocommerce_wpml->strings->get_string_language( $product_permalink, $this->url_strings_context(), $this->url_string_name('product') );
|
719 |
+
|
720 |
+
if( $sitepress->get_current_language() != $string_language ){
|
721 |
+
$translated_slug = $this->get_translated_product_base_by_lang( false,$product_permalink );
|
722 |
+
|
723 |
+
if(isset($_GET[$translated_slug])){
|
724 |
+
$buff = $_GET[$translated_slug];
|
725 |
+
unset($_GET[$translated_slug]);
|
726 |
+
$_GET[$product_permalink] = $buff;
|
727 |
+
}
|
728 |
+
|
729 |
+
}
|
730 |
+
|
731 |
+
return $public_query_vars;
|
732 |
+
}
|
733 |
+
|
734 |
+
public function get_translated_product_base_by_lang($language = false, $product_slug = false){
|
735 |
+
global $woocommerce_wpml;
|
736 |
+
|
737 |
+
if(!$language){
|
738 |
+
global $sitepress;
|
739 |
+
$language = $sitepress->get_current_language();
|
740 |
+
|
741 |
+
}
|
742 |
+
|
743 |
+
if(!$product_slug){
|
744 |
+
$product_slug = $woocommerce_wpml->strings->product_permalink_slug();
|
745 |
+
}
|
746 |
+
|
747 |
+
if ( version_compare( WPML_ST_VERSION, '2.3', '>=' ) ) {
|
748 |
+
$translated_slug = apply_filters( 'wpml_get_translated_slug', $product_slug, 'product' , $language );
|
749 |
+
}elseif ( apply_filters( 'wpml_slug_translation_available', false) ) {
|
750 |
+
$translated_slug = apply_filters( 'wpml_get_translated_slug', 'product' , $language );
|
751 |
+
} else {
|
752 |
+
$translated_slug = apply_filters( 'wpml_translate_single_string', $product_slug, $this->url_strings_context(), $this->url_string_name( 'product' ) );
|
753 |
+
}
|
754 |
+
|
755 |
+
return $translated_slug;
|
756 |
+
}
|
757 |
+
|
758 |
+
public function encode_shop_slug($location, $status){
|
759 |
+
if(get_post_type(get_query_var('p')) == 'product'){
|
760 |
+
global $sitepress;
|
761 |
+
$language = $sitepress->get_language_for_element(get_query_var('p'), 'post_product');
|
762 |
+
$base_slug = $this->get_translated_product_base_by_lang($language);
|
763 |
+
|
764 |
+
$location = str_replace($base_slug , urlencode($base_slug),$location);
|
765 |
+
}
|
766 |
+
|
767 |
+
return $location;
|
768 |
+
}
|
769 |
}
|
inc/class-wcml-wc-strings.php
CHANGED
@@ -9,8 +9,6 @@ class WCML_WC_Strings{
|
|
9 |
function __construct(){
|
10 |
|
11 |
add_action( 'init', array( $this, 'init' ) );
|
12 |
-
add_filter( 'query_vars', array( $this, 'translate_query_var_for_product' ) );
|
13 |
-
add_filter( 'wp_redirect', array( $this, 'encode_shop_slug' ), 10, 2 );
|
14 |
add_action( 'registered_taxonomy', array ( $this, 'translate_attributes_label_in_wp_taxonomies' ), 100, 3 );
|
15 |
}
|
16 |
|
@@ -42,12 +40,16 @@ class WCML_WC_Strings{
|
|
42 |
}
|
43 |
|
44 |
function translated_attribute_label($label, $name, $product_obj = false){
|
45 |
-
global $sitepress
|
46 |
|
47 |
$product_id = false;
|
48 |
$lang = $sitepress->get_current_language();
|
49 |
$name = sanitize_title($name);
|
50 |
|
|
|
|
|
|
|
|
|
51 |
if( isset($product->id) ){
|
52 |
$product_id = $product->id;
|
53 |
}elseif( is_numeric( $product_obj ) ){
|
@@ -69,15 +71,14 @@ class WCML_WC_Strings{
|
|
69 |
}
|
70 |
|
71 |
if(is_admin() && !wpml_is_ajax()){
|
72 |
-
global $sitepress_settings;
|
73 |
|
74 |
$string_language = $this->get_string_language( 'taxonomy singular name: '.$label, 'WordPress' );
|
75 |
|
76 |
-
if($
|
77 |
$string_id = icl_get_string_id( 'taxonomy singular name: '.$label, 'WordPress' );
|
78 |
$strings = icl_get_string_translations_by_id($string_id);
|
79 |
if($strings){
|
80 |
-
return $strings[$
|
81 |
}
|
82 |
}else{
|
83 |
return $label;
|
@@ -135,51 +136,6 @@ class WCML_WC_Strings{
|
|
135 |
|
136 |
return $title;
|
137 |
}
|
138 |
-
|
139 |
-
|
140 |
-
function translate_query_var_for_product($public_query_vars){
|
141 |
-
global $woocommerce_wpml, $sitepress;
|
142 |
-
|
143 |
-
$product_permalink = $this->product_permalink_slug();
|
144 |
-
$string_language = $this->get_string_language( $product_permalink, $woocommerce_wpml->url_translation->url_strings_context(), $woocommerce_wpml->url_translation->url_string_name('product') );
|
145 |
-
|
146 |
-
if($sitepress->get_current_language() != $string_language){
|
147 |
-
$translated_slug = $this->get_translated_product_base_by_lang( false,$product_permalink );
|
148 |
-
|
149 |
-
if(isset($_GET[$translated_slug])){
|
150 |
-
$buff = $_GET[$translated_slug];
|
151 |
-
unset($_GET[$translated_slug]);
|
152 |
-
$_GET[$product_permalink] = $buff;
|
153 |
-
}
|
154 |
-
|
155 |
-
}
|
156 |
-
|
157 |
-
return $public_query_vars;
|
158 |
-
}
|
159 |
-
|
160 |
-
function get_translated_product_base_by_lang($language = false, $product_slug = false){
|
161 |
-
global $woocommerce_wpml;
|
162 |
-
|
163 |
-
if(!$language){
|
164 |
-
global $sitepress;
|
165 |
-
$language = $sitepress->get_current_language();
|
166 |
-
|
167 |
-
}
|
168 |
-
|
169 |
-
if(!$product_slug){
|
170 |
-
$product_slug = $this->product_permalink_slug();
|
171 |
-
}
|
172 |
-
|
173 |
-
if ( version_compare( WPML_ST_VERSION, '2.3', '>=' ) ) {
|
174 |
-
$translated_slug = apply_filters( 'wpml_get_translated_slug', $product_slug, 'product' , $language );
|
175 |
-
}elseif ( apply_filters( 'wpml_slug_translation_available', false) ) {
|
176 |
-
$translated_slug = apply_filters( 'wpml_get_translated_slug', 'product' , $language );
|
177 |
-
} else {
|
178 |
-
$translated_slug = apply_filters( 'wpml_translate_single_string', $product_slug, $woocommerce_wpml->url_translation->url_strings_context(), $woocommerce_wpml->url_translation->url_string_name( 'product' ) );
|
179 |
-
}
|
180 |
-
|
181 |
-
return $translated_slug;
|
182 |
-
}
|
183 |
|
184 |
// Catch the default slugs for translation
|
185 |
function translate_default_slug($translation, $text, $context, $domain) {
|
@@ -309,18 +265,6 @@ class WCML_WC_Strings{
|
|
309 |
return $text;
|
310 |
}
|
311 |
|
312 |
-
function encode_shop_slug($location, $status){
|
313 |
-
if(get_post_type(get_query_var('p')) == 'product'){
|
314 |
-
global $sitepress;
|
315 |
-
$language = $sitepress->get_language_for_element(get_query_var('p'), 'post_product');
|
316 |
-
$base_slug = $this->get_translated_product_base_by_lang($language);
|
317 |
-
|
318 |
-
$location = str_replace($base_slug , urlencode($base_slug),$location);
|
319 |
-
}
|
320 |
-
|
321 |
-
return $location;
|
322 |
-
}
|
323 |
-
|
324 |
function product_permalink_slug(){
|
325 |
$permalinks = get_option( 'woocommerce_permalinks' );
|
326 |
$slug = empty( $permalinks['product_base'] ) ? 'product' : trim($permalinks['product_base'],'/');
|
9 |
function __construct(){
|
10 |
|
11 |
add_action( 'init', array( $this, 'init' ) );
|
|
|
|
|
12 |
add_action( 'registered_taxonomy', array ( $this, 'translate_attributes_label_in_wp_taxonomies' ), 100, 3 );
|
13 |
}
|
14 |
|
40 |
}
|
41 |
|
42 |
function translated_attribute_label($label, $name, $product_obj = false){
|
43 |
+
global $sitepress, $product, $sitepress_settings;
|
44 |
|
45 |
$product_id = false;
|
46 |
$lang = $sitepress->get_current_language();
|
47 |
$name = sanitize_title($name);
|
48 |
|
49 |
+
if( isset( $_GET[ 'post' ] ) && get_post_type( $_GET[ 'post' ] ) == 'shop_order' ){
|
50 |
+
$lang = $sitepress->get_user_admin_language( get_current_user_id(), true );
|
51 |
+
}
|
52 |
+
|
53 |
if( isset($product->id) ){
|
54 |
$product_id = $product->id;
|
55 |
}elseif( is_numeric( $product_obj ) ){
|
71 |
}
|
72 |
|
73 |
if(is_admin() && !wpml_is_ajax()){
|
|
|
74 |
|
75 |
$string_language = $this->get_string_language( 'taxonomy singular name: '.$label, 'WordPress' );
|
76 |
|
77 |
+
if($sitepress->get_user_admin_language( get_current_user_id(), true ) != $string_language){
|
78 |
$string_id = icl_get_string_id( 'taxonomy singular name: '.$label, 'WordPress' );
|
79 |
$strings = icl_get_string_translations_by_id($string_id);
|
80 |
if($strings){
|
81 |
+
return $strings[$sitepress->get_user_admin_language( get_current_user_id(), true )]['value'];
|
82 |
}
|
83 |
}else{
|
84 |
return $label;
|
136 |
|
137 |
return $title;
|
138 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
// Catch the default slugs for translation
|
141 |
function translate_default_slug($translation, $text, $context, $domain) {
|
265 |
return $text;
|
266 |
}
|
267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
function product_permalink_slug(){
|
269 |
$permalinks = get_option( 'woocommerce_permalinks' );
|
270 |
$slug = empty( $permalinks['product_base'] ) ? 'product' : trim($permalinks['product_base'],'/');
|
inc/currencies/class-wcml-multi-currency-orders.php
CHANGED
@@ -11,14 +11,10 @@ class WCML_Multi_Currency_Orders{
|
|
11 |
$this->multi_currency =& $multi_currency;
|
12 |
|
13 |
if( is_admin() ){
|
14 |
-
|
15 |
-
if( is_admin() ){
|
16 |
-
add_filter( 'init', array( $this, 'orders_init' ) );
|
17 |
-
}
|
18 |
-
|
19 |
}
|
20 |
|
21 |
-
add_action( 'woocommerce_view_order', array( $this, '
|
22 |
}
|
23 |
|
24 |
public function orders_init(){
|
@@ -328,23 +324,17 @@ class WCML_Multi_Currency_Orders{
|
|
328 |
remove_filter('woocommerce_currency', array($this, '_override_woocommerce_order_currency_temporarily'));
|
329 |
}
|
330 |
|
331 |
-
function _override_woocommerce_order_currency_temporarily($currency){
|
332 |
if(isset($this->order_currency)){
|
333 |
$currency = $this->order_currency;
|
334 |
}
|
335 |
return $currency;
|
336 |
}
|
337 |
|
338 |
-
function
|
339 |
$currency_code = get_post_meta( $order_id, '_order_currency', true );
|
340 |
|
341 |
$this->client_currency = $currency_code;
|
342 |
}
|
343 |
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
}
|
11 |
$this->multi_currency =& $multi_currency;
|
12 |
|
13 |
if( is_admin() ){
|
14 |
+
add_filter( 'init', array( $this, 'orders_init' ) );
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
|
17 |
+
add_action( 'woocommerce_view_order', array( $this, 'show_price_in_client_currency' ), 9 );
|
18 |
}
|
19 |
|
20 |
public function orders_init(){
|
324 |
remove_filter('woocommerce_currency', array($this, '_override_woocommerce_order_currency_temporarily'));
|
325 |
}
|
326 |
|
327 |
+
public function _override_woocommerce_order_currency_temporarily($currency){
|
328 |
if(isset($this->order_currency)){
|
329 |
$currency = $this->order_currency;
|
330 |
}
|
331 |
return $currency;
|
332 |
}
|
333 |
|
334 |
+
public function show_price_in_client_currency( $order_id ){
|
335 |
$currency_code = get_post_meta( $order_id, '_order_currency', true );
|
336 |
|
337 |
$this->client_currency = $currency_code;
|
338 |
}
|
339 |
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
}
|
inc/currencies/class-wcml-multi-currency-prices.php
CHANGED
@@ -524,7 +524,10 @@ class WCML_Multi_Currency_Prices{
|
|
524 |
public function filter_currency_num_decimals_option($value){
|
525 |
|
526 |
$db = debug_backtrace();
|
527 |
-
if(
|
|
|
|
|
|
|
528 |
$currency_code = get_option( 'woocommerce_currency' );
|
529 |
}else{
|
530 |
$currency_code = $this->check_admin_order_currency_code();
|
524 |
public function filter_currency_num_decimals_option($value){
|
525 |
|
526 |
$db = debug_backtrace();
|
527 |
+
if(
|
528 |
+
$db['8']['function'] == 'calculate_shipping_for_package' && $db['5']['function'] == 'add_rate' ||
|
529 |
+
$db['7']['function'] == 'calculate_shipping_for_package' && $db['4']['function'] == 'add_rate'
|
530 |
+
){
|
531 |
$currency_code = get_option( 'woocommerce_currency' );
|
532 |
}else{
|
533 |
$currency_code = $this->check_admin_order_currency_code();
|
inc/currencies/class-wcml-multi-currency-shipping.php
CHANGED
@@ -12,8 +12,6 @@ class WCML_Multi_Currency_Shipping{
|
|
12 |
|
13 |
$this->multi_currency =& $multi_currency;
|
14 |
|
15 |
-
add_filter('woocommerce_cart_shipping_method_full_label', array( $this, 'convert_shipping_cost'), 10, 2 );
|
16 |
-
|
17 |
// shipping method cost settings
|
18 |
$rates = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_shipping_zone_methods WHERE method_id IN('flat_rate', 'local_pickup', 'free_shipping')" );
|
19 |
foreach( $rates as $method ){
|
@@ -27,50 +25,25 @@ class WCML_Multi_Currency_Shipping{
|
|
27 |
|
28 |
add_filter( 'woocommerce_evaluate_shipping_cost_args', array( $this, 'woocommerce_evaluate_shipping_cost_args') );
|
29 |
|
30 |
-
add_action( 'woocommerce_calculate_totals', array( $this, 'convert_shipping_totals' ) );
|
31 |
-
|
32 |
add_filter( 'woocommerce_shipping_packages', array( $this, 'convert_shipping_taxes'), 10 );
|
33 |
|
34 |
-
|
35 |
// Before WooCommerce 2.6
|
36 |
-
add_filter('option_woocommerce_free_shipping_settings', array( $this, 'adjust_min_amount_required' ) );
|
37 |
|
|
|
38 |
|
39 |
}
|
40 |
|
41 |
-
|
42 |
-
* @param $label string
|
43 |
-
* @param $method object
|
44 |
-
* @return string
|
45 |
-
*
|
46 |
-
*/
|
47 |
-
public function convert_shipping_cost( $label, $method ){
|
48 |
-
|
49 |
-
if( empty( $method->_costs_converted ) ){
|
50 |
-
|
51 |
-
$client_currency = $this->multi_currency->get_client_currency();
|
52 |
-
$label = $method->get_label();
|
53 |
-
|
54 |
-
if ( $method->cost > 0 ) {
|
55 |
-
$method->cost = $this->multi_currency->prices->raw_price_filter( $method->cost, $client_currency);
|
56 |
-
if ( WC()->cart->tax_display_cart == 'excl' ) {
|
57 |
-
$label .= ': ' . wc_price( $method->cost );
|
58 |
-
if ( $method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax ) {
|
59 |
-
$label .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
|
60 |
-
}
|
61 |
-
} else {
|
62 |
-
$label .= ': ' . wc_price( $method->cost + $method->get_shipping_tax() );
|
63 |
-
if ( $method->get_shipping_tax() > 0 && ! WC()->cart->prices_include_tax ) {
|
64 |
-
$label .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
|
65 |
-
}
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
$method->_costs_converted = true;
|
70 |
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
-
|
74 |
}
|
75 |
|
76 |
public function convert_shipping_method_cost_settings( $settings ){
|
@@ -115,15 +88,6 @@ class WCML_Multi_Currency_Shipping{
|
|
115 |
return $args;
|
116 |
}
|
117 |
|
118 |
-
/**
|
119 |
-
* @param $cart WC_Cart (reference)
|
120 |
-
*
|
121 |
-
* converts the cart total and the cart tax total in the WC_Cart object on the checkout page
|
122 |
-
*/
|
123 |
-
public function convert_shipping_totals( $cart ){
|
124 |
-
$cart->shipping_total = $this->multi_currency->prices->raw_price_filter( $cart->shipping_total );
|
125 |
-
}
|
126 |
-
|
127 |
public function convert_shipping_taxes( $packages ){
|
128 |
|
129 |
foreach( $packages as $package_id => $package ){
|
@@ -150,7 +114,7 @@ class WCML_Multi_Currency_Shipping{
|
|
150 |
|
151 |
public function shipping_free_min_amount($price) {
|
152 |
|
153 |
-
$price = $this->multi_currency->prices->raw_price_filter($price, $this->multi_currency->get_client_currency());
|
154 |
|
155 |
return $price;
|
156 |
|
12 |
|
13 |
$this->multi_currency =& $multi_currency;
|
14 |
|
|
|
|
|
15 |
// shipping method cost settings
|
16 |
$rates = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_shipping_zone_methods WHERE method_id IN('flat_rate', 'local_pickup', 'free_shipping')" );
|
17 |
foreach( $rates as $method ){
|
25 |
|
26 |
add_filter( 'woocommerce_evaluate_shipping_cost_args', array( $this, 'woocommerce_evaluate_shipping_cost_args') );
|
27 |
|
|
|
|
|
28 |
add_filter( 'woocommerce_shipping_packages', array( $this, 'convert_shipping_taxes'), 10 );
|
29 |
|
|
|
30 |
// Before WooCommerce 2.6
|
31 |
+
add_filter( 'option_woocommerce_free_shipping_settings', array( $this, 'adjust_min_amount_required' ) );
|
32 |
|
33 |
+
add_filter( 'woocommerce_package_rates', array($this, 'convert_shipping_costs_in_package_rates'), 10, 2 );
|
34 |
|
35 |
}
|
36 |
|
37 |
+
public function convert_shipping_costs_in_package_rates( $rates, $package ){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
+
$client_currency = $this->multi_currency->get_client_currency();
|
40 |
+
foreach( $rates as $rate_id => $rate ){
|
41 |
+
if( isset( $rate->cost ) && $rate->cost ){
|
42 |
+
$rate->cost = $this->multi_currency->prices->raw_price_filter( $rate->cost, $client_currency);
|
43 |
+
}
|
44 |
+
}
|
45 |
|
46 |
+
return $rates;
|
47 |
}
|
48 |
|
49 |
public function convert_shipping_method_cost_settings( $settings ){
|
88 |
return $args;
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
public function convert_shipping_taxes( $packages ){
|
92 |
|
93 |
foreach( $packages as $package_id => $package ){
|
114 |
|
115 |
public function shipping_free_min_amount($price) {
|
116 |
|
117 |
+
$price = $this->multi_currency->prices->raw_price_filter( $price, $this->multi_currency->get_client_currency() );
|
118 |
|
119 |
return $price;
|
120 |
|
inc/translation-editor/class-wcml-translation-editor.php
CHANGED
@@ -231,7 +231,7 @@ class WCML_Translation_Editor{
|
|
231 |
if ( !$this->woocommerce_wpml->settings['trnsl_interface'] ) {
|
232 |
$use_tm_editor = 0;
|
233 |
}
|
234 |
-
} elseif ( $current_screen->id === 'wpml_page_wpml-wcml' ) {
|
235 |
$use_tm_editor = 1;
|
236 |
}
|
237 |
}
|
231 |
if ( !$this->woocommerce_wpml->settings['trnsl_interface'] ) {
|
232 |
$use_tm_editor = 0;
|
233 |
}
|
234 |
+
} elseif ( $current_screen->id === 'wpml_page_wpml-wcml' || $current_screen->id === 'toplevel_page_wpml-wcml' ) {
|
235 |
$use_tm_editor = 1;
|
236 |
}
|
237 |
}
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: CMS, woocommerce, commerce, ecommerce, e-commerce, products, WPML, multili
|
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.9
|
7 |
Tested up to: 4.6
|
8 |
-
Stable tag: 3.8.
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
@@ -131,6 +131,13 @@ WooCommerce Multilingual is compatible with all major WooCommerce extensions. We
|
|
131 |
|
132 |
== Changelog ==
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
= 3.8.5 =
|
135 |
* Fixed more problems related to converting shipping costs in secondary currencies
|
136 |
* Fixed one compatibility problem with WooCommerce Show Single Variations
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.9
|
7 |
Tested up to: 4.6
|
8 |
+
Stable tag: 3.8.6
|
9 |
|
10 |
Allows running fully multilingual e-commerce sites using WooCommerce and WPML.
|
11 |
|
131 |
|
132 |
== Changelog ==
|
133 |
|
134 |
+
= 3.8.6 =
|
135 |
+
* Fix shipping cost conversion issue specific to PHP 5.6
|
136 |
+
* Bug fix: an incorrect shipping cost was displayed on the backend when the order was placed in a secondary currency
|
137 |
+
* Bug fix: users with the Shop Manager role were not able to translate products
|
138 |
+
* Bug fix: changing an order language in the backend did not change the language for attributes in the order
|
139 |
+
* Bug fix: for every e-mail action took when editing an order a new order e-mail was sent to the admin
|
140 |
+
|
141 |
= 3.8.5 =
|
142 |
* Fixed more problems related to converting shipping costs in secondary currencies
|
143 |
* Fixed one compatibility problem with WooCommerce Show Single Variations
|
res/js/wcml-multi-currency.js
CHANGED
@@ -34,7 +34,7 @@ function wcml_load_currency( currency ){
|
|
34 |
alert(response.error);
|
35 |
}else{
|
36 |
jQuery('.wcml_currency_switcher').removeAttr('disabled');
|
37 |
-
if(typeof wcml_mc_settings.w3tc
|
38 |
var original_url = window.location.href;
|
39 |
original_url = original_url.replace(/&wcmlc(\=[^&]*)?(?=&|$)|wcmlc(\=[^&]*)?(&|$)/, '');
|
40 |
original_url = original_url.replace(/\?$/, '');
|
34 |
alert(response.error);
|
35 |
}else{
|
36 |
jQuery('.wcml_currency_switcher').removeAttr('disabled');
|
37 |
+
if(typeof wcml_mc_settings.w3tc !== 'undefined'){
|
38 |
var original_url = window.location.href;
|
39 |
original_url = original_url.replace(/&wcmlc(\=[^&]*)?(?=&|$)|wcmlc(\=[^&]*)?(&|$)/, '');
|
40 |
original_url = original_url.replace(/\?$/, '');
|
res/js/wcml-multi-currency.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function wcml_load_currency(a){var b=jQuery('<img style="margin-left:10px;" width="16" heigth="16" src="'+wcml_mc_settings.wcml_spinner+'" />');jQuery(".wcml_currency_switcher").attr("disabled","disabled"),jQuery(".wcml_currency_switcher").after(),b.insertAfter(jQuery(".wcml_currency_switcher")),jQuery.ajax({type:"post",url:woocommerce_params.ajax_url,data:{action:"wcml_switch_currency",currency:a,wcml_nonce:wcml_mc_settings.wcml_mc_nonce},success:function(b){if("undefined"!=typeof b.error)alert(b.error);else{if(jQuery(".wcml_currency_switcher").removeAttr("disabled"),"undefined
|
1 |
+
function wcml_load_currency(a){var b=jQuery('<img style="margin-left:10px;" width="16" heigth="16" src="'+wcml_mc_settings.wcml_spinner+'" />');jQuery(".wcml_currency_switcher").attr("disabled","disabled"),jQuery(".wcml_currency_switcher").after(),b.insertAfter(jQuery(".wcml_currency_switcher")),jQuery.ajax({type:"post",url:woocommerce_params.ajax_url,data:{action:"wcml_switch_currency",currency:a,wcml_nonce:wcml_mc_settings.wcml_mc_nonce},success:function(b){if("undefined"!=typeof b.error)alert(b.error);else{if(jQuery(".wcml_currency_switcher").removeAttr("disabled"),"undefined"!=typeof wcml_mc_settings.w3tc){var c=window.location.href;c=c.replace(/&wcmlc(\=[^&]*)?(?=&|$)|wcmlc(\=[^&]*)?(&|$)/,""),c=c.replace(/\?$/,"");var d=-1!=c.indexOf("?")?"&":"?",e=c+d+"wcmlc="+a}else var e=window.location.href;window.location=e}}})}jQuery(document).ready(function(){jQuery(".wcml_currency_switcher").on("change",function(){wcml_load_currency(jQuery(this).val())}),jQuery(".wcml_currency_switcher li").on("click",function(){jQuery(this).hasClass("wcml-active-currency")||wcml_load_currency(jQuery(this).attr("rel"))}),"undefined"!=typeof woocommerce_price_slider_params&&(woocommerce_price_slider_params.currency_symbol=wcml_mc_settings.current_currency.symbol)});
|
wpml-config.xml
CHANGED
@@ -58,6 +58,7 @@
|
|
58 |
<custom-field action="copy">_sale_price_dates_from</custom-field>
|
59 |
<custom-field action="copy">_sale_price_dates_to</custom-field>
|
60 |
<custom-field action="copy">_wcml_schedule</custom-field>
|
|
|
61 |
</custom-fields>
|
62 |
<custom-types>
|
63 |
<custom-type translate="1">product</custom-type>
|
58 |
<custom-field action="copy">_sale_price_dates_from</custom-field>
|
59 |
<custom-field action="copy">_sale_price_dates_to</custom-field>
|
60 |
<custom-field action="copy">_wcml_schedule</custom-field>
|
61 |
+
<custom-field action="translate">_variation_description</custom-field>
|
62 |
</custom-fields>
|
63 |
<custom-types>
|
64 |
<custom-type translate="1">product</custom-type>
|
wpml-woocommerce.php
CHANGED
@@ -6,12 +6,12 @@
|
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com/
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
-
Version: 3.8.
|
10 |
*/
|
11 |
|
12 |
if( defined( 'WCML_VERSION' ) ) return;
|
13 |
|
14 |
-
define( 'WCML_VERSION', '3.8.
|
15 |
define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
|
16 |
define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
|
17 |
define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com/
|
8 |
Text Domain: woocommerce-multilingual
|
9 |
+
Version: 3.8.6
|
10 |
*/
|
11 |
|
12 |
if( defined( 'WCML_VERSION' ) ) return;
|
13 |
|
14 |
+
define( 'WCML_VERSION', '3.8.6' );
|
15 |
define( 'WCML_PLUGIN_PATH', dirname( __FILE__ ) );
|
16 |
define( 'WCML_PLUGIN_FOLDER', basename( WCML_PLUGIN_PATH ) );
|
17 |
define( 'WCML_LOCALE_PATH', WCML_PLUGIN_PATH . '/locale' );
|