Version Description
- Added: Support to WooCommerce 2.4
- Updated: Plugin core framework
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Catalog Mode |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.9 to 1.1.0
- init.php +2 -2
- plugin-fw/assets/css/yit-plugin-panel.css +5 -0
- plugin-fw/languages/yith-plugin-fw-it_IT.mo +0 -0
- plugin-fw/languages/yith-plugin-fw-it_IT.po +3 -3
- plugin-fw/lib/yit-plugin-panel-wc.php +72 -1
- plugin-fw/yit-functions.php +62 -0
- plugin-options/settings-options.php +1 -1
- readme.txt +9 -4
init.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/
|
|
5 |
Description: YITH Woocommerce Catalog Mode allows you to disable shop functions.
|
6 |
Author: Yithemes
|
7 |
Text Domain: ywctm
|
8 |
-
Version: 1.0
|
9 |
Author URI: http://yithemes.com/
|
10 |
*/
|
11 |
|
@@ -34,7 +34,7 @@ function ywctm_install_free_admin_notice() {
|
|
34 |
}
|
35 |
|
36 |
if ( ! defined( 'YWCTM_VERSION' ) ) {
|
37 |
-
define( 'YWCTM_VERSION', '1.0
|
38 |
}
|
39 |
|
40 |
if ( ! defined( 'YWCTM_FREE_INIT' ) ) {
|
5 |
Description: YITH Woocommerce Catalog Mode allows you to disable shop functions.
|
6 |
Author: Yithemes
|
7 |
Text Domain: ywctm
|
8 |
+
Version: 1.1.0
|
9 |
Author URI: http://yithemes.com/
|
10 |
*/
|
11 |
|
34 |
}
|
35 |
|
36 |
if ( ! defined( 'YWCTM_VERSION' ) ) {
|
37 |
+
define( 'YWCTM_VERSION', '1.1.0' );
|
38 |
}
|
39 |
|
40 |
if ( ! defined( 'YWCTM_FREE_INIT' ) ) {
|
plugin-fw/assets/css/yit-plugin-panel.css
CHANGED
@@ -626,6 +626,11 @@
|
|
626 |
color: #45bbe6;
|
627 |
}
|
628 |
|
|
|
|
|
|
|
|
|
|
|
629 |
/* === Responsive === */
|
630 |
|
631 |
@media (max-width: 767px) {}
|
626 |
color: #45bbe6;
|
627 |
}
|
628 |
|
629 |
+
/* WooCommerce 2.4 Support */
|
630 |
+
.woocommerce table.form-table .colorpick{
|
631 |
+
width: 6em;
|
632 |
+
}
|
633 |
+
|
634 |
/* === Responsive === */
|
635 |
|
636 |
@media (max-width: 767px) {}
|
plugin-fw/languages/yith-plugin-fw-it_IT.mo
CHANGED
Binary file
|
plugin-fw/languages/yith-plugin-fw-it_IT.po
CHANGED
@@ -5,14 +5,14 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
|
6 |
"Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
|
7 |
"POT-Creation-Date: 2015-05-11 17:13+0100\n"
|
8 |
-
"PO-Revision-Date: 2015-
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
|
11 |
"Language: en\n"
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=utf-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
-
"X-Generator: Poedit 1.
|
16 |
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
|
17 |
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
18 |
"esc_html_x:1,2c\n"
|
@@ -233,7 +233,7 @@ msgstr "Impostazioni plugin"
|
|
233 |
|
234 |
#: lib/yit-plugin-panel.php:95 lib/yit-plugin-subpanel.php:101
|
235 |
msgid "YIT Plugins"
|
236 |
-
msgstr "
|
237 |
|
238 |
#: lib/yit-plugin-panel.php:292 lib/yit-plugin-subpanel.php:142
|
239 |
#: templates/panel/woocommerce/woocommerce-form.php:5
|
5 |
"Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
|
6 |
"Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
|
7 |
"POT-Creation-Date: 2015-05-11 17:13+0100\n"
|
8 |
+
"PO-Revision-Date: 2015-07-24 16:13+0100\n"
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
|
11 |
"Language: en\n"
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=utf-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
+
"X-Generator: Poedit 1.8\n"
|
16 |
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
|
17 |
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
18 |
"esc_html_x:1,2c\n"
|
233 |
|
234 |
#: lib/yit-plugin-panel.php:95 lib/yit-plugin-subpanel.php:101
|
235 |
msgid "YIT Plugins"
|
236 |
+
msgstr "YIT Plugins"
|
237 |
|
238 |
#: lib/yit-plugin-panel.php:292 lib/yit-plugin-subpanel.php:142
|
239 |
#: templates/panel/woocommerce/woocommerce-form.php:5
|
plugin-fw/lib/yit-plugin-panel-wc.php
CHANGED
@@ -37,6 +37,11 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
37 |
*/
|
38 |
public $settings = array();
|
39 |
|
|
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* @var array
|
42 |
*/
|
@@ -51,6 +56,14 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
51 |
*/
|
52 |
public function __construct( $args = array() ) {
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
if ( ! empty( $args ) ) {
|
55 |
$this->settings = $args;
|
56 |
$this->_tabs_path_files = $this->get_tabs_path_files();
|
@@ -64,10 +77,14 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
64 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
65 |
add_action( 'admin_init', array( $this, 'woocommerce_update_options' ) );
|
66 |
add_filter( 'woocommerce_screen_ids', array( $this, 'add_allowed_screen_id' ) );
|
|
|
67 |
|
68 |
/* Add VideoBox and InfoBox */
|
69 |
add_action( 'woocommerce_admin_field_boxinfo', array( $this, 'add_infobox' ), 10, 1 );
|
70 |
add_action( 'woocommerce_admin_field_videobox', array( $this, 'add_videobox' ), 10, 1 );
|
|
|
|
|
|
|
71 |
}
|
72 |
}
|
73 |
|
@@ -251,6 +268,16 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
251 |
$yit_options = $this->get_main_array_options();
|
252 |
$current_tab = $this->get_current_tab();
|
253 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
woocommerce_update_options( $yit_options[ $current_tab ] );
|
255 |
|
256 |
do_action( 'yit_panel_wc_after_update' );
|
@@ -320,7 +347,6 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
320 |
} else {
|
321 |
add_option($value['id'], $default_value);
|
322 |
}
|
323 |
-
|
324 |
}
|
325 |
|
326 |
}
|
@@ -328,6 +354,51 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
328 |
|
329 |
}
|
330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
}
|
333 |
}
|
37 |
*/
|
38 |
public $settings = array();
|
39 |
|
40 |
+
/**
|
41 |
+
* @var array a setting list of parameters
|
42 |
+
*/
|
43 |
+
public $wc_type = array();
|
44 |
+
|
45 |
/**
|
46 |
* @var array
|
47 |
*/
|
56 |
*/
|
57 |
public function __construct( $args = array() ) {
|
58 |
|
59 |
+
$this->wc_type = array(
|
60 |
+
'checkbox',
|
61 |
+
'textarea',
|
62 |
+
'multiselect',
|
63 |
+
'multi_select_countries',
|
64 |
+
'image_width'
|
65 |
+
);
|
66 |
+
|
67 |
if ( ! empty( $args ) ) {
|
68 |
$this->settings = $args;
|
69 |
$this->_tabs_path_files = $this->get_tabs_path_files();
|
77 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
78 |
add_action( 'admin_init', array( $this, 'woocommerce_update_options' ) );
|
79 |
add_filter( 'woocommerce_screen_ids', array( $this, 'add_allowed_screen_id' ) );
|
80 |
+
add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'maybe_unserialize_panel_data' ), 10, 3 );
|
81 |
|
82 |
/* Add VideoBox and InfoBox */
|
83 |
add_action( 'woocommerce_admin_field_boxinfo', array( $this, 'add_infobox' ), 10, 1 );
|
84 |
add_action( 'woocommerce_admin_field_videobox', array( $this, 'add_videobox' ), 10, 1 );
|
85 |
+
|
86 |
+
/* WooCommerce 2.4 Support */
|
87 |
+
add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
|
88 |
}
|
89 |
}
|
90 |
|
268 |
$yit_options = $this->get_main_array_options();
|
269 |
$current_tab = $this->get_current_tab();
|
270 |
|
271 |
+
if( version_compare( WC()->version, '2.4.0', '>=' ) ) {
|
272 |
+
if ( ! empty( $yit_options[ $current_tab ] ) ) {
|
273 |
+
foreach ( $yit_options[ $current_tab ] as $option ) {
|
274 |
+
if ( isset( $option['id'] ) && isset( $_POST[ $option['id'] ] ) && isset( $option['type' ] ) && ! in_array( $option['type'], $this->wc_type ) ) {
|
275 |
+
$_POST[ $option['id'] ] = maybe_serialize( $_POST[ $option['id'] ] );
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}
|
279 |
+
}
|
280 |
+
|
281 |
woocommerce_update_options( $yit_options[ $current_tab ] );
|
282 |
|
283 |
do_action( 'yit_panel_wc_after_update' );
|
347 |
} else {
|
348 |
add_option($value['id'], $default_value);
|
349 |
}
|
|
|
350 |
}
|
351 |
|
352 |
}
|
354 |
|
355 |
}
|
356 |
|
357 |
+
/**
|
358 |
+
* Add the woocommerce body class in plugin panel page
|
359 |
+
*
|
360 |
+
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
361 |
+
* @since 2.0
|
362 |
+
* @param $classes The body classes
|
363 |
+
*
|
364 |
+
* @return array Filtered body classes
|
365 |
+
*/
|
366 |
+
public function admin_body_class( $admin_body_classes ){
|
367 |
+
$admin_body_classes .= ' woocommerce ';
|
368 |
+
return $admin_body_classes;
|
369 |
+
}
|
370 |
+
|
371 |
+
/**
|
372 |
+
* Maybe unserialize panel data
|
373 |
+
*
|
374 |
+
* @param $value mixed Option value
|
375 |
+
* @param $option mixed Option settings array
|
376 |
+
* @param $raw_value string Raw option value
|
377 |
+
*
|
378 |
+
* @return mixed Filtered return value
|
379 |
+
* @author Antonio La Rocca <antonio.larocca@yithemes.com>
|
380 |
+
* @since 2.0
|
381 |
+
*/
|
382 |
+
public function maybe_unserialize_panel_data( $value, $option, $raw_value ) {
|
383 |
+
|
384 |
+
|
385 |
+
if( ! version_compare( WC()->version, '2.4.0', '>=' ) || ! isset( $option['type' ] ) || in_array( $option['type'], $this->wc_type ) ) {
|
386 |
+
return $value;
|
387 |
+
}
|
388 |
+
|
389 |
+
$yit_options = $this->get_main_array_options();
|
390 |
+
$current_tab = $this->get_current_tab();
|
391 |
+
|
392 |
+
if( ! empty( $yit_options[ $current_tab ] ) ){
|
393 |
+
foreach( $yit_options[ $current_tab ] as $option_array ){
|
394 |
+
if( isset( $option_array['id'] ) && isset( $option['id'] ) && $option_array['id'] == $option['id'] ){
|
395 |
+
return maybe_unserialize( $value );
|
396 |
+
}
|
397 |
+
}
|
398 |
+
}
|
399 |
+
|
400 |
+
return $value;
|
401 |
+
}
|
402 |
|
403 |
}
|
404 |
}
|
plugin-fw/yit-functions.php
CHANGED
@@ -818,4 +818,66 @@ if ( ! function_exists( 'yit_load_js_file' ) ) {
|
|
818 |
|
819 |
return $filename;
|
820 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
821 |
}
|
818 |
|
819 |
return $filename;
|
820 |
}
|
821 |
+
}
|
822 |
+
|
823 |
+
if ( ! function_exists( 'yit_wpml_register_string' ) ) {
|
824 |
+
/**
|
825 |
+
* Register a string in wpml trnslation
|
826 |
+
*
|
827 |
+
* @param $contenxt context name
|
828 |
+
* @param $name string name
|
829 |
+
* @param $value value to translate
|
830 |
+
*
|
831 |
+
* @since 2.0.0
|
832 |
+
* @author Andrea Frascaspata <andrea.frascaspata@yithemes.com>
|
833 |
+
*/
|
834 |
+
function yit_wpml_register_string( $contenxt , $name , $value ) {
|
835 |
+
// wpml string translation
|
836 |
+
do_action( 'wpml_register_single_string', $contenxt, $name, $value );
|
837 |
+
}
|
838 |
+
}
|
839 |
+
|
840 |
+
if ( ! function_exists( 'yit_wpml_string_translate' ) ) {
|
841 |
+
/**
|
842 |
+
* Get a string translation
|
843 |
+
*
|
844 |
+
* @param $contenxt context name
|
845 |
+
* @param $name string name
|
846 |
+
* @param $default_value value to translate
|
847 |
+
*
|
848 |
+
* @return string the string translated
|
849 |
+
* @since 2.0.0
|
850 |
+
* @author Andrea Frascaspata <andrea.frascaspata@yithemes.com>
|
851 |
+
*/
|
852 |
+
function yit_wpml_string_translate( $contenxt, $name, $default_value ) {
|
853 |
+
return apply_filters( 'wpml_translate_single_string', $default_value, $contenxt, $name );
|
854 |
+
}
|
855 |
+
|
856 |
+
}
|
857 |
+
|
858 |
+
if ( ! function_exists( 'yit_wpml_object_id' ) ) {
|
859 |
+
/**
|
860 |
+
* Get id of post translation in current language
|
861 |
+
*
|
862 |
+
* @param int $element_id
|
863 |
+
* @param string $element_type
|
864 |
+
* @param bool $return_original_if_missing
|
865 |
+
* @param null|string $ulanguage_code
|
866 |
+
*
|
867 |
+
* @return int the translation id
|
868 |
+
* @since 2.0.0
|
869 |
+
* @author Antonio La Rocca <antonio.larocca@yithemes.com>
|
870 |
+
*/
|
871 |
+
function yit_wpml_object_id( $element_id, $element_type = 'post', $return_original_if_missing = false, $ulanguage_code = null ) {
|
872 |
+
if( function_exists( 'wpml_object_id' ) ){
|
873 |
+
return wpml_object_id( $element_id, $element_type, $return_original_if_missing, $ulanguage_code );
|
874 |
+
}
|
875 |
+
elseif( function_exists( 'icl_object_id' ) ){
|
876 |
+
return icl_object_id( $element_id, $element_type, $return_original_if_missing, $ulanguage_code );
|
877 |
+
}
|
878 |
+
else{
|
879 |
+
return $element_id;
|
880 |
+
}
|
881 |
+
}
|
882 |
+
|
883 |
}
|
plugin-options/settings-options.php
CHANGED
@@ -21,7 +21,7 @@ $videobox = defined( 'YWCTM_PREMIUM' ) ? '' : array(
|
|
21 |
'title_first_column' => __( 'Discover the Advanced Features', 'ywctm' ),
|
22 |
'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WooCommerce Catalog Mode to benefit from all features!', 'ywctm' ),
|
23 |
'video' => array(
|
24 |
-
'video_id' => '
|
25 |
'video_image_url' => YWCTM_ASSETS_URL.'/images/yith-woocommerce-catalog-mode.jpg',
|
26 |
'video_description' => __( 'YITH WooCommerce Catalog Mode', 'ywctm' ),
|
27 |
),
|
21 |
'title_first_column' => __( 'Discover the Advanced Features', 'ywctm' ),
|
22 |
'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WooCommerce Catalog Mode to benefit from all features!', 'ywctm' ),
|
23 |
'video' => array(
|
24 |
+
'video_id' => '120697979',
|
25 |
'video_image_url' => YWCTM_ASSETS_URL.'/images/yith-woocommerce-catalog-mode.jpg',
|
26 |
'video_description' => __( 'YITH WooCommerce Catalog Mode', 'ywctm' ),
|
27 |
),
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== YITH WooCommerce Catalog Mode ===
|
2 |
|
3 |
Contributors: yithemes
|
4 |
-
Tags: woocommerce, products, themes, yit, yith, e-commerce, shop, catalog mode, catalogue mode, remove add to cart, ask for price, ask price, asking for price, asking price, button remove, call, call for price, call me, call us, contact, email, hide add to cart, hide price
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 4.2.
|
7 |
-
Stable tag: 1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -48,6 +48,11 @@ YITH WooCommerce Catalog Mode will add a new tab called "Catalog Mode" inside th
|
|
48 |
|
49 |
== Changelog ==
|
50 |
|
|
|
|
|
|
|
|
|
|
|
51 |
= 1.0.9 =
|
52 |
|
53 |
* Fixed: YITH WooCommerce Colors and Labels Variations compatibility
|
@@ -92,7 +97,7 @@ YITH WooCommerce Catalog Mode will add a new tab called "Catalog Mode" inside th
|
|
92 |
|
93 |
== Upgrade Notice ==
|
94 |
|
95 |
-
Last Stable Tag 1.0
|
96 |
|
97 |
== Suggestions ==
|
98 |
|
1 |
=== YITH WooCommerce Catalog Mode ===
|
2 |
|
3 |
Contributors: yithemes
|
4 |
+
Tags: woocommerce, products, themes, yit, yith, yithemes, e-commerce, shop, catalog mode, catalogue mode, remove add to cart, ask for price, ask price, asking for price, asking price, button remove, call, call for price, call me, call us, contact, email, hide add to cart, hide price
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 4.2.4
|
7 |
+
Stable tag: 1.1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
48 |
|
49 |
== Changelog ==
|
50 |
|
51 |
+
= 1.1.0 =
|
52 |
+
|
53 |
+
* Added: Support to WooCommerce 2.4
|
54 |
+
* Updated: Plugin core framework
|
55 |
+
|
56 |
= 1.0.9 =
|
57 |
|
58 |
* Fixed: YITH WooCommerce Colors and Labels Variations compatibility
|
97 |
|
98 |
== Upgrade Notice ==
|
99 |
|
100 |
+
Last Stable Tag 1.1.0
|
101 |
|
102 |
== Suggestions ==
|
103 |
|