From 5506da03607508d6bea55f03e2627ded5d645b09 Mon Sep 17 00:00:00 2001 From: alarocca130 Date: Thu, 27 Feb 2020 12:11:38 +0100 Subject: [PATCH] VERSION 3.0.5 --- README.md | 14 ++++---------- README.txt | 11 +++++++++-- includes/class.yith-wcwl-frontend.php | 4 ++-- includes/class.yith-wcwl-wishlist-item.php | 11 ++++++++++- .../class.yith-wcwl-wishlist-item-data-store.php | 4 ++-- init.php | 4 ++-- 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 57043af..546e397 100644 --- a/README.md +++ b/README.md @@ -72,18 +72,12 @@ We're also working hard to release a developer guide; please, follow our [social ## Changelog -### 3.0.4 - Released on 19 December 2019 +### 3.0.5 - Released on 23 December 2019 = -* Tweak: added isset on wishlist data store, to prevent notice -* Tweak: removed transients for items count, to avoid load on wp-options table -* Tweak: improved dependencies animation -* Tweak: restored $atts variable inside template, for better compatibility with themes -* Tweak: handling for redirect_to param in $_REQUEST for form-handler class +* New: support for WooCommerce 3.9 * Update: plugin framework -* Fix: default variation not being added to wishlist -* Fix: add default variation to wishlist when Ajax loading is enabled -* Fix: count_all_products not retrieving correct number -* Dev: added yith_wcwl_wishlist_delete_url filter +* Tweak: register original product id instead of translated one, when saving item in DB +* Fix: customer not being redirected to cart after clicking Add to Cart button in wishlist ## Support diff --git a/README.txt b/README.txt index 1399c86..7314194 100644 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ Contributors: yithemes Tags: wishlist, woocommerce, products, yit, e-commerce, shop, ecommerce wishlist, yith, woocommerce wishlist, shop wishlist Requires at least: 4.0 Tested up to: 5.3 -Stable tag: 3.0.4 +Stable tag: 3.0.5 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -94,7 +94,7 @@ Try to regenerate permalinks from Settings -> Permalinks by simply saving them a This might depend on the fact that your theme overrides plugin templates. Check if the developer of your theme has released a compatibility update with version 3.0 or later of YITH WooCommerce Wishlist. As an alternative you can try the plugin in WordPress default theme to leave out any possible influences by the theme. = I am currently using Wishlist plugin with Catalog Mode enabled in my site. Prices for products should disappear, yet they still appear in the wishlist page. Can I remove them? = -Yes, of course you can. To avoid Wishlist page to show product prices, you can hide price column from wishlist table. Go to YIT plugins -> wishlist -> settings and disable option "Show Unit price". +Yes, of course you can. To avoid Wishlist page to show product prices, you can hide price column from wishlist table. Go to YITH -> Wishlist -> Wishlist Page Options and disable option "Product price". == Screenshots == @@ -112,6 +112,13 @@ Yes, of course you can. To avoid Wishlist page to show product prices, you can h == Changelog == += 3.0.5 - Released on 23 December 2019 = + +* New: support for WooCommerce 3.9 +* Update: plugin framework +* Tweak: register original product id instead of translated one, when saving item in DB +* Fix: customer not being redirected to cart after clicking Add to Cart button in wishlist + = 3.0.4 - Released on 19 December 2019 = * Tweak: added isset on wishlist data store, to prevent notice diff --git a/includes/class.yith-wcwl-frontend.php b/includes/class.yith-wcwl-frontend.php index c22a516..455a094 100644 --- a/includes/class.yith-wcwl-frontend.php +++ b/includes/class.yith-wcwl-frontend.php @@ -33,7 +33,7 @@ class YITH_WCWL_Frontend { * @var string * @since 1.0.0 */ - public $version = '3.0.4'; + public $version = '3.0.5'; /** * Plugin database version @@ -376,7 +376,7 @@ public function enqueue_scripts() { public function get_localize() { return apply_filters( 'yith_wcwl_localize_script', array( 'ajax_url' => admin_url( 'admin-ajax.php', 'relative' ), - 'redirect_to_cart' => get_option( 'yith_wcwl_redirect_cart' ) == 'yes', + 'redirect_to_cart' => get_option( 'yith_wcwl_redirect_cart' ), 'multi_wishlist' => false, 'hide_add_button' => apply_filters( 'yith_wcwl_hide_add_button', true ), 'enable_ajax_loading' => 'yes' == get_option( 'yith_wcwl_ajax_enable', 'no' ), diff --git a/includes/class.yith-wcwl-wishlist-item.php b/includes/class.yith-wcwl-wishlist-item.php index 03a2746..16bb27d 100644 --- a/includes/class.yith-wcwl-wishlist-item.php +++ b/includes/class.yith-wcwl-wishlist-item.php @@ -110,6 +110,15 @@ public function get_origin_wishlist_id() { return intval( $this->origin_wishlist_id ); } + /** + * Get origin product ID for current item (no WPML filtering) + * + * @return int Wishlist ID + */ + public function get_original_product_id( $context = 'view' ) { + return intval( $this->get_prop( 'product_id', $context ) ); + } + /** * Get product ID for current item * @@ -117,7 +126,7 @@ public function get_origin_wishlist_id() { * @return int Product ID */ public function get_product_id( $context = 'view' ) { - return yit_wpml_object_id( intval( $this->get_prop( 'product_id', $context ) ), 'product', true ); + return yit_wpml_object_id( $this->get_original_product_id( $context ), 'product', true ); } /** diff --git a/includes/data-stores/class.yith-wcwl-wishlist-item-data-store.php b/includes/data-stores/class.yith-wcwl-wishlist-item-data-store.php index 003a169..e8eedcc 100644 --- a/includes/data-stores/class.yith-wcwl-wishlist-item-data-store.php +++ b/includes/data-stores/class.yith-wcwl-wishlist-item-data-store.php @@ -28,7 +28,7 @@ class YITH_WCWL_Wishlist_Item_Data_Store{ public function create( &$item ) { global $wpdb; - if( ! ( $product_id = $item->get_product_id() ) || ! ( $wishlist_id = $item->get_wishlist_id() ) ){ + if( ! ( $product_id = $item->get_original_product_id() ) || ! ( $wishlist_id = $item->get_wishlist_id() ) ){ return; } @@ -152,7 +152,7 @@ public function update( &$item ) { $values = array( $item->get_quantity(), $item->get_wishlist_id(), - $item->get_product_id(), + $item->get_original_product_id(), $item->get_user_id(), $item->get_position(), $item->is_on_sale(), diff --git a/init.php b/init.php index db0ed0d..c5961f3 100644 --- a/init.php +++ b/init.php @@ -3,13 +3,13 @@ * Plugin Name: YITH WooCommerce Wishlist * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-wishlist/ * Description: YITH WooCommerce Wishlist gives your users the possibility to create, fill, manage and share their wishlists allowing you to analyze their interests and needs to improve your marketing strategies. Get more plugins for your e-commerce on YITH - * Version: 3.0.4 + * Version: 3.0.5 * Author: YITH * Author URI: https://yithemes.com/ * Text Domain: yith-woocommerce-wishlist * Domain Path: /languages/ * WC requires at least: 2.5.0 - * WC tested up to: 3.8.0 + * WC tested up to: 3.9.0 * * @author YITHEMES * @package YITH WooCommerce Wishlist