From 37adf74d4d34e21882da3e0671f0bc21eaa3d526 Mon Sep 17 00:00:00 2001 From: Sisir K Adhikari Date: Sat, 9 Jan 2021 13:29:01 +0600 Subject: [PATCH 1/3] added get_data() function --- includes/class.yith-wcwl-wishlist.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/includes/class.yith-wcwl-wishlist.php b/includes/class.yith-wcwl-wishlist.php index c83c7c1..f631fd5 100644 --- a/includes/class.yith-wcwl-wishlist.php +++ b/includes/class.yith-wcwl-wishlist.php @@ -209,6 +209,31 @@ public function current_user_can( $capability = 'view', $current_user = false ) /* === GETTERS === */ + /** + * Returns all data for this wishlist. + * + * @return array + */ + public function get_data() { + $products = $this->get_items(); + + $arr = array(); + if( ! empty( $products ) ) { + foreach( $products as $product ) { + $prod = $product->get_data(); + + if( ! $prod['product_id'] ) { + continue; + } + + $prod['product'] = wc_get_product( $prod['product_id'] )->get_data(); + $arr[] = $prod; + } + } + + return array_merge( $this->data, array('id' => $this->get_id(), 'token' => $this->get_token() ), array( 'products' => $arr ) ); + } + /** * Get wishlist token * From dae02e01b094a859f573e8ef469fa7d44d1cf116 Mon Sep 17 00:00:00 2001 From: "Sisir K. Adhikari" Date: Fri, 3 Sep 2021 15:55:08 +0600 Subject: [PATCH 2/3] plugin header update --- init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.php b/init.php index 84d9625..2009d5b 100644 --- a/init.php +++ b/init.php @@ -2,9 +2,9 @@ /** * 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 + * Description: Modified by Prionkor for REST API support.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.25 - * Author: YITH + * Author: YITH & Prionkor * Author URI: https://yithemes.com/ * Text Domain: yith-woocommerce-wishlist * Domain Path: /languages/ From 462b9a40be91fdb8a5038cbcf6eeabf12d909e03 Mon Sep 17 00:00:00 2001 From: "Sisir K. Adhikari" Date: Fri, 3 Sep 2021 15:55:58 +0600 Subject: [PATCH 3/3] Change plugin name --- init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.php b/init.php index 2009d5b..91394cf 100644 --- a/init.php +++ b/init.php @@ -1,6 +1,6 @@ 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.25