CTX Feed – WooCommerce Product Feed Manager Plugin - Version 3.1.32

Version Description

(2019-10-6) = * Fix parent sku not getting populated in feed data * Set feed type to CSV for Pinterest

Download this release

Release Info

Developer wahid0003
Plugin Icon 128x128 CTX Feed – WooCommerce Product Feed Manager Plugin
Version 3.1.32
Comparing to
See all releases

Code changes from version 3.1.31 to 3.1.32

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://webappick.com
4
  Tags:woocommerce,google product feed,facebook product feed,woocommerce product feed,woocommerce,
5
  Requires at least: 3.6
6
  Tested Up To: 5.2
7
- Stable tag: 3.1.31
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -304,6 +304,10 @@ Using pro version:
304
 
305
  == Changelog ==
306
 
 
 
 
 
307
  = 3.1.31 (2019-10-3) =
308
  * Strip divi builder shortcode from product description and short-description.
309
  * Delete old feed file before regenerate.
4
  Tags:woocommerce,google product feed,facebook product feed,woocommerce product feed,woocommerce,
5
  Requires at least: 3.6
6
  Tested Up To: 5.2
7
+ Stable tag: 3.1.32
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
304
 
305
  == Changelog ==
306
 
307
+ = 3.1.32 (2019-10-6) =
308
+ * Fix parent sku not getting populated in feed data
309
+ * Set feed type to CSV for Pinterest
310
+
311
  = 3.1.31 (2019-10-3) =
312
  * Strip divi builder shortcode from product description and short-description.
313
  * Delete old feed file before regenerate.
admin/class-woo-feed-admin.php CHANGED
@@ -137,14 +137,35 @@ class Woo_Feed_Admin
137
  * class.
138
  */
139
 
140
- if (function_exists('add_options_page')) {
141
-
142
- add_menu_page(__('Woo Feed', 'woo-feed'), __('Woo Feed', 'woo-feed'), 'manage_options', __FILE__, 'woo_feed_generate_feed', 'dashicons-rss');
143
- add_submenu_page(__FILE__, __('Make Feed', 'woo-feed'), __('Make Feed', 'woo-feed'), 'manage_options', __FILE__, 'woo_feed_generate_feed');
144
- add_submenu_page(__FILE__, __('Manage Feeds', 'woo-feed'), __('Manage Feeds', 'woo-feed'), 'manage_options', 'woo_feed_manage_feed', 'woo_feed_manage_feed');
145
- add_submenu_page(__FILE__, __('Settings', 'woo-feed'), __('Settings', 'woo-feed'), 'manage_options', 'woo_feed_config_feed', 'woo_feed_config_feed');
146
- add_submenu_page(__FILE__, __('Premium', 'woo-feed'), __('Premium', 'woo-feed'), 'manage_options', 'woo_feed_pro_vs_free', 'woo_feed_pro_vs_free');
147
  }
148
  }
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  }
137
  * class.
138
  */
139
 
140
+ if ( function_exists('add_options_page') ) {
141
+ add_menu_page( __('Woo Feed', 'woo-feed'), __('Woo Feed', 'woo-feed'), 'manage_woocommerce', 'webappick-manage-feeds', 'woo_feed_manage_feed', 'dashicons-rss' );
142
+ add_submenu_page( 'webappick-manage-feeds', __('Manage Feeds', 'woo-feed'), __('Manage Feeds', 'woo-feed'), 'manage_woocommerce', 'webappick-manage-feeds', 'woo_feed_manage_feed' );
143
+ add_submenu_page( 'webappick-manage-feeds', __('Make Feed', 'woo-feed'), __('Make Feed', 'woo-feed'), 'manage_woocommerce', 'webappick-new-feed', 'woo_feed_generate_feed' );
144
+ add_submenu_page( 'webappick-manage-feeds', __('Settings', 'woo-feed'), __('Settings', 'woo-feed'), 'manage_woocommerce', 'webappick-feed-settings', 'woo_feed_config_feed' );
145
+ add_submenu_page( 'webappick-manage-feeds', __('Premium', 'woo-feed'), __('Premium', 'woo-feed'), 'manage_woocommerce', 'webappick-feed-pro-vs-free', 'woo_feed_pro_vs_free' );
 
146
  }
147
  }
148
 
149
+ /**
150
+ * Redirect user to with new menu slug (if user browser any bookmarked url)
151
+ * @since 3.1.7
152
+ * @return void
153
+ */
154
+ public function handle_old_menu_slugs() {
155
+ global $pagenow;
156
+ // redirect user to new old slug => new slug
157
+ $redirect_to = array(
158
+ 'webappick-product-feed-for-woocommerce/admin/class-woo-feed-admin.php' => 'webappick-new-feed',
159
+ 'woo_feed_manage_feed' => 'webappick-manage-feeds',
160
+ 'woo_feed_config_feed' => 'webappick-feed-settings',
161
+ 'woo_feed_pro_vs_free' => 'webappick-feed-pro-vs-free',
162
+ );
163
+ if( $pagenow === 'admin.php' && isset( $_GET['page'] ) && ! empty( $_GET['page'] ) ) {
164
+ foreach( $redirect_to as $from => $to ) {
165
+ if( $_GET['page'] !== $from ) continue;
166
+ wp_redirect( admin_url( 'admin.php?page=' . $to ), 301 );
167
+ die();
168
+ }
169
+ }
170
+ }
171
  }
admin/js/woo-feed-admin.js CHANGED
@@ -10,6 +10,18 @@
10
  *
11
  * This enables you to define handlers, for when the DOM is ready:
12
  */
 
 
 
 
 
 
 
 
 
 
 
 
13
  $(function () {
14
 
15
  // Template loading ui conflict . Added by Shoroar
@@ -193,9 +205,15 @@
193
  $("#provider").on('change', function ( event ) {
194
  event.preventDefault();
195
  var merchant = $(this).val(), feedType = $("#feedType"), feedForm = $("#providerPage"),
196
- marchants = ["fruugo", "fruugo.au", "vergelijk_comparer", "spartoo.fi", "avantlink"];
197
- if( helper.in_array( merchant, marchants ) ) feedType.val("csv");
198
- else feedType.val("");
 
 
 
 
 
 
199
  feedType.trigger('change');
200
  feedForm.html("<h3>Loading...</h3>");
201
  // Get FeedForm For Selected Provider/Merchant
10
  *
11
  * This enables you to define handlers, for when the DOM is ready:
12
  */
13
+
14
+ /**
15
+ * disable element utility
16
+ * @since 3.1.9
17
+ */
18
+ $.fn.disabled = function( status ) {
19
+ $(this).each( function(){
20
+ $(this).prop( 'disabled', status === void 0 || status === true );
21
+ } );
22
+ return $(this); // method chaining
23
+ };
24
+
25
  $(function () {
26
 
27
  // Template loading ui conflict . Added by Shoroar
205
  $("#provider").on('change', function ( event ) {
206
  event.preventDefault();
207
  var merchant = $(this).val(), feedType = $("#feedType"), feedForm = $("#providerPage"),
208
+ marchants = ["pinterest", "fruugo", "fruugo.au", "vergelijk_comparer", "spartoo.fi", "avantlink"];
209
+ if( helper.in_array( merchant, marchants ) ) {
210
+ feedType.val("csv");
211
+ feedType.find('option').not('[value="csv"]').disabled( true );
212
+ feedType.find('option').not('[value="csv"]').disabled( true );
213
+ } else {
214
+ feedType.val("");
215
+ feedType.find('option').disabled( false );
216
+ }
217
  feedType.trigger('change');
218
  feedForm.html("<h3>Loading...</h3>");
219
  // Get FeedForm For Selected Provider/Merchant
admin/partials/woo-feed-manage-list.php CHANGED
@@ -114,32 +114,6 @@ if(isset($_POST)&& isset($_POST['filename'])){
114
  </div>
115
 
116
  <script type="text/javascript">
117
- jQuery(document).ready(function () {
118
- jQuery('body').find(".single-feed-delete").click(function () {
119
- if (confirm('<?php _e('Are You Sure to Delete ?','woo-feed');?>')) {
120
- var url = jQuery(this).attr('val');
121
- window.location.href = url;
122
- }
123
- });
124
-
125
- jQuery('#doaction').click(function () {
126
- if (confirm('<?php _e('Are You Sure to Delete ?','woo-feed'); ?>'))
127
- return true;
128
- else
129
- return false;
130
- });
131
-
132
- jQuery('#doaction2').click(function () {
133
- if (confirm('<?php _e('Are You Sure to Delete ?','woo-feed'); ?>'))
134
- return true;
135
- else
136
- return false;
137
- });
138
- });
139
- </script>
140
-
141
- <script>
142
-
143
  (function( $ ) {
144
  'use strict';
145
 
@@ -154,14 +128,28 @@ if(isset($_POST)&& isset($_POST['filename'])){
154
  * This enables you to define handlers, for when the DOM is ready:
155
  *
156
  * $(function() {
157
- *
158
- * });
159
  *
160
  * When the window is loaded:
161
  */
162
 
163
  $( window ).load(function() {
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  $(".column-url").css("color", "#008779");
166
  $(".column-url").css("font-weight", "bold");
167
 
@@ -201,7 +189,7 @@ if(isset($_POST)&& isset($_POST['filename'])){
201
  */
202
 
203
  // Variable responsible to hold progress bar width
204
- let width = 10;
205
 
206
  function showFeedProgress(color="#3DC264"){
207
  // Progress br init
114
  </div>
115
 
116
  <script type="text/javascript">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  (function( $ ) {
118
  'use strict';
119
 
128
  * This enables you to define handlers, for when the DOM is ready:
129
  *
130
  * $(function() {
131
+ *
132
+ * });
133
  *
134
  * When the window is loaded:
135
  */
136
 
137
  $( window ).load(function() {
138
 
139
+ $('body').find(".single-feed-delete").click(function () {
140
+ if (confirm('<?php _e('Are You Sure to Delete ?','woo-feed');?>')) {
141
+ var url = jQuery(this).attr('val');
142
+ window.location.href = url;
143
+ }
144
+ });
145
+
146
+ $('#doaction, #doaction2').click(function () {
147
+ if (confirm('<?php _e('Are You Sure to Delete ?','woo-feed'); ?>'))
148
+ return true;
149
+ else
150
+ return false;
151
+ });
152
+
153
  $(".column-url").css("color", "#008779");
154
  $(".column-url").css("font-weight", "bold");
155
 
189
  */
190
 
191
  // Variable responsible to hold progress bar width
192
+ var width = 10;
193
 
194
  function showFeedProgress(color="#3DC264"){
195
  // Progress br init
includes/class-woo-feed.php CHANGED
@@ -232,6 +232,7 @@ class Woo_Feed
232
  $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
233
  $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');
234
  $this->loader->add_action('admin_menu', $plugin_admin, 'load_admin_pages');
 
235
 
236
  }
237
 
232
  $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
233
  $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');
234
  $this->loader->add_action('admin_menu', $plugin_admin, 'load_admin_pages');
235
+ $this->loader->add_action( 'admin_page_access_denied', $plugin_admin, 'handle_old_menu_slugs' );
236
 
237
  }
238
 
includes/classes/class-woo-feed-products.php CHANGED
@@ -111,7 +111,7 @@ class Woo_Feed_Products
111
  * @return array
112
  */
113
 
114
- public function getWC3Products($limit, $offset) {
115
 
116
  $limit = ! empty( $limit ) && is_numeric( $limit ) ? absint( $limit ) : '2000';
117
  $offset = ! empty( $offset ) && is_numeric( $offset ) ? absint( $offset ) : '0';
@@ -208,6 +208,7 @@ class Woo_Feed_Products
208
  $this->productsList[ $this->pi ]['tags'] = $this->getProductTaxonomy($id,"product_tag");
209
  $this->productsList[ $this->pi ]['item_group_id'] = $simple->get_id();
210
  $this->productsList[ $this->pi ]['sku'] = $simple->get_sku();
 
211
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
212
  $this->productsList[ $this->pi ]['quantity'] = $simple->get_stock_quantity();
213
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $simple->get_date_on_sale_from();
@@ -293,6 +294,7 @@ class Woo_Feed_Products
293
  $this->productsList[ $this->pi ]['tags'] = $this->getProductTaxonomy($id,"product_tag");
294
  $this->productsList[ $this->pi ]['item_group_id'] = $external->get_id();
295
  $this->productsList[ $this->pi ]['sku'] = $external->get_sku();
 
296
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
297
  $this->productsList[ $this->pi ]['quantity'] = $external->get_stock_quantity();
298
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $external->get_date_on_sale_from();
@@ -378,6 +380,7 @@ class Woo_Feed_Products
378
  $this->productsList[ $this->pi ]['tags'] = $this->getProductTaxonomy($id,"product_tag");
379
  $this->productsList[ $this->pi ]['item_group_id'] = $grouped->get_id();
380
  $this->productsList[ $this->pi ]['sku'] = $grouped->get_sku();
 
381
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
382
  $this->productsList[ $this->pi ]['quantity'] = $grouped->get_stock_quantity();
383
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $grouped->get_date_on_sale_from();
@@ -463,6 +466,7 @@ class Woo_Feed_Products
463
  $this->productsList[ $this->pi ]['tags'] = $this->getProductTaxonomy($id,"product_tag");
464
  $this->productsList[ $this->pi ]['item_group_id'] = $variable->get_id();
465
  $this->productsList[ $this->pi ]['sku'] = $variable->get_sku();
 
466
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
467
 
468
 
@@ -501,7 +505,8 @@ class Woo_Feed_Products
501
  // $this->productsList[ $this->pi ][$aKey] = $variable->get_attribute($aKey);
502
  // }
503
  // }
504
- }else if ( $prod->is_type( 'variation' )) {
 
505
 
506
  $variation=new WC_Product_Variation($id);
507
 
@@ -589,6 +594,7 @@ class Woo_Feed_Products
589
  $this->productsList[ $this->pi ]['tags'] = $this->getProductTaxonomy($parentId,"product_tag");
590
  $this->productsList[ $this->pi ]['item_group_id'] = $variation->get_parent_id();
591
  $this->productsList[ $this->pi ]['sku'] = $variation->get_sku();
 
592
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
593
  $this->productsList[ $this->pi ]['quantity'] = $variation->get_stock_quantity();
594
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $variation->get_date_on_sale_from();
@@ -695,7 +701,8 @@ class Woo_Feed_Products
695
  if(!is_object($variation)){
696
  continue;
697
  }
698
-
 
699
  # Parent Info
700
  $parentInfo=$variation->get_parent_data();
701
  $variationTitle= $parentInfo['title'];
@@ -761,6 +768,7 @@ class Woo_Feed_Products
761
  $this->productsList[ $this->pi ]['tags'] = strip_tags(wc_get_product_tag_list($id,","));
762
  $this->productsList[ $this->pi ]['item_group_id'] = $variation->get_parent_id();
763
  $this->productsList[ $this->pi ]['sku'] = $variation->get_sku();
 
764
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
765
  $this->productsList[ $this->pi ]['quantity'] = $variation->get_stock_quantity();
766
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $variation->get_date_on_sale_from();
@@ -831,14 +839,13 @@ class Woo_Feed_Products
831
  * @param string $feedRule
832
  * @return array
833
  */
834
- public function woo_feed_get_visible_product($feedRule="")
835
- {
836
  $this->feedRule = $feedRule;
837
  $limit = ! empty( $feedRule['Limit'] ) && is_numeric( $feedRule['Limit'] ) ? absint( $feedRule['Limit'] ) : '2000';
838
  $offset = ! empty( $feedRule['Offset'] ) && is_numeric( $feedRule['Offset'] ) ? absint( $feedRule['Offset'] ) : '0';
839
  # WC 3.1+ Compatibility
840
 
841
- if ( woo_feed_wc_version_check(3.1) ) {
842
 
843
  return $this->getWC3Products( $limit, $offset);
844
 
111
  * @return array
112
  */
113
 
114
+ public function getWC3Products( $limit, $offset ) {
115
 
116
  $limit = ! empty( $limit ) && is_numeric( $limit ) ? absint( $limit ) : '2000';
117
  $offset = ! empty( $offset ) && is_numeric( $offset ) ? absint( $offset ) : '0';
208
  $this->productsList[ $this->pi ]['tags'] = $this->getProductTaxonomy($id,"product_tag");
209
  $this->productsList[ $this->pi ]['item_group_id'] = $simple->get_id();
210
  $this->productsList[ $this->pi ]['sku'] = $simple->get_sku();
211
+ $this->productsList[ $this->pi ]['parent_sku'] = $simple->get_sku();
212
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
213
  $this->productsList[ $this->pi ]['quantity'] = $simple->get_stock_quantity();
214
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $simple->get_date_on_sale_from();
294
  $this->productsList[ $this->pi ]['tags'] = $this->getProductTaxonomy($id,"product_tag");
295
  $this->productsList[ $this->pi ]['item_group_id'] = $external->get_id();
296
  $this->productsList[ $this->pi ]['sku'] = $external->get_sku();
297
+ $this->productsList[ $this->pi ]['parent_sku'] = $external->get_sku();
298
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
299
  $this->productsList[ $this->pi ]['quantity'] = $external->get_stock_quantity();
300
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $external->get_date_on_sale_from();
380
  $this->productsList[ $this->pi ]['tags'] = $this->getProductTaxonomy($id,"product_tag");
381
  $this->productsList[ $this->pi ]['item_group_id'] = $grouped->get_id();
382
  $this->productsList[ $this->pi ]['sku'] = $grouped->get_sku();
383
+ $this->productsList[ $this->pi ]['parent_sku'] = $grouped->get_sku();
384
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
385
  $this->productsList[ $this->pi ]['quantity'] = $grouped->get_stock_quantity();
386
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $grouped->get_date_on_sale_from();
466
  $this->productsList[ $this->pi ]['tags'] = $this->getProductTaxonomy($id,"product_tag");
467
  $this->productsList[ $this->pi ]['item_group_id'] = $variable->get_id();
468
  $this->productsList[ $this->pi ]['sku'] = $variable->get_sku();
469
+ $this->productsList[ $this->pi ]['parent_sku'] = $variable->get_sku();
470
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
471
 
472
 
505
  // $this->productsList[ $this->pi ][$aKey] = $variable->get_attribute($aKey);
506
  // }
507
  // }
508
+ }
509
+ else if ( $prod->is_type( 'variation' )) {
510
 
511
  $variation=new WC_Product_Variation($id);
512
 
594
  $this->productsList[ $this->pi ]['tags'] = $this->getProductTaxonomy($parentId,"product_tag");
595
  $this->productsList[ $this->pi ]['item_group_id'] = $variation->get_parent_id();
596
  $this->productsList[ $this->pi ]['sku'] = $variation->get_sku();
597
+ $this->productsList[ $this->pi ]['parent_sku'] = $parent->get_sku();
598
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
599
  $this->productsList[ $this->pi ]['quantity'] = $variation->get_stock_quantity();
600
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $variation->get_date_on_sale_from();
701
  if(!is_object($variation)){
702
  continue;
703
  }
704
+ $parentId=$variation->get_parent_id();
705
+ $parent=new WC_Product_Variable($parentId);
706
  # Parent Info
707
  $parentInfo=$variation->get_parent_data();
708
  $variationTitle= $parentInfo['title'];
768
  $this->productsList[ $this->pi ]['tags'] = strip_tags(wc_get_product_tag_list($id,","));
769
  $this->productsList[ $this->pi ]['item_group_id'] = $variation->get_parent_id();
770
  $this->productsList[ $this->pi ]['sku'] = $variation->get_sku();
771
+ $this->productsList[ $this->pi ]['parent_sku'] = $parent->get_sku();
772
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
773
  $this->productsList[ $this->pi ]['quantity'] = $variation->get_stock_quantity();
774
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $variation->get_date_on_sale_from();
839
  * @param string $feedRule
840
  * @return array
841
  */
842
+ public function woo_feed_get_visible_product( $feedRule = "" ) {
 
843
  $this->feedRule = $feedRule;
844
  $limit = ! empty( $feedRule['Limit'] ) && is_numeric( $feedRule['Limit'] ) ? absint( $feedRule['Limit'] ) : '2000';
845
  $offset = ! empty( $feedRule['Offset'] ) && is_numeric( $feedRule['Offset'] ) ? absint( $feedRule['Offset'] ) : '0';
846
  # WC 3.1+ Compatibility
847
 
848
+ if ( woo_feed_wc_version_check(3.1 ) ) {
849
 
850
  return $this->getWC3Products( $limit, $offset);
851
 
woo-feed.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * The plugin bootstrap file
5
  *
@@ -16,7 +15,7 @@
16
  * Plugin Name: WooCommerce Product Feed
17
  * Plugin URI: https://webappick.com/
18
  * Description: This plugin generate WooCommerce product feed for Shopping Engines like Google Shopping,Facebook Product Feed,eBay,Amazon,Idealo and many more..
19
- * Version: 3.1.31
20
  * Author: WebAppick
21
  * Author URI: https://webappick.com/
22
  * License: GPL v2
@@ -36,7 +35,7 @@ if (!defined('ABSPATH')) {
36
  exit;
37
  }
38
 
39
- define( 'WOO_FEED_VERSION', '3.1.31' );
40
 
41
  /**
42
  * Plugin Path with trailing slash
1
  <?php
 
2
  /**
3
  * The plugin bootstrap file
4
  *
15
  * Plugin Name: WooCommerce Product Feed
16
  * Plugin URI: https://webappick.com/
17
  * Description: This plugin generate WooCommerce product feed for Shopping Engines like Google Shopping,Facebook Product Feed,eBay,Amazon,Idealo and many more..
18
+ * Version: 3.1.32
19
  * Author: WebAppick
20
  * Author URI: https://webappick.com/
21
  * License: GPL v2
35
  exit;
36
  }
37
 
38
+ define( 'WOO_FEED_VERSION', '3.1.32' );
39
 
40
  /**
41
  * Plugin Path with trailing slash