Version Description
Release Date - 1 February 2019
- Fixed compatibility issue for WooCommerce prior 3.2 version
- Added compatibility with WooCommerce Custom Fields plugin
Download this release
Release Info
Developer | templateinvaders |
Plugin | WooCommerce Wishlist Plugin |
Version | 1.9.10 |
Comparing to | |
See all releases |
Code changes from version 1.9.9 to 1.9.10
- assets/css/admin-form.min.css +1 -1
- assets/css/admin-setup.min.css +1 -1
- assets/css/admin.min.css +1 -1
- assets/css/public.min.css +1 -1
- assets/css/theme.min.css +1 -1
- assets/js/admin.min.js +1 -1
- assets/js/public.min.js +1 -1
- languages/ti-woocommerce-wishlist.pot +3 -3
- public/addtowishlist.class.php +1 -0
- public/wishlist/view.class.php +1 -1
- readme.txt +7 -1
- ti-woocommerce-wishlist.php +2 -2
- tinv-wishlists-function-integration.php +146 -11
assets/css/admin-form.min.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! WooCommerce Wishlist Plugin - version 1.9.
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
1 |
+
/*! WooCommerce Wishlist Plugin - version 1.9.10
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
assets/css/admin-setup.min.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! WooCommerce Wishlist Plugin - version 1.9.
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
1 |
+
/*! WooCommerce Wishlist Plugin - version 1.9.10
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
assets/css/admin.min.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! WooCommerce Wishlist Plugin - version 1.9.
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
1 |
+
/*! WooCommerce Wishlist Plugin - version 1.9.10
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
assets/css/public.min.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! WooCommerce Wishlist Plugin - version 1.9.
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
1 |
+
/*! WooCommerce Wishlist Plugin - version 1.9.10
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
assets/css/theme.min.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! WooCommerce Wishlist Plugin - version 1.9.
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
1 |
+
/*! WooCommerce Wishlist Plugin - version 1.9.10
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
assets/js/admin.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! WooCommerce Wishlist Plugin - version 1.9.
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
1 |
+
/*! WooCommerce Wishlist Plugin - version 1.9.10
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
assets/js/public.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! WooCommerce Wishlist Plugin - version 1.9.
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
1 |
+
/*! WooCommerce Wishlist Plugin - version 1.9.10
|
2 |
* https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
3 |
* Copyright (c) 2019;
|
4 |
* Licensed GPLv2+ */
|
languages/ti-woocommerce-wishlist.pot
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Project-Id-Version: WooCommerce Wishlist Plugin {{ VERSION }}\n"
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://wordpress.org/support/plugin/ti-woocommerce-wishlist\n"
|
8 |
-
"POT-Creation-Date: 2019-01
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -967,11 +967,11 @@ msgstr ""
|
|
967 |
msgid "Ready!"
|
968 |
msgstr ""
|
969 |
|
970 |
-
#: public/addtowishlist.class.php:
|
971 |
msgid "Please, login to add products to Wishlist"
|
972 |
msgstr ""
|
973 |
|
974 |
-
#: public/addtowishlist.class.php:
|
975 |
msgid "Login"
|
976 |
msgstr ""
|
977 |
|
5 |
"Project-Id-Version: WooCommerce Wishlist Plugin {{ VERSION }}\n"
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://wordpress.org/support/plugin/ti-woocommerce-wishlist\n"
|
8 |
+
"POT-Creation-Date: 2019-02-01 21:22:32+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
967 |
msgid "Ready!"
|
968 |
msgstr ""
|
969 |
|
970 |
+
#: public/addtowishlist.class.php:173
|
971 |
msgid "Please, login to add products to Wishlist"
|
972 |
msgstr ""
|
973 |
|
974 |
+
#: public/addtowishlist.class.php:175
|
975 |
msgid "Login"
|
976 |
msgstr ""
|
977 |
|
public/addtowishlist.class.php
CHANGED
@@ -112,6 +112,7 @@ class TInvWL_Public_AddToWishlist {
|
|
112 |
case 'above_thumb':
|
113 |
add_action( 'tinvwl_above_thumb_loop_item', 'tinvwl_view_addto_htmlloop' );
|
114 |
add_action( 'woocommerce_before_shop_loop_item', 'tinvwl_view_addto_htmlloop', 9 );
|
|
|
115 |
case 'shortcode':
|
116 |
break;
|
117 |
case 'after':
|
112 |
case 'above_thumb':
|
113 |
add_action( 'tinvwl_above_thumb_loop_item', 'tinvwl_view_addto_htmlloop' );
|
114 |
add_action( 'woocommerce_before_shop_loop_item', 'tinvwl_view_addto_htmlloop', 9 );
|
115 |
+
break;
|
116 |
case 'shortcode':
|
117 |
break;
|
118 |
case 'after':
|
public/wishlist/view.class.php
CHANGED
@@ -94,7 +94,7 @@ class TInvWL_Public_Wishlist_View {
|
|
94 |
* Redirect back after successful login.
|
95 |
*/
|
96 |
public function login_post_redirect() {
|
97 |
-
$nonce_value =
|
98 |
if ( ! empty( $_POST['login'] ) && wp_verify_nonce( $nonce_value, 'woocommerce-login' ) && ! empty( $_GET['tinvwl_redirect'] ) ) {
|
99 |
$_POST['redirect'] = $_GET['tinvwl_redirect']; // Force WC Login form handler to do redirect.
|
100 |
}
|
94 |
* Redirect back after successful login.
|
95 |
*/
|
96 |
public function login_post_redirect() {
|
97 |
+
$nonce_value = isset( $_REQUEST['woocommerce-login-nonce'] ) ? $_REQUEST['woocommerce-login-nonce'] : isset( $_REQUEST['_wpnonce'] ) ? $_REQUEST['_wpnonce'] : '';
|
98 |
if ( ! empty( $_POST['login'] ) && wp_verify_nonce( $nonce_value, 'woocommerce-login' ) && ! empty( $_GET['tinvwl_redirect'] ) ) {
|
99 |
$_POST['redirect'] = $_GET['tinvwl_redirect']; // Force WC Login form handler to do redirect.
|
100 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://templateinvaders.com/product/ti-woocommerce-wishlist-wordpr
|
|
4 |
Tags: wishlist, woocommerce, woocommerce wishlist, e-commerce, ecommerce
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.0
|
7 |
-
Stable tag: 1.9.
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -130,6 +130,12 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
|
|
130 |
|
131 |
|
132 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
= 1.9.9 =
|
134 |
*Release Date - 9 January 2019*
|
135 |
|
4 |
Tags: wishlist, woocommerce, woocommerce wishlist, e-commerce, ecommerce
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.0
|
7 |
+
Stable tag: 1.9.10
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
130 |
|
131 |
|
132 |
== Changelog ==
|
133 |
+
= 1.9.10 =
|
134 |
+
*Release Date - 1 February 2019*
|
135 |
+
|
136 |
+
* Fixed compatibility issue for WooCommerce prior 3.2 version
|
137 |
+
* Added compatibility with WooCommerce Custom Fields plugin
|
138 |
+
|
139 |
= 1.9.9 =
|
140 |
*Release Date - 9 January 2019*
|
141 |
|
ti-woocommerce-wishlist.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: WooCommerce Wishlist Plugin
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
-
* Version: 1.9.
|
8 |
* Requires at least: 4.5
|
9 |
* Tested up to: 4.9
|
10 |
* WC requires at least: 2.6
|
@@ -41,7 +41,7 @@ if ( ! defined( 'TINVWL_DOMAIN' ) ) {
|
|
41 |
}
|
42 |
|
43 |
if ( ! defined( 'TINVWL_FVERSION' ) ) {
|
44 |
-
define( 'TINVWL_FVERSION', '1.9.
|
45 |
}
|
46 |
|
47 |
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
|
4 |
* Plugin Name: WooCommerce Wishlist Plugin
|
5 |
* Plugin URI: https://wordpress.org/plugins/ti-woocommerce-wishlist/
|
6 |
* Description: Wishlist functionality for your WooCommerce store.
|
7 |
+
* Version: 1.9.10
|
8 |
* Requires at least: 4.5
|
9 |
* Tested up to: 4.9
|
10 |
* WC requires at least: 2.6
|
41 |
}
|
42 |
|
43 |
if ( ! defined( 'TINVWL_FVERSION' ) ) {
|
44 |
+
define( 'TINVWL_FVERSION', '1.9.10' );
|
45 |
}
|
46 |
|
47 |
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
|
tinv-wishlists-function-integration.php
CHANGED
@@ -449,7 +449,7 @@ if ( ! function_exists( 'tinvwl_gift_card_add_url' ) ) {
|
|
449 |
if ( ! function_exists( 'tinv_wishlist_meta_support_rpgiftcards' ) ) {
|
450 |
|
451 |
/**
|
452 |
-
* Set
|
453 |
*
|
454 |
* @param array $meta Meta array.
|
455 |
*
|
@@ -513,7 +513,7 @@ if ( ! function_exists( 'tinv_wishlist_metaprepare_rpgiftcards' ) ) {
|
|
513 |
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_bookings' ) ) {
|
514 |
|
515 |
/**
|
516 |
-
* Set
|
517 |
*
|
518 |
* @param array $meta Meta array.
|
519 |
* @param integer $product_id Priduct ID.
|
@@ -635,7 +635,7 @@ if ( ! function_exists( 'tinvwl_item_status_woocommerce_bookings' ) ) {
|
|
635 |
if ( ! function_exists( 'tinv_wishlist_metasupport_wc_gf_addons' ) ) {
|
636 |
|
637 |
/**
|
638 |
-
* Set
|
639 |
*
|
640 |
* @param array $meta Meta array.
|
641 |
*
|
@@ -666,7 +666,7 @@ if ( ! function_exists( 'tinv_wishlist_metasupport_wc_gf_addons' ) ) {
|
|
666 |
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_composite_products' ) ) {
|
667 |
|
668 |
/**
|
669 |
-
* Set
|
670 |
*
|
671 |
* @param array $meta Meta array.
|
672 |
* @param integer $product_id Product ID.
|
@@ -825,7 +825,7 @@ if ( ! function_exists( 'tinvwl_item_price_woocommerce_composite_products' ) ) {
|
|
825 |
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_product_bundles' ) ) {
|
826 |
|
827 |
/**
|
828 |
-
* Set
|
829 |
*
|
830 |
* @param array $meta Meta array.
|
831 |
* @param integer $product_id Product ID.
|
@@ -1171,7 +1171,7 @@ if ( ! function_exists( 'tinvwl_add_form_woocommerce_mix_and_match_products' ) )
|
|
1171 |
if ( ! function_exists( 'tinv_wishlist_metasupport_yith_woocommerce_product_bundles' ) ) {
|
1172 |
|
1173 |
/**
|
1174 |
-
* Set
|
1175 |
*
|
1176 |
* @param array $meta Meta array.
|
1177 |
* @param integer $product_id Product ID.
|
@@ -1312,7 +1312,7 @@ if ( ! function_exists( 'tinvwl_row_yith_woocommerce_product_bundles' ) ) {
|
|
1312 |
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_product_add_on' ) ) {
|
1313 |
|
1314 |
/**
|
1315 |
-
* Set
|
1316 |
*
|
1317 |
* @param array $meta Meta array.
|
1318 |
* @param integer $product_id Product ID.
|
@@ -1334,7 +1334,7 @@ if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_product_add_on' )
|
|
1334 |
if ( ! function_exists( 'tinv_wishlist_item_meta_woocommerce_product_add_on' ) ) {
|
1335 |
|
1336 |
/**
|
1337 |
-
* Set
|
1338 |
*
|
1339 |
* @param array $meta Meta array.
|
1340 |
* @param array $wl_product Wishlist Product.
|
@@ -1475,7 +1475,7 @@ if ( ! function_exists( 'tinv_wishlist_item_meta_woocommerce_product_add_on' ) )
|
|
1475 |
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_tm_extra_product_options' ) ) {
|
1476 |
|
1477 |
/**
|
1478 |
-
* Set
|
1479 |
*
|
1480 |
* @param array $meta Meta array.
|
1481 |
* @param integer $product_id Product ID.
|
@@ -1602,7 +1602,7 @@ if ( function_exists( 'wpm_translate_string' ) ) {
|
|
1602 |
if ( ! function_exists( 'tinv_wishlist_item_meta_yith_woocommerce_product_add_on' ) ) {
|
1603 |
|
1604 |
/**
|
1605 |
-
* Set
|
1606 |
*
|
1607 |
* @param array $meta Meta array.
|
1608 |
* @param array $wl_product Wishlist Product.
|
@@ -1721,10 +1721,41 @@ if ( ! function_exists( 'tinvwl_item_price_yith_woocommerce_product_add_on' ) )
|
|
1721 |
} // End if().
|
1722 |
|
1723 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1724 |
if ( ! function_exists( 'tinv_wishlist_item_meta_woocommerce_product_addons' ) ) {
|
1725 |
|
1726 |
/**
|
1727 |
-
* Set
|
1728 |
*
|
1729 |
* @param array $meta Meta array.
|
1730 |
* @param array $wl_product Wishlist Product.
|
@@ -1831,6 +1862,110 @@ if ( ! function_exists( 'tinv_wishlist_item_meta_woocommerce_product_addons' ) )
|
|
1831 |
add_filter( 'tinvwl_wishlist_item_meta_post', 'tinv_wishlist_item_meta_woocommerce_product_addons', 10, 3 );
|
1832 |
} // End if().
|
1833 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1834 |
if ( ! function_exists( 'tinvwl_item_price_woocommerce_product_addons' ) ) {
|
1835 |
|
1836 |
/**
|
449 |
if ( ! function_exists( 'tinv_wishlist_meta_support_rpgiftcards' ) ) {
|
450 |
|
451 |
/**
|
452 |
+
* Set description for meta WooCommerce - Gift Cards
|
453 |
*
|
454 |
* @param array $meta Meta array.
|
455 |
*
|
513 |
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_bookings' ) ) {
|
514 |
|
515 |
/**
|
516 |
+
* Set description for meta WooCommerce Bookings
|
517 |
*
|
518 |
* @param array $meta Meta array.
|
519 |
* @param integer $product_id Priduct ID.
|
635 |
if ( ! function_exists( 'tinv_wishlist_metasupport_wc_gf_addons' ) ) {
|
636 |
|
637 |
/**
|
638 |
+
* Set description for meta WooCommerce - Gravity Forms Product Add-Ons
|
639 |
*
|
640 |
* @param array $meta Meta array.
|
641 |
*
|
666 |
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_composite_products' ) ) {
|
667 |
|
668 |
/**
|
669 |
+
* Set description for meta WooCommerce Composite Products
|
670 |
*
|
671 |
* @param array $meta Meta array.
|
672 |
* @param integer $product_id Product ID.
|
825 |
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_product_bundles' ) ) {
|
826 |
|
827 |
/**
|
828 |
+
* Set description for meta WooCommerce Product Bundles
|
829 |
*
|
830 |
* @param array $meta Meta array.
|
831 |
* @param integer $product_id Product ID.
|
1171 |
if ( ! function_exists( 'tinv_wishlist_metasupport_yith_woocommerce_product_bundles' ) ) {
|
1172 |
|
1173 |
/**
|
1174 |
+
* Set description for meta WooCommerce Mix and Match
|
1175 |
*
|
1176 |
* @param array $meta Meta array.
|
1177 |
* @param integer $product_id Product ID.
|
1312 |
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_product_add_on' ) ) {
|
1313 |
|
1314 |
/**
|
1315 |
+
* Set description for meta WooCommerce Product Add-on
|
1316 |
*
|
1317 |
* @param array $meta Meta array.
|
1318 |
* @param integer $product_id Product ID.
|
1334 |
if ( ! function_exists( 'tinv_wishlist_item_meta_woocommerce_product_add_on' ) ) {
|
1335 |
|
1336 |
/**
|
1337 |
+
* Set description for meta WooCommerce Product Add-on
|
1338 |
*
|
1339 |
* @param array $meta Meta array.
|
1340 |
* @param array $wl_product Wishlist Product.
|
1475 |
if ( ! function_exists( 'tinv_wishlist_metasupport_woocommerce_tm_extra_product_options' ) ) {
|
1476 |
|
1477 |
/**
|
1478 |
+
* Set description for meta WooCommerce TM Extra Product Options
|
1479 |
*
|
1480 |
* @param array $meta Meta array.
|
1481 |
* @param integer $product_id Product ID.
|
1602 |
if ( ! function_exists( 'tinv_wishlist_item_meta_yith_woocommerce_product_add_on' ) ) {
|
1603 |
|
1604 |
/**
|
1605 |
+
* Set description for meta YITH WooCommerce Product Add-on
|
1606 |
*
|
1607 |
* @param array $meta Meta array.
|
1608 |
* @param array $wl_product Wishlist Product.
|
1721 |
} // End if().
|
1722 |
|
1723 |
|
1724 |
+
if ( ! function_exists( 'tinvwl_item_price_woocommerce_custom_fields' ) ) {
|
1725 |
+
|
1726 |
+
/**
|
1727 |
+
* Modify price for WooCommerce Custom Fields.
|
1728 |
+
*
|
1729 |
+
* @param string $price Returned price.
|
1730 |
+
* @param array $wl_product Wishlist Product.
|
1731 |
+
* @param \WC_Product $product Woocommerce Product.
|
1732 |
+
*
|
1733 |
+
* @return string
|
1734 |
+
*/
|
1735 |
+
function tinvwl_item_price_woocommerce_custom_fields( $price, $wl_product, $product ) {
|
1736 |
+
|
1737 |
+
if ( class_exists( 'WCCF' ) && isset( $wl_product['meta']['wccf']['product_field'] ) ) {
|
1738 |
+
|
1739 |
+
$posted = array();
|
1740 |
+
|
1741 |
+
foreach ( $wl_product['meta']['wccf']['product_field'] as $key => $value ) {
|
1742 |
+
$posted[ $key ] = array( 'value' => $value );
|
1743 |
+
}
|
1744 |
+
|
1745 |
+
$price = wc_price( WCCF_Pricing::get_adjusted_price( $product->get_price(), $wl_product['product_id'], $wl_product['variation_id'], $posted, 1, false, false, $product, false ) );
|
1746 |
+
}
|
1747 |
+
|
1748 |
+
return $price;
|
1749 |
+
}
|
1750 |
+
|
1751 |
+
add_filter( 'tinvwl_wishlist_item_price', 'tinvwl_item_price_woocommerce_custom_fields', 10, 3 );
|
1752 |
+
} // End if().
|
1753 |
+
|
1754 |
+
|
1755 |
if ( ! function_exists( 'tinv_wishlist_item_meta_woocommerce_product_addons' ) ) {
|
1756 |
|
1757 |
/**
|
1758 |
+
* Set description for meta WooCommerce Product Addons
|
1759 |
*
|
1760 |
* @param array $meta Meta array.
|
1761 |
* @param array $wl_product Wishlist Product.
|
1862 |
add_filter( 'tinvwl_wishlist_item_meta_post', 'tinv_wishlist_item_meta_woocommerce_product_addons', 10, 3 );
|
1863 |
} // End if().
|
1864 |
|
1865 |
+
if ( ! function_exists( 'tinv_wishlist_item_meta_woocommerce_custom_fields' ) ) {
|
1866 |
+
|
1867 |
+
/**
|
1868 |
+
* Set description for meta WooCommerce Custom Fields
|
1869 |
+
*
|
1870 |
+
* @param array $meta Meta array.
|
1871 |
+
* @param array $wl_product Wishlist Product.
|
1872 |
+
* @param \WC_Product $product Woocommerce Product.
|
1873 |
+
*
|
1874 |
+
* @return array
|
1875 |
+
*/
|
1876 |
+
function tinv_wishlist_item_meta_woocommerce_custom_fields( $item_data, $product_id, $variation_id ) {
|
1877 |
+
|
1878 |
+
|
1879 |
+
if ( class_exists( 'WCCF' ) && isset( $item_data['wccf'] ) ) {
|
1880 |
+
|
1881 |
+
$id = ( $variation_id ) ? $variation_id : $product_id;
|
1882 |
+
$product = wc_get_product( $id );
|
1883 |
+
if ( $product ) {
|
1884 |
+
|
1885 |
+
|
1886 |
+
// Get fields to save values for
|
1887 |
+
$fields = WCCF_Product_Field_Controller::get_filtered( null, array(
|
1888 |
+
'item_id' => $product_id,
|
1889 |
+
'child_id' => $variation_id
|
1890 |
+
) );
|
1891 |
+
|
1892 |
+
// Set quantity
|
1893 |
+
$quantity = 1;
|
1894 |
+
$quantity_index = null;
|
1895 |
+
$display_pricing = null;
|
1896 |
+
|
1897 |
+
// Check if pricing can be displayed for this product
|
1898 |
+
if ( $display_pricing === null ) {
|
1899 |
+
$display_pricing = ! WCCF_WC_Product::skip_pricing( $product );
|
1900 |
+
}
|
1901 |
+
|
1902 |
+
foreach ( $fields as $field ) {
|
1903 |
+
|
1904 |
+
// Check how many times to iterate the same field (used for quantity-based product fields)
|
1905 |
+
if ( $quantity_index !== null ) {
|
1906 |
+
$iterations = ( $quantity_index + 1 );
|
1907 |
+
$i = $quantity_index;
|
1908 |
+
} else {
|
1909 |
+
$iterations = ( $field->is_quantity_based() && $quantity ) ? $quantity : 1;
|
1910 |
+
$i = 0;
|
1911 |
+
}
|
1912 |
+
|
1913 |
+
// Start iteration of the same field
|
1914 |
+
for ( $i = $i; $i < $iterations; $i ++ ) {
|
1915 |
+
|
1916 |
+
// Get field id
|
1917 |
+
$field_id = $field->get_id() . ( $i ? ( '_' . $i ) : '' );
|
1918 |
+
|
1919 |
+
// Special handling for files
|
1920 |
+
if ( $field->field_type_is( 'file' ) ) {
|
1921 |
+
//just skip this field type because we can't save uploaded data.
|
1922 |
+
} // Handle other field values
|
1923 |
+
else {
|
1924 |
+
|
1925 |
+
// Check if any data for this field was posted or is available in request query vars for GET requests
|
1926 |
+
if ( isset( $item_data['wccf']['display']['product_field'][ $field_id ] ) ) {
|
1927 |
+
|
1928 |
+
// Get field value
|
1929 |
+
if ( isset( $item_data['wccf']['display']['product_field'][ $field_id ] ) ) {
|
1930 |
+
$field_value = $item_data['wccf']['display']['product_field'][ $field_id ];
|
1931 |
+
}
|
1932 |
+
|
1933 |
+
// Prepare multiselect field values
|
1934 |
+
if ( $field->accepts_multiple_values() ) {
|
1935 |
+
|
1936 |
+
// Ensure that value is array
|
1937 |
+
$value = ! RightPress_Help::is_empty( $field_value ) ? (array) $field_value : array();
|
1938 |
+
|
1939 |
+
// Filter out hidden placeholder input value
|
1940 |
+
$value = array_filter( (array) $value, function ( $test_value ) {
|
1941 |
+
return trim( $test_value ) !== '';
|
1942 |
+
} );
|
1943 |
+
} else {
|
1944 |
+
$value = stripslashes( trim( $field_value ) );
|
1945 |
+
}
|
1946 |
+
|
1947 |
+
$item_data[] = array(
|
1948 |
+
'key' => $field->get_label(),
|
1949 |
+
'display' => $field->format_display_value( array( 'value' => $value ), $display_pricing ),
|
1950 |
+
);
|
1951 |
+
|
1952 |
+
|
1953 |
+
}
|
1954 |
+
}
|
1955 |
+
}
|
1956 |
+
}
|
1957 |
+
|
1958 |
+
unset( $item_data['wccf'] );
|
1959 |
+
unset( $item_data['wccf_ignore'] );
|
1960 |
+
}
|
1961 |
+
}
|
1962 |
+
|
1963 |
+
return $item_data;
|
1964 |
+
}
|
1965 |
+
|
1966 |
+
add_filter( 'tinvwl_wishlist_item_meta_post', 'tinv_wishlist_item_meta_woocommerce_custom_fields', 10, 3 );
|
1967 |
+
} // End if().
|
1968 |
+
|
1969 |
if ( ! function_exists( 'tinvwl_item_price_woocommerce_product_addons' ) ) {
|
1970 |
|
1971 |
/**
|