CTX Feed – WooCommerce Product Feed Manager Plugin - Version 2.2.8

Version Description

Download this release

Release Info

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

Code changes from version 2.2.7 to 2.2.8

README.txt CHANGED
@@ -270,6 +270,10 @@ Using pro version:
270
 
271
  == Changelog ==
272
 
 
 
 
 
273
  = 2.2.7(2018-03-01) =
274
  * Product query code improved
275
 
270
 
271
  == Changelog ==
272
 
273
+ = 2.2.8(2018-03-14) =
274
+ * Variable product price issue fixed
275
+ * Other minor issues about product are fixed
276
+
277
  = 2.2.7(2018-03-01) =
278
  * Product query code improved
279
 
admin/partials/woo-feed-config.php CHANGED
@@ -23,7 +23,10 @@
23
  <tbody>
24
  <tr>
25
  <td>Product per batch</td>
26
- <td ><input type="text" name="limit" value="<?php echo (get_option('woo_feed_per_batch')?get_option('woo_feed_per_batch'):"200"); ?>"></td>
 
 
 
27
  </tr>
28
  <tr>
29
  <td></td>
23
  <tbody>
24
  <tr>
25
  <td>Product per batch</td>
26
+ <td>
27
+ <input type="text" name="limit" value="<?php echo (get_option('woo_feed_per_batch')?get_option('woo_feed_per_batch'):"200"); ?>">
28
+ <br><span><i>Don't change the value if you are not sure about this. Plugin may fail to make feed. </i></span>
29
+ </td>
30
  </tr>
31
  <tr>
32
  <td></td>
includes/class-woo-feed.php CHANGED
@@ -70,7 +70,7 @@ class Woo_Feed
70
  public function __construct()
71
  {
72
  $this->woo_feed = 'woo-feed';
73
- $this->version = '2.2.7';
74
 
75
  $this->load_dependencies();
76
  $this->set_locale();
70
  public function __construct()
71
  {
72
  $this->woo_feed = 'woo-feed';
73
+ $this->version = '2.2.8';
74
 
75
  $this->load_dependencies();
76
  $this->set_locale();
includes/classes/class-woo-feed-products.php CHANGED
@@ -127,6 +127,8 @@ class Woo_Feed_Products
127
  'status' => 'publish',
128
  'orderby' => 'date',
129
  'order' => 'DESC',
 
 
130
  );
131
 
132
 
@@ -136,14 +138,14 @@ class Woo_Feed_Products
136
  $this->feedRule['is_variations'] = 'n';
137
  }
138
 
139
- // $query = new WC_Product_Query( $arg );
140
- // $products = $query->get_products();
141
 
142
- $products = $this->wooProductQuery($arg);
143
 
144
  $this->pi = 1; # Product Index
145
  foreach ( $products as $key => $productId ) {
146
- $prod=wc_get_product($productId['ID']);
147
 
148
  $id = $prod->get_id();
149
 
@@ -528,19 +530,19 @@ class Woo_Feed_Products
528
  $this->productsList[ $this->pi ]['sku'] = $variable->get_sku();
529
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
530
 
531
- if ( $this->feedRule['variable_price'] == 'first' ) {
532
- $price = $variable->get_regular_price();
533
- $sPrice = $variable->get_sale_price();
534
- } else {
535
- $price = $variable->get_variation_regular_price( $this->feedRule['variable_price'], $variable->is_taxable() );
536
- $sPrice = $variable->get_variation_sale_price( $this->feedRule['variable_price'], $variable->is_taxable() );
537
- }
538
 
539
  $this->productsList[ $this->pi ]['quantity'] = $variable->get_stock_quantity();
540
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $variable->get_date_on_sale_from();
541
  $this->productsList[ $this->pi ]['sale_price_edate'] = $variable->get_date_on_sale_to();
542
- $this->productsList[ $this->pi ]['price'] = $price;
543
- $this->productsList[ $this->pi ]['sale_price'] = $sPrice;
544
  $this->productsList[ $this->pi ]['weight'] = $variable->get_weight();
545
  $this->productsList[ $this->pi ]['width'] = $variable->get_width();
546
  $this->productsList[ $this->pi ]['height'] = $variable->get_height();
@@ -597,7 +599,7 @@ class Woo_Feed_Products
597
  else if ( $prod->is_type( 'variation' ) && $this->feedRule['provider'] != 'facebook') {
598
  $variation=new WC_Product_Variation($id);
599
 
600
- if(!is_object($variation)){
601
  continue;
602
  }
603
 
127
  'status' => 'publish',
128
  'orderby' => 'date',
129
  'order' => 'DESC',
130
+ 'type' => array('variable','variation','simple','grouped','external'),
131
+ 'return' => 'ids',
132
  );
133
 
134
 
138
  $this->feedRule['is_variations'] = 'n';
139
  }
140
 
141
+ $query = new WC_Product_Query( $arg );
142
+ $products = $query->get_products();
143
 
144
+ //$products = $this->wooProductQuery($arg);
145
 
146
  $this->pi = 1; # Product Index
147
  foreach ( $products as $key => $productId ) {
148
+ $prod=wc_get_product($productId);
149
 
150
  $id = $prod->get_id();
151
 
530
  $this->productsList[ $this->pi ]['sku'] = $variable->get_sku();
531
  $this->productsList[ $this->pi ]['availability'] = $this->availability( $id );
532
 
533
+ // if ( $this->feedRule['variable_price'] == 'first' ) {
534
+ // $price = $variable->get_regular_price();
535
+ // $sPrice = $variable->get_sale_price();
536
+ // } else {
537
+ // $price = $variable->get_variation_regular_price( $this->feedRule['variable_price'], $variable->is_taxable() );
538
+ // $sPrice = $variable->get_variation_sale_price( $this->feedRule['variable_price'], $variable->is_taxable() );
539
+ // }
540
 
541
  $this->productsList[ $this->pi ]['quantity'] = $variable->get_stock_quantity();
542
  $this->productsList[ $this->pi ]['sale_price_sdate'] = $variable->get_date_on_sale_from();
543
  $this->productsList[ $this->pi ]['sale_price_edate'] = $variable->get_date_on_sale_to();
544
+ $this->productsList[ $this->pi ]['price'] = $variable->get_variation_regular_price();
545
+ $this->productsList[ $this->pi ]['sale_price'] = $variable->get_variation_sale_price();
546
  $this->productsList[ $this->pi ]['weight'] = $variable->get_weight();
547
  $this->productsList[ $this->pi ]['width'] = $variable->get_width();
548
  $this->productsList[ $this->pi ]['height'] = $variable->get_height();
599
  else if ( $prod->is_type( 'variation' ) && $this->feedRule['provider'] != 'facebook') {
600
  $variation=new WC_Product_Variation($id);
601
 
602
+ if(!is_object($variation) || !$variation->variation_is_visible()){
603
  continue;
604
  }
605
 
woo-feed.php CHANGED
@@ -16,7 +16,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: 2.2.7
20
  * Author: WebAppick
21
  * Author URI: https://webappick.com/
22
  * License: GPL v2
@@ -272,32 +272,33 @@ add_action('wp_ajax_get_product_information', 'woo_feed_get_product_information'
272
  function woo_feed_get_product_information(){
273
  check_ajax_referer('wpf_feed_nonce');
274
 
275
- // if(woo_feed_wc_version_check(3.2)){
276
- // $query=new WC_Product_Query(array(
277
- // 'limit' => -1,
278
- // 'status' => 'publish',
279
- // 'orderby' => 'date',
280
- // 'order' => 'DESC',
281
- // 'return' => 'ids',
282
- // ));
283
- // $products=$query->get_products();
284
- // $totalProducts=count($products);
285
- // }else{
286
- // $products=wp_count_posts('product');
287
- // $variations=wp_count_posts('product_variation');
288
- // $totalProducts=$products->publish + $variations->publish;
289
- // }
290
-
291
- global $wpdb;
292
- $query = "SELECT DISTINCT {$wpdb->prefix}posts.ID
293
- FROM {$wpdb->prefix}posts
294
- LEFT JOIN {$wpdb->prefix}term_relationships ON ({$wpdb->prefix}posts.ID = {$wpdb->prefix}term_relationships.object_id)
295
- LEFT JOIN {$wpdb->prefix}term_taxonomy ON ({$wpdb->prefix}term_relationships.term_taxonomy_id = {$wpdb->prefix}term_taxonomy.term_taxonomy_id)
296
- WHERE {$wpdb->prefix}posts.post_type IN ('product','product_variation') AND {$wpdb->prefix}posts.post_status = 'publish'
297
- ORDER BY ID";
298
- $products = $wpdb->get_results($query, OBJECT );
299
-
300
- $totalProducts=count($products);
 
301
 
302
  $data=array('product'=>$totalProducts);
303
 
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: 2.2.8
20
  * Author: WebAppick
21
  * Author URI: https://webappick.com/
22
  * License: GPL v2
272
  function woo_feed_get_product_information(){
273
  check_ajax_referer('wpf_feed_nonce');
274
 
275
+ if(woo_feed_wc_version_check(3.2)){
276
+ $query=new WC_Product_Query(array(
277
+ 'limit' => -1,
278
+ 'status' => 'publish',
279
+ 'orderby' => 'date',
280
+ 'order' => 'DESC',
281
+ 'type' => array('variable','variation','simple','grouped','external'),
282
+ 'return' => 'ids',
283
+ ));
284
+ $products=$query->get_products();
285
+ $totalProducts=count($products);
286
+ }else{
287
+ $products=wp_count_posts('product');
288
+ $variations=wp_count_posts('product_variation');
289
+ $totalProducts=$products->publish + $variations->publish;
290
+ }
291
+
292
+ // global $wpdb;
293
+ // $query = "SELECT DISTINCT {$wpdb->prefix}posts.ID
294
+ // FROM {$wpdb->prefix}posts
295
+ // LEFT JOIN {$wpdb->prefix}term_relationships ON ({$wpdb->prefix}posts.ID = {$wpdb->prefix}term_relationships.object_id)
296
+ // LEFT JOIN {$wpdb->prefix}term_taxonomy ON ({$wpdb->prefix}term_relationships.term_taxonomy_id = {$wpdb->prefix}term_taxonomy.term_taxonomy_id)
297
+ // WHERE {$wpdb->prefix}posts.post_type IN ('product','product_variation') AND {$wpdb->prefix}posts.post_status = 'publish'
298
+ // ORDER BY ID";
299
+ // $products = $wpdb->get_results($query, OBJECT );
300
+ //
301
+ // $totalProducts=count($products);
302
 
303
  $data=array('product'=>$totalProducts);
304