Version Description
Release Date - 22 February 2019
- Added compatibility with WooCommerce Advanced Quantity plugin
- Fixed an issue with dependencies in the wp_register_script function
Download this release
Release Info
Developer | templateinvaders |
Plugin | WooCommerce Wishlist Plugin |
Version | 1.9.14 |
Comparing to | |
See all releases |
Code changes from version 1.9.13 to 1.9.14
- 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 +7 -7
- public/tinvwl.class.php +1 -1
- public/wishlist/buttons.class.php +30 -20
- readme.txt +7 -1
- ti-woocommerce-wishlist.php +2 -2
- tinv-wishlists-function-integration.php +68 -0
- tinv-wishlists-function.php +8 -8
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.14
|
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.14
|
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.14
|
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.14
|
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.14
|
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.14
|
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.14
|
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-02-
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -1025,7 +1025,7 @@ msgstr ""
|
|
1025 |
msgid "Action"
|
1026 |
msgstr ""
|
1027 |
|
1028 |
-
#: public/wishlist/buttons.class.php:
|
1029 |
msgid "Product %s could not be added to cart because some requirements are not met."
|
1030 |
msgid_plural ""
|
1031 |
"Products: %s could not be added to cart because some requirements are not "
|
@@ -1033,19 +1033,19 @@ msgid_plural ""
|
|
1033 |
msgstr[0] ""
|
1034 |
msgstr[1] ""
|
1035 |
|
1036 |
-
#: public/wishlist/buttons.class.php:
|
1037 |
msgid "Actions"
|
1038 |
msgstr ""
|
1039 |
|
1040 |
-
#: public/wishlist/buttons.class.php:
|
1041 |
msgid "Remove"
|
1042 |
msgstr ""
|
1043 |
|
1044 |
-
#: public/wishlist/buttons.class.php:
|
1045 |
msgid "“%s”"
|
1046 |
msgstr ""
|
1047 |
|
1048 |
-
#: public/wishlist/buttons.class.php:
|
1049 |
msgid "%s has been successfully removed from wishlist."
|
1050 |
msgid_plural "%s have been successfully removed from wishlist."
|
1051 |
msgstr[0] ""
|
@@ -1405,7 +1405,7 @@ msgstr ""
|
|
1405 |
msgid "https://templateinvaders.com/"
|
1406 |
msgstr ""
|
1407 |
|
1408 |
-
#: public/wishlist/buttons.class.php:
|
1409 |
msgctxt "Item name in quotes"
|
1410 |
msgid "“%s”"
|
1411 |
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-02-22 15:24:36+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
1025 |
msgid "Action"
|
1026 |
msgstr ""
|
1027 |
|
1028 |
+
#: public/wishlist/buttons.class.php:309 public/wishlist/buttons.class.php:441
|
1029 |
msgid "Product %s could not be added to cart because some requirements are not met."
|
1030 |
msgid_plural ""
|
1031 |
"Products: %s could not be added to cart because some requirements are not "
|
1033 |
msgstr[0] ""
|
1034 |
msgstr[1] ""
|
1035 |
|
1036 |
+
#: public/wishlist/buttons.class.php:337
|
1037 |
msgid "Actions"
|
1038 |
msgstr ""
|
1039 |
|
1040 |
+
#: public/wishlist/buttons.class.php:346 templates/ti-wishlist.php:72
|
1041 |
msgid "Remove"
|
1042 |
msgstr ""
|
1043 |
|
1044 |
+
#: public/wishlist/buttons.class.php:495 public/wishlist/view.class.php:360
|
1045 |
msgid "“%s”"
|
1046 |
msgstr ""
|
1047 |
|
1048 |
+
#: public/wishlist/buttons.class.php:508
|
1049 |
msgid "%s has been successfully removed from wishlist."
|
1050 |
msgid_plural "%s have been successfully removed from wishlist."
|
1051 |
msgstr[0] ""
|
1405 |
msgid "https://templateinvaders.com/"
|
1406 |
msgstr ""
|
1407 |
|
1408 |
+
#: public/wishlist/buttons.class.php:306 public/wishlist/buttons.class.php:438
|
1409 |
msgctxt "Item name in quotes"
|
1410 |
msgid "“%s”"
|
1411 |
msgstr ""
|
public/tinvwl.class.php
CHANGED
@@ -477,7 +477,7 @@ class TInvWL_Public_TInvWL {
|
|
477 |
wp_register_script( $this->_name, TINVWL_URL . 'assets/js/public' . $suffix . '.js', array(
|
478 |
'jquery',
|
479 |
version_compare( WC_VERSION, '3.0.0', '<' ) ? 'jquery-cookie' : 'js-cookie',
|
480 |
-
apply_filters( 'tinvwl-wc-cart-fragments', true ) ? 'wc-cart-fragments' : ''
|
481 |
), $this->_version, true );
|
482 |
wp_localize_script( $this->_name, 'tinvwl_add_to_wishlist', array(
|
483 |
'text_create' => __( 'Create New', 'ti-woocommerce-wishlist' ),
|
477 |
wp_register_script( $this->_name, TINVWL_URL . 'assets/js/public' . $suffix . '.js', array(
|
478 |
'jquery',
|
479 |
version_compare( WC_VERSION, '3.0.0', '<' ) ? 'jquery-cookie' : 'js-cookie',
|
480 |
+
apply_filters( 'tinvwl-wc-cart-fragments', true ) ? 'wc-cart-fragments' : 'jquery'
|
481 |
), $this->_version, true );
|
482 |
wp_localize_script( $this->_name, 'tinvwl_add_to_wishlist', array(
|
483 |
'text_create' => __( 'Create New', 'ti-woocommerce-wishlist' ),
|
public/wishlist/buttons.class.php
CHANGED
@@ -260,7 +260,8 @@ class TInvWL_Public_Wishlist_Buttons {
|
|
260 |
*/
|
261 |
public static function add_all( $wishlist, $selected = array(), $_quantity = array(), $owner = false ) {
|
262 |
$products = self::get_current_products( $wishlist );
|
263 |
-
|
|
|
264 |
foreach ( $products as $_product ) {
|
265 |
$product_data = wc_get_product( $_product['variation_id'] ? $_product['variation_id'] : $_product['product_id'] );
|
266 |
|
@@ -281,14 +282,16 @@ class TInvWL_Public_Wishlist_Buttons {
|
|
281 |
// restore global product data.
|
282 |
$product = $_product_tmp;
|
283 |
|
|
|
|
|
284 |
if ( apply_filters( 'tinvwl_product_add_to_cart_need_redirect', false, $product_data, $redirect_url, $_product ) ) {
|
285 |
$errors[] = $_product['product_id'];
|
286 |
continue;
|
287 |
}
|
|
|
288 |
$_product = $_product['ID'];
|
289 |
|
290 |
-
$
|
291 |
-
$add = TInvWL_Public_Cart::add( $wishlist, $_product, $quantity );
|
292 |
|
293 |
if ( $add ) {
|
294 |
$result = tinv_array_merge( $result, $add );
|
@@ -393,29 +396,36 @@ class TInvWL_Public_Wishlist_Buttons {
|
|
393 |
}
|
394 |
$_product = $wlp->get_wishlist( array( 'ID' => $id ) );
|
395 |
$_product = array_shift( $_product );
|
396 |
-
if ( ! empty( $_product ) && ! empty( $_product['data'] ) ) {
|
397 |
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
|
404 |
-
|
405 |
-
|
406 |
-
|
|
|
|
|
407 |
|
|
|
|
|
|
|
408 |
|
409 |
-
// restore global product data.
|
410 |
-
$product = $_product_tmp;
|
411 |
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
|
|
|
|
|
|
|
|
|
|
416 |
}
|
417 |
-
|
418 |
-
$add
|
419 |
if ( $add ) {
|
420 |
$result = tinv_array_merge( $result, $add );
|
421 |
} else {
|
260 |
*/
|
261 |
public static function add_all( $wishlist, $selected = array(), $_quantity = array(), $owner = false ) {
|
262 |
$products = self::get_current_products( $wishlist );
|
263 |
+
|
264 |
+
$result = $errors = array();
|
265 |
foreach ( $products as $_product ) {
|
266 |
$product_data = wc_get_product( $_product['variation_id'] ? $_product['variation_id'] : $_product['product_id'] );
|
267 |
|
282 |
// restore global product data.
|
283 |
$product = $_product_tmp;
|
284 |
|
285 |
+
$quantity = apply_filters( 'tinvwl_product_add_to_cart_quantity', array_key_exists( $_product['ID'], (array) $_quantity ) ? $_quantity[ $_product['ID'] ] : 1, $product_data );
|
286 |
+
$_product['quantity'] = $quantity;
|
287 |
if ( apply_filters( 'tinvwl_product_add_to_cart_need_redirect', false, $product_data, $redirect_url, $_product ) ) {
|
288 |
$errors[] = $_product['product_id'];
|
289 |
continue;
|
290 |
}
|
291 |
+
|
292 |
$_product = $_product['ID'];
|
293 |
|
294 |
+
$add = TInvWL_Public_Cart::add( $wishlist, $_product, $quantity );
|
|
|
295 |
|
296 |
if ( $add ) {
|
297 |
$result = tinv_array_merge( $result, $add );
|
396 |
}
|
397 |
$_product = $wlp->get_wishlist( array( 'ID' => $id ) );
|
398 |
$_product = array_shift( $_product );
|
|
|
399 |
|
400 |
+
$product_data = wc_get_product( $_product['variation_id'] ? $_product['variation_id'] : $_product['product_id'] );
|
401 |
+
|
402 |
+
if ( ! $product_data || 'trash' === $product_data->get_status() ) {
|
403 |
+
continue;
|
404 |
+
}
|
405 |
|
406 |
+
global $product;
|
407 |
+
// store global product data.
|
408 |
+
$_product_tmp = $product;
|
409 |
+
// override global product data.
|
410 |
+
$product = $product_data;
|
411 |
|
412 |
+
add_filter( 'clean_url', 'tinvwl_clean_url', 10, 2 );
|
413 |
+
$redirect_url = $product_data->add_to_cart_url();
|
414 |
+
remove_filter( 'clean_url', 'tinvwl_clean_url', 10 );
|
415 |
|
|
|
|
|
416 |
|
417 |
+
// restore global product data.
|
418 |
+
$product = $_product_tmp;
|
419 |
+
|
420 |
+
$quantity = apply_filters( 'tinvwl_product_add_to_cart_quantity', array_key_exists( $id, (array) $_quantity ) ? $_quantity[ $id ] : 1, $product_data );
|
421 |
+
$_product['quantity'] = $quantity;
|
422 |
+
|
423 |
+
if ( apply_filters( 'tinvwl_product_add_to_cart_need_redirect', false, $product_data, $redirect_url, $_product ) ) {
|
424 |
+
$errors[] = $_product['product_id'];
|
425 |
+
continue;
|
426 |
}
|
427 |
+
|
428 |
+
$add = TInvWL_Public_Cart::add( $wishlist, $id, $quantity );
|
429 |
if ( $add ) {
|
430 |
$result = tinv_array_merge( $result, $add );
|
431 |
} else {
|
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.1
|
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.13 =
|
134 |
*Release Date - 16 February 2019*
|
135 |
|
4 |
Tags: wishlist, woocommerce, woocommerce wishlist, e-commerce, ecommerce
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.1
|
7 |
+
Stable tag: 1.9.14
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
130 |
|
131 |
|
132 |
== Changelog ==
|
133 |
+
= 1.9.14 =
|
134 |
+
*Release Date - 22 February 2019*
|
135 |
+
|
136 |
+
* Added compatibility with WooCommerce Advanced Quantity plugin
|
137 |
+
* Fixed an issue with dependencies in the wp_register_script function
|
138 |
+
|
139 |
= 1.9.13 =
|
140 |
*Release Date - 16 February 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: 5.1
|
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.14
|
8 |
* Requires at least: 4.5
|
9 |
* Tested up to: 5.1
|
10 |
* WC requires at least: 2.6
|
41 |
}
|
42 |
|
43 |
if ( ! defined( 'TINVWL_FVERSION' ) ) {
|
44 |
+
define( 'TINVWL_FVERSION', '1.9.14' );
|
45 |
}
|
46 |
|
47 |
if ( ! defined( 'TINVWL_LOAD_FREE' ) ) {
|
tinv-wishlists-function-integration.php
CHANGED
@@ -2090,6 +2090,9 @@ if ( ! function_exists( 'tinvwl_item_price_woocommerce_product_addons' ) ) {
|
|
2090 |
if ( ! function_exists( 'oceanwp_fix_archive_markup' ) ) {
|
2091 |
add_action( 'init', 'oceanwp_fix_archive_markup' );
|
2092 |
|
|
|
|
|
|
|
2093 |
function oceanwp_fix_archive_markup() {
|
2094 |
if ( class_exists( 'OceanWP_WooCommerce_Config' ) && 'above_thumb' === tinv_get_option( 'add_to_wishlist_catalog', 'position' ) ) {
|
2095 |
remove_action( 'woocommerce_before_shop_loop_item', 'tinvwl_view_addto_htmlloop', 9 );
|
@@ -2121,3 +2124,68 @@ if ( ! function_exists( 'tinv_wishlist_metaprepare_gtm4wp' ) ) {
|
|
2121 |
|
2122 |
add_filter( 'tinvwl_product_prepare_meta', 'tinv_wishlist_metaprepare_gtm4wp' );
|
2123 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2090 |
if ( ! function_exists( 'oceanwp_fix_archive_markup' ) ) {
|
2091 |
add_action( 'init', 'oceanwp_fix_archive_markup' );
|
2092 |
|
2093 |
+
/**
|
2094 |
+
* OceanWP theme fix for catalog add to wishlist button position
|
2095 |
+
*/
|
2096 |
function oceanwp_fix_archive_markup() {
|
2097 |
if ( class_exists( 'OceanWP_WooCommerce_Config' ) && 'above_thumb' === tinv_get_option( 'add_to_wishlist_catalog', 'position' ) ) {
|
2098 |
remove_action( 'woocommerce_before_shop_loop_item', 'tinvwl_view_addto_htmlloop', 9 );
|
2124 |
|
2125 |
add_filter( 'tinvwl_product_prepare_meta', 'tinv_wishlist_metaprepare_gtm4wp' );
|
2126 |
}
|
2127 |
+
|
2128 |
+
// WooCommerce Advanced Quantity compatibility.
|
2129 |
+
if ( ! function_exists( 'tinv_wishlist_qty_woo_advanced_qty' ) ) {
|
2130 |
+
|
2131 |
+
/**
|
2132 |
+
* Force quantity to minimum.
|
2133 |
+
*
|
2134 |
+
* @param $quantity
|
2135 |
+
* @param $product
|
2136 |
+
*
|
2137 |
+
* @return mixed
|
2138 |
+
*/
|
2139 |
+
function tinv_wishlist_qty_woo_advanced_qty( $quantity, $product ) {
|
2140 |
+
|
2141 |
+
if ( class_exists( 'Woo_Advanced_QTY_Public' ) ) {
|
2142 |
+
$advanced_qty = new Woo_Advanced_QTY_Public( null, null );
|
2143 |
+
|
2144 |
+
$args = $advanced_qty->qty_input_args( array(
|
2145 |
+
'min_value' => 1,
|
2146 |
+
'max_value' => '',
|
2147 |
+
'step' => 1
|
2148 |
+
), $product );
|
2149 |
+
|
2150 |
+
$quantity = $args['input_value'];
|
2151 |
+
}
|
2152 |
+
|
2153 |
+
return $quantity;
|
2154 |
+
}
|
2155 |
+
|
2156 |
+
add_filter( 'tinvwl_product_add_to_cart_quantity', 'tinv_wishlist_qty_woo_advanced_qty', 10, 2 );
|
2157 |
+
}
|
2158 |
+
|
2159 |
+
// WooCommerce Advanced Quantity compatibility.
|
2160 |
+
if ( ! function_exists( 'tinv_wishlist_qty_woo_advanced_url' ) ) {
|
2161 |
+
|
2162 |
+
/**
|
2163 |
+
* @param $url
|
2164 |
+
* @param $product
|
2165 |
+
*
|
2166 |
+
* @return string|string[]|null
|
2167 |
+
*/
|
2168 |
+
function tinv_wishlist_qty_woo_advanced_url( $url, $product ) {
|
2169 |
+
|
2170 |
+
if ( class_exists( 'Woo_Advanced_QTY_Public' ) ) {
|
2171 |
+
if ( strpos( $url, 'add-to-cart=' ) ) {
|
2172 |
+
$advanced_qty = new Woo_Advanced_QTY_Public( null, null );
|
2173 |
+
$args = $advanced_qty->qty_input_args( array(
|
2174 |
+
'min_value' => 1,
|
2175 |
+
'max_value' => '',
|
2176 |
+
'step' => 1
|
2177 |
+
), $product );
|
2178 |
+
|
2179 |
+
$url = preg_replace( '/&quantity=[0-9.]*/', '', $url );
|
2180 |
+
|
2181 |
+
$url .= '&quantity=' . $args['input_value'];
|
2182 |
+
}
|
2183 |
+
}
|
2184 |
+
|
2185 |
+
return $url;
|
2186 |
+
}
|
2187 |
+
|
2188 |
+
add_filter( 'tinvwl_product_add_to_cart_redirect_slug_original', 'tinv_wishlist_qty_woo_advanced_url', 10, 2 );
|
2189 |
+
add_filter( 'tinvwl_product_add_to_cart_redirect_url_original', 'tinv_wishlist_qty_woo_advanced_url', 10, 2 );
|
2190 |
+
add_filter( 'tinvwl_product_add_to_cart_redirect_url', 'tinv_wishlist_qty_woo_advanced_url', 10, 2 );
|
2191 |
+
}
|
tinv-wishlists-function.php
CHANGED
@@ -433,13 +433,13 @@ if ( ! function_exists( 'tinv_wishlist_status' ) ) {
|
|
433 |
/**
|
434 |
* Check status free or premium plugin and disable free
|
435 |
*
|
436 |
-
* @global string $status
|
437 |
-
* @global string $page
|
438 |
-
* @global string $s
|
439 |
-
*
|
440 |
* @param string $transient Plugin transient name.
|
441 |
*
|
442 |
* @return string
|
|
|
|
|
|
|
|
|
443 |
*/
|
444 |
function tinv_wishlist_status( $transient ) {
|
445 |
if ( TINVWL_LOAD_FREE === $transient ) {
|
@@ -622,8 +622,8 @@ if ( ! function_exists( 'tinvwl_add_to_cart_need_redirect' ) ) {
|
|
622 |
'add-to-cart' => ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $_product->get_id() : ( $_product->is_type( 'variation' ) ? $_product->get_parent_id() : $_product->get_id() ) ),
|
623 |
), array_map( 'urlencode', ( version_compare( WC_VERSION, '3.0.0', '<' ) ? ( is_array( $_product->variation_data ) ? $_product->variation_data : array() ) : array() ) ) ) );
|
624 |
|
625 |
-
$need_url = apply_filters( '
|
626 |
-
$need_url_full = apply_filters( '
|
627 |
|
628 |
global $product;
|
629 |
// store global product data.
|
@@ -632,7 +632,7 @@ if ( ! function_exists( 'tinvwl_add_to_cart_need_redirect' ) ) {
|
|
632 |
$product = $_product;
|
633 |
|
634 |
add_filter( 'clean_url', 'tinvwl_clean_url', 10, 2 );
|
635 |
-
$_redirect_url = apply_filters( '
|
636 |
remove_filter( 'clean_url', 'tinvwl_clean_url', 10 );
|
637 |
|
638 |
// restore global product data.
|
@@ -667,7 +667,7 @@ if ( ! function_exists( 'tinvwl_meta_validate_cart_add' ) ) {
|
|
667 |
|
668 |
$wl_product = apply_filters( 'tinvwl_addproduct_tocart', $wl_product );
|
669 |
$product_id = apply_filters( 'woocommerce_add_to_cart_product_id', absint( $wl_product['product_id'] ) );
|
670 |
-
$quantity = empty( $
|
671 |
$variation_id = $wl_product['variation_id'];
|
672 |
$variations = ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->variation_data : ( $product->is_type( 'variation' ) ? wc_get_product_variation_attributes( $product->get_id() ) : array() ) );
|
673 |
$passed_validation = $product->is_purchasable() && ( $product->is_in_stock() || $product->backorders_allowed() ) && 'external' !== ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->product_type : $product->get_type() );
|
433 |
/**
|
434 |
* Check status free or premium plugin and disable free
|
435 |
*
|
|
|
|
|
|
|
|
|
436 |
* @param string $transient Plugin transient name.
|
437 |
*
|
438 |
* @return string
|
439 |
+
* @global string $s
|
440 |
+
*
|
441 |
+
* @global string $status
|
442 |
+
* @global string $page
|
443 |
*/
|
444 |
function tinv_wishlist_status( $transient ) {
|
445 |
if ( TINVWL_LOAD_FREE === $transient ) {
|
622 |
'add-to-cart' => ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $_product->get_id() : ( $_product->is_type( 'variation' ) ? $_product->get_parent_id() : $_product->get_id() ) ),
|
623 |
), array_map( 'urlencode', ( version_compare( WC_VERSION, '3.0.0', '<' ) ? ( is_array( $_product->variation_data ) ? $_product->variation_data : array() ) : array() ) ) ) );
|
624 |
|
625 |
+
$need_url = apply_filters( 'tinvwl_product_add_to_cart_redirect_slug_original', remove_query_arg( 'added-to-cart', add_query_arg( $need_url_data ) ), $_product );
|
626 |
+
$need_url_full = apply_filters( 'tinvwl_product_add_to_cart_redirect_url_original', remove_query_arg( 'added-to-cart', add_query_arg( $need_url_data, $_product->get_permalink() ) ), $_product );
|
627 |
|
628 |
global $product;
|
629 |
// store global product data.
|
632 |
$product = $_product;
|
633 |
|
634 |
add_filter( 'clean_url', 'tinvwl_clean_url', 10, 2 );
|
635 |
+
$_redirect_url = apply_filters( 'tinvwl_product_add_to_cart_redirect_url', $_product->add_to_cart_url(), $_product );
|
636 |
remove_filter( 'clean_url', 'tinvwl_clean_url', 10 );
|
637 |
|
638 |
// restore global product data.
|
667 |
|
668 |
$wl_product = apply_filters( 'tinvwl_addproduct_tocart', $wl_product );
|
669 |
$product_id = apply_filters( 'woocommerce_add_to_cart_product_id', absint( $wl_product['product_id'] ) );
|
670 |
+
$quantity = empty( $wl_product['quantity'] ) ? 1 : wc_stock_amount( $wl_product['quantity'] );
|
671 |
$variation_id = $wl_product['variation_id'];
|
672 |
$variations = ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->variation_data : ( $product->is_type( 'variation' ) ? wc_get_product_variation_attributes( $product->get_id() ) : array() ) );
|
673 |
$passed_validation = $product->is_purchasable() && ( $product->is_in_stock() || $product->backorders_allowed() ) && 'external' !== ( version_compare( WC_VERSION, '3.0.0', '<' ) ? $product->product_type : $product->get_type() );
|