Version Description
(2021-06-13) = * Fixed: Identifier values missing issue fixed.
Download this release
Release Info
Developer | wahid0003 |
Plugin | CTX Feed – WooCommerce Product Feed Manager Plugin |
Version | 4.3.99 |
Comparing to | |
See all releases |
Code changes from version 4.3.98 to 4.3.99
- README.txt +4 -1
- includes/classes/class-woo-feed-products-v3.php +3 -0
- includes/helper.php +81 -49
- woo-feed.php +2 -2
README.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: Product Feed, WooCommerce, Google Shopping, Google Merchant, Facebook Cata
|
|
5 |
Requires at least: 3.6
|
6 |
Tested Up To: 5.7
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 4.3.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -501,6 +501,9 @@ Using pro version:
|
|
501 |
|
502 |
== Changelog ==
|
503 |
|
|
|
|
|
|
|
504 |
= 4.3.98 (2021-06-10) =
|
505 |
* Fixed: Identifier for variation not working issue fixed.
|
506 |
|
5 |
Requires at least: 3.6
|
6 |
Tested Up To: 5.7
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 4.3.99
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
501 |
|
502 |
== Changelog ==
|
503 |
|
504 |
+
= 4.3.99 (2021-06-13) =
|
505 |
+
* Fixed: Identifier values missing issue fixed.
|
506 |
+
|
507 |
= 4.3.98 (2021-06-10) =
|
508 |
* Fixed: Identifier for variation not working issue fixed.
|
509 |
|
includes/classes/class-woo-feed-products-v3.php
CHANGED
@@ -3197,6 +3197,9 @@ class Woo_Feed_Products_v3
|
|
3197 |
if ( $product->is_type( 'variation' ) ) {
|
3198 |
$meta = $field.'_var';
|
3199 |
}
|
|
|
|
|
|
|
3200 |
return $this->getProductMeta( $product, $meta );
|
3201 |
}
|
3202 |
|
3197 |
if ( $product->is_type( 'variation' ) ) {
|
3198 |
$meta = $field.'_var';
|
3199 |
}
|
3200 |
+
|
3201 |
+
$meta = apply_filters('woo_feed_custom_field_meta', $meta, $product, $field);
|
3202 |
+
|
3203 |
return $this->getProductMeta( $product, $meta );
|
3204 |
}
|
3205 |
|
includes/helper.php
CHANGED
@@ -2710,13 +2710,21 @@ if ( ! function_exists('woo_feed_add_custom_identifier') ) {
|
|
2710 |
if ( ! empty( $custom_identifier ) ) {
|
2711 |
echo sprintf('<h4 class="%s" style="padding-left: 10px;color: black;">%s</h4>', esc_attr('woo-feed-option-title'), esc_html__( 'CUSTOM FIELDS by CTX Feed', 'woo-feed' ) );
|
2712 |
foreach ( $custom_identifier as $key => $value ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2713 |
$custom_field_id = esc_attr( wp_unslash( "woo_feed_identifier_{$key}" ) );
|
2714 |
$custom_field_label = esc_attr( wp_unslash( $custom_fields[ $key ][0] ) );
|
2715 |
$custom_field_description = __( 'Set product ', 'woo-feed' ) . esc_html( $custom_field_label ) . __( ' here.', 'woo-feed');
|
2716 |
woocommerce_wp_text_input(
|
2717 |
array(
|
2718 |
'id' => $custom_field_id,
|
2719 |
-
'value' => esc_attr( wp_unslash( get_post_meta( get_the_ID(), $
|
2720 |
'placeholder' => $custom_field_label,
|
2721 |
'label' => $custom_field_label,
|
2722 |
'desc_tip' => true,
|
@@ -2778,34 +2786,6 @@ if ( ! function_exists('woo_feed_add_custom_identifier_for_variation') ) {
|
|
2778 |
$settings = woo_feed_get_options( 'all' );
|
2779 |
if ( isset($settings['disable_mpn']) && "enable" === $settings['disable_mpn'] ) {
|
2780 |
echo '<div class="woo-feed-variation-options">';
|
2781 |
-
?>
|
2782 |
-
<style>
|
2783 |
-
.woo-feed-variation-options {
|
2784 |
-
border-top: 1px solid #ccc;
|
2785 |
-
margin-top: 20px;
|
2786 |
-
}
|
2787 |
-
.woo-feed-variation-options h4 {
|
2788 |
-
margin-bottom: 0;
|
2789 |
-
}
|
2790 |
-
.woo-feed-variation-options .form-field input[type="text"] {
|
2791 |
-
width: 100%;
|
2792 |
-
padding: 5px;
|
2793 |
-
}
|
2794 |
-
.woo-feed-variation-items {
|
2795 |
-
display: flex;
|
2796 |
-
flex-wrap: wrap;
|
2797 |
-
}
|
2798 |
-
.woo-feed-variation-items p {
|
2799 |
-
width: 33.33%;
|
2800 |
-
padding: 0 10px;
|
2801 |
-
box-sizing: border-box;
|
2802 |
-
}
|
2803 |
-
.woo-feed-variation-items p:first-child,.woo-feed-variation-items p:last-child {
|
2804 |
-
padding: 0;
|
2805 |
-
}
|
2806 |
-
</style>
|
2807 |
-
<?php
|
2808 |
-
|
2809 |
$custom_fields = woo_feed_product_custom_fields();
|
2810 |
$custom_identifier_filter = new Woo_Feed_Custom_Identifier_Filter( $custom_fields );
|
2811 |
$custom_identifier = iterator_to_array( $custom_identifier_filter );
|
@@ -2818,8 +2798,16 @@ if ( ! function_exists('woo_feed_add_custom_identifier_for_variation') ) {
|
|
2818 |
foreach ( $custom_identifier as $key => $value ) {
|
2819 |
$custom_field_id = sprintf( 'woo_feed_identifier_%s_var[%d]', strtolower( $key ), $variation->ID );
|
2820 |
$custom_field_label = isset( $value[0] ) ? $value[0] : '';
|
2821 |
-
|
2822 |
$custom_field_description = sprintf( 'Set product %s here.', $custom_field_label );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2823 |
woocommerce_wp_text_input(
|
2824 |
array(
|
2825 |
'id' => $custom_field_id,
|
@@ -3067,6 +3055,27 @@ if ( ! function_exists( 'woo_feed_clear_cache_data' ) ) {
|
|
3067 |
}
|
3068 |
add_action( 'wp_ajax_clear_cache_data', 'woo_feed_clear_cache_data' );
|
3069 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3070 |
if ( ! function_exists('woo_feed_get_terms_list_hierarchical_order') ) {
|
3071 |
/**
|
3072 |
* Get product terms list by hierarchical order.
|
@@ -3078,31 +3087,19 @@ if ( ! function_exists('woo_feed_get_terms_list_hierarchical_order') ) {
|
|
3078 |
* @since 4.2.1
|
3079 |
*/
|
3080 |
function woo_feed_get_terms_list_hierarchical_order( $id, $full_path = true, $taxonomy = 'product_cat' ) {
|
3081 |
-
$terms = get_the_terms($id, $taxonomy);
|
3082 |
|
3083 |
-
|
3084 |
-
foreach ( $terms as $key => $term ) {
|
3085 |
|
3086 |
-
|
3087 |
|
3088 |
-
|
3089 |
-
|
3090 |
-
|
3091 |
-
|
3092 |
-
$terms[] = $parent_term;
|
3093 |
-
}
|
3094 |
-
}
|
3095 |
-
|
3096 |
-
$terms[] = $term;
|
3097 |
-
unset($terms[ $key ]);
|
3098 |
-
}
|
3099 |
}
|
3100 |
|
3101 |
-
|
3102 |
-
$product_terms_names = wp_list_pluck( $terms, 'name' );
|
3103 |
|
3104 |
-
return implode(">", $product_terms_names);
|
3105 |
-
} // end if terms
|
3106 |
return false;
|
3107 |
}
|
3108 |
}
|
@@ -4602,5 +4599,40 @@ if ( ! function_exists('woo_feed_array_splice_preserve_keys') ) {
|
|
4602 |
}
|
4603 |
}
|
4604 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4605 |
|
4606 |
// End of file helper.php.
|
2710 |
if ( ! empty( $custom_identifier ) ) {
|
2711 |
echo sprintf('<h4 class="%s" style="padding-left: 10px;color: black;">%s</h4>', esc_attr('woo-feed-option-title'), esc_html__( 'CUSTOM FIELDS by CTX Feed', 'woo-feed' ) );
|
2712 |
foreach ( $custom_identifier as $key => $value ) {
|
2713 |
+
|
2714 |
+
//identifier meta value for old and new version users
|
2715 |
+
if ( metadata_exists( 'post', get_the_ID(), 'woo_feed_'.strtolower( $key ) ) ) {
|
2716 |
+
$custom_field_key = sprintf( 'woo_feed_%s', strtolower( $key ) );
|
2717 |
+
} else {
|
2718 |
+
$custom_field_key = sprintf( 'woo_feed_identifier_%s', strtolower( $key ) );
|
2719 |
+
}
|
2720 |
+
|
2721 |
$custom_field_id = esc_attr( wp_unslash( "woo_feed_identifier_{$key}" ) );
|
2722 |
$custom_field_label = esc_attr( wp_unslash( $custom_fields[ $key ][0] ) );
|
2723 |
$custom_field_description = __( 'Set product ', 'woo-feed' ) . esc_html( $custom_field_label ) . __( ' here.', 'woo-feed');
|
2724 |
woocommerce_wp_text_input(
|
2725 |
array(
|
2726 |
'id' => $custom_field_id,
|
2727 |
+
'value' => esc_attr( wp_unslash( get_post_meta( get_the_ID(), $custom_field_key, true ) ) ),
|
2728 |
'placeholder' => $custom_field_label,
|
2729 |
'label' => $custom_field_label,
|
2730 |
'desc_tip' => true,
|
2786 |
$settings = woo_feed_get_options( 'all' );
|
2787 |
if ( isset($settings['disable_mpn']) && "enable" === $settings['disable_mpn'] ) {
|
2788 |
echo '<div class="woo-feed-variation-options">';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2789 |
$custom_fields = woo_feed_product_custom_fields();
|
2790 |
$custom_identifier_filter = new Woo_Feed_Custom_Identifier_Filter( $custom_fields );
|
2791 |
$custom_identifier = iterator_to_array( $custom_identifier_filter );
|
2798 |
foreach ( $custom_identifier as $key => $value ) {
|
2799 |
$custom_field_id = sprintf( 'woo_feed_identifier_%s_var[%d]', strtolower( $key ), $variation->ID );
|
2800 |
$custom_field_label = isset( $value[0] ) ? $value[0] : '';
|
2801 |
+
|
2802 |
$custom_field_description = sprintf( 'Set product %s here.', $custom_field_label );
|
2803 |
+
|
2804 |
+
//identifier meta value for old and new version users
|
2805 |
+
if ( metadata_exists( 'post', $variation->ID, 'woo_feed_'.strtolower( $key ).'_var' ) ) {
|
2806 |
+
$custom_field_key = sprintf( 'woo_feed_%s_var', strtolower( $key ) );
|
2807 |
+
} else {
|
2808 |
+
$custom_field_key = sprintf( 'woo_feed_identifier_%s_var', strtolower( $key ) );
|
2809 |
+
}
|
2810 |
+
|
2811 |
woocommerce_wp_text_input(
|
2812 |
array(
|
2813 |
'id' => $custom_field_id,
|
3055 |
}
|
3056 |
add_action( 'wp_ajax_clear_cache_data', 'woo_feed_clear_cache_data' );
|
3057 |
|
3058 |
+
if( !function_exists('woo_feed_deep_term')){
|
3059 |
+
|
3060 |
+
/**
|
3061 |
+
* Get product terms list by hierarchical order.
|
3062 |
+
*
|
3063 |
+
* @param object $term product term object
|
3064 |
+
* @return string
|
3065 |
+
* @since 4.3.88+
|
3066 |
+
*/
|
3067 |
+
function woo_feed_deep_term( $term, $taxonomy ){
|
3068 |
+
|
3069 |
+
if($term->parent === 0)
|
3070 |
+
return $term->name;
|
3071 |
+
|
3072 |
+
$parent_term = get_term_by('term_id', $term->parent, $taxonomy);
|
3073 |
+
|
3074 |
+
return woo_feed_deep_term($parent_term, $taxonomy) . ' > ' . $term->name ;
|
3075 |
+
}
|
3076 |
+
|
3077 |
+
}
|
3078 |
+
|
3079 |
if ( ! function_exists('woo_feed_get_terms_list_hierarchical_order') ) {
|
3080 |
/**
|
3081 |
* Get product terms list by hierarchical order.
|
3087 |
* @since 4.2.1
|
3088 |
*/
|
3089 |
function woo_feed_get_terms_list_hierarchical_order( $id, $full_path = true, $taxonomy = 'product_cat' ) {
|
|
|
3090 |
|
3091 |
+
$terms = get_the_terms($id, $taxonomy);
|
|
|
3092 |
|
3093 |
+
if( count($terms) ){
|
3094 |
|
3095 |
+
if( $full_path ){
|
3096 |
+
return woo_feed_deep_term($terms[count($terms) - 1], $taxonomy);
|
3097 |
+
}else{
|
3098 |
+
return $terms[count($terms) - 1]->name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3099 |
}
|
3100 |
|
3101 |
+
}
|
|
|
3102 |
|
|
|
|
|
3103 |
return false;
|
3104 |
}
|
3105 |
}
|
4599 |
}
|
4600 |
}
|
4601 |
|
4602 |
+
if( ! function_exists('woo_feed_custom_field_meta_filter') ) {
|
4603 |
+
/**
|
4604 |
+
* Identifier meta value filter for old and new version users
|
4605 |
+
*
|
4606 |
+
* @param $meta string Default Meta
|
4607 |
+
* @param WC_Product $product
|
4608 |
+
* @param $field string Meta field
|
4609 |
+
* @since 4.3.99
|
4610 |
+
*
|
4611 |
+
* @return string Custom Field Meta.
|
4612 |
+
*/
|
4613 |
+
function woo_feed_custom_field_meta_filter($meta, $product, $field) {
|
4614 |
+
$id = $product->get_id();
|
4615 |
+
|
4616 |
+
//identifier meta value for old and new version users
|
4617 |
+
if( false !== strpos($meta, 'woo_feed_identifier_') ) {
|
4618 |
+
|
4619 |
+
$identifier = str_replace('woo_feed_identifier_', '', $meta);
|
4620 |
+
if ( metadata_exists( 'post', $id, 'woo_feed_'.$identifier ) ) {
|
4621 |
+
$meta = 'woo_feed_'.$identifier;
|
4622 |
+
} else {
|
4623 |
+
$meta = 'woo_feed_identifier_'.$identifier;
|
4624 |
+
}
|
4625 |
+
|
4626 |
+
if ( $product->is_type( 'variation' ) ) {
|
4627 |
+
$meta = $meta.'_var';
|
4628 |
+
}
|
4629 |
+
|
4630 |
+
}
|
4631 |
+
|
4632 |
+
return $meta;
|
4633 |
+
}
|
4634 |
+
add_filter('woo_feed_custom_field_meta', 'woo_feed_custom_field_meta_filter', 3, 10);
|
4635 |
+
}
|
4636 |
+
|
4637 |
|
4638 |
// End of file helper.php.
|
woo-feed.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* Plugin Name: CTX Feed
|
11 |
* Plugin URI: https://webappick.com/
|
12 |
* Description: Easily generate woocommerce product feed for any marketing channel like Google Shopping(Merchant), Facebook Remarketing, Bing, eBay & more. Support 100+ Merchants.
|
13 |
-
* Version: 4.3.
|
14 |
* Author: WebAppick
|
15 |
* Author URI: https://webappick.com/
|
16 |
* License: GPL v2
|
@@ -39,7 +39,7 @@ if ( ! defined( 'WOO_FEED_FREE_VERSION' ) ) {
|
|
39 |
* @var string
|
40 |
* @since 3.1.6
|
41 |
*/
|
42 |
-
define( 'WOO_FEED_FREE_VERSION', '4.3.
|
43 |
}
|
44 |
|
45 |
if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {
|
10 |
* Plugin Name: CTX Feed
|
11 |
* Plugin URI: https://webappick.com/
|
12 |
* Description: Easily generate woocommerce product feed for any marketing channel like Google Shopping(Merchant), Facebook Remarketing, Bing, eBay & more. Support 100+ Merchants.
|
13 |
+
* Version: 4.3.99
|
14 |
* Author: WebAppick
|
15 |
* Author URI: https://webappick.com/
|
16 |
* License: GPL v2
|
39 |
* @var string
|
40 |
* @since 3.1.6
|
41 |
*/
|
42 |
+
define( 'WOO_FEED_FREE_VERSION', '4.3.99' );
|
43 |
}
|
44 |
|
45 |
if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {
|