From 315b45b28f3933debeec7ddb9dedcfe6a85e95eb Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Thu, 4 Feb 2021 17:56:07 +0600 Subject: [PATCH 01/14] working on tree taxonomy --- includes/shortcode.php | 71 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/includes/shortcode.php b/includes/shortcode.php index 26ce61c3..ba57243b 100644 --- a/includes/shortcode.php +++ b/includes/shortcode.php @@ -1039,14 +1039,15 @@ function wpt_texonomy_search_generator( $texonomy_keyword, $temp_number , $searc /** * Need for get_texonomy and get_terms */ - $texonomy_sarch_args = array('hide_empty' => true,'orderby' => 'count','order' => 'DESC'); - + $texonomy_sarch_args = array('hide_empty' => false,'orderby' => 'count','order' => 'DESC'); + $texonomy_sarch_args = apply_filters( 'wpto_taxonomy_query_args', $texonomy_sarch_args, $texonomy_keyword, $temp_number, $selected_taxs ); + $taxonomy_details = get_taxonomy( $texonomy_keyword ); - - if( !$taxonomy_details ){ + + if( ! $taxonomy_details ){ return false; } - $label = apply_filters( 'wpto_searchbox_taxonomy_name', $taxonomy_details->labels->menu_name, $texonomy_keyword, $temp_number );//label; + $label = apply_filters( 'wpto_searchbox_taxonomy_name', $taxonomy_details->labels->menu_name, $texonomy_keyword, $temp_number, $taxonomy_details, $selected_taxs );//label; $label_all_items = $taxonomy_details->labels->all_items; $html .= "
"; $html .= ""; @@ -1056,18 +1057,32 @@ function wpt_texonomy_search_generator( $texonomy_keyword, $temp_number , $searc $html .= ""; From b9b064247585c0046509135d7c3b65c0f1d8cb34 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Thu, 4 Feb 2021 17:56:15 +0600 Subject: [PATCH 02/14] working on tree taxonomy --- includes/shortcode.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/shortcode.php b/includes/shortcode.php index ba57243b..85160a85 100644 --- a/includes/shortcode.php +++ b/includes/shortcode.php @@ -1107,13 +1107,14 @@ function wpt_texonomy_search_generator( $texonomy_keyword, $temp_number , $searc $parents = array(); $parents['parent_term'] = $item->name;//explode('/',$parents); $parents['data'] = explode('/',$parentssss); - var_dump($parents); + // $count = count( $parents ); //var_dump( str_repeat( '-', $count ) ); // $taxo_tree_sepa = apply_filters( 'wpto_taxonomy_tree_separator', '- ', $terms ); // $extra_message = str_repeat( $taxo_tree_sepa, $count ); } + if( ! $item->parent ){ From dd5f3734c674f3fc45b2f7c5d071d788b13edf45 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Sun, 7 Feb 2021 13:13:19 +0600 Subject: [PATCH 03/14] working for tax tree --- admin/tabs/basics.php | 33 +++++++ assets/css/universal.css | 7 ++ assets/js/custom.js | 4 +- includes/functions.php | 195 +++++++++++++++++++++++++++++++++++++++ includes/shortcode.php | 119 ++++++++++-------------- 5 files changed, 288 insertions(+), 70 deletions(-) diff --git a/admin/tabs/basics.php b/admin/tabs/basics.php index 5f09e627..baddec3f 100644 --- a/admin/tabs/basics.php +++ b/admin/tabs/basics.php @@ -93,6 +93,7 @@ function add_mega_menu_items( $items, $args ) { $options_item = esc_html( 'None ', 'wpt' ) . $term_name; $options_item = ""; $options_item = ""; //REmoved Default None Value + $selecteds = isset( $data['terms'][$term_key] ) ? $data['terms'][$term_key] : false; if( is_array( $term_obj ) && count( $term_obj ) > 0 ){ $selected_term_ids = isset( $data['terms'][$term_key] ) ? $data['terms'][$term_key] : false; foreach ( $term_obj as $terms ) { @@ -121,6 +122,38 @@ function add_mega_menu_items( $items, $args ) { } if( !empty( $options_item ) ){ + +/***************************************** + + + $defaults = array( + 'show_option_all' => '', + 'show_option_none' => '', + 'orderby' => 'name', + 'order' => 'ASC', + 'show_count' => 0, + 'hide_empty' => 1, + 'child_of' => 0, + 'exclude' => '', + 'echo' => 1, + 'selected' => $selecteds, + 'hierarchical' => 1,//0, // 1 for Tree format, and 0 for plane format + 'name' => "basics[data][terms][$term_key]",//'cat', + 'id' => 'wpt_term_' . $term_key,//'', + 'class' => "wpt_select2 ua_select wpt_query_terms ua_query_terms_" . $term_key,//'postform', + 'depth' => 0, + 'tab_index' => 0, + 'taxonomy' => $term_key,//'category', + 'hide_if_empty' => false, + 'option_none_value' => -1, + 'value_field' => 'term_id', + 'multiple' => true, + 'data-key' => $term_key, + ); + //Helping from https://wordpress.stackexchange.com/questions/216070/wp-dropdown-categories-with-multiple-select/253403 + wpt_wp_dropdown_categories( $defaults ); + +//***************************************/ ?> ` element should have the HTML5 'required' attribute. + * Default false. + * } + * @return string HTML dropdown list of categories. + */ +function wpt_wp_dropdown_categories( $args = '', $get_taxonomy = false ) { + $defaults = array( + 'show_option_all' => '', + 'show_option_none' => '', + 'orderby' => 'id', + 'order' => 'ASC', + 'show_count' => 0, + 'hide_empty' => 1, + 'child_of' => 0, + 'exclude' => '', + 'echo' => 1, + 'selected' => 0, + 'hierarchical' => 0, + 'name' => 'cat', + 'id' => '', + 'class' => 'postform', + 'depth' => 0, + 'tab_index' => 0, + 'taxonomy' => 'category', + 'hide_if_empty' => false, + 'option_none_value' => -1, + 'value_field' => 'term_id', + 'multiple' => false, + 'data-key' => false, + ); + + $defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0; + + // Back compat. + if ( isset( $args['type'] ) && 'link' === $args['type'] ) { + _deprecated_argument( + __FUNCTION__, + '3.0.0', + sprintf( + /* translators: 1: "type => link", 2: "taxonomy => link_category" */ + __( '%1$s is deprecated. Use %2$s instead.' ), + 'type => link', + 'taxonomy => link_category' + ) + ); + $args['taxonomy'] = 'link_category'; + } + + // Parse incoming $args into an array and merge it with $defaults. + $parsed_args = wp_parse_args( $args, $defaults ); + + $option_none_value = $parsed_args['option_none_value']; + + if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) { + $parsed_args['pad_counts'] = true; + } + + $tab_index = $parsed_args['tab_index']; + + $tab_index_attribute = ''; + if ( (int) $tab_index > 0 ) { + $tab_index_attribute = " tabindex=\"$tab_index\""; + } + + // Avoid clashes with the 'name' param of get_terms(). + $get_terms_args = $parsed_args; + unset( $get_terms_args['name'] ); + $categories = get_terms( $get_terms_args ); + if( is_array( $get_taxonomy ) ){ + $categories = $get_taxonomy; + } + var_dump($categories); + $name = esc_attr( $parsed_args['name'] ); + $class = esc_attr( $parsed_args['class'] ); + $id = $parsed_args['id'] ? esc_attr( $parsed_args['id'] ) : $name; + $multiple = $parsed_args['multiple'] ? 'multiple' : ''; + + $data_key = $parsed_args['data-key'] ? esc_attr( $parsed_args['data-key'] ) : ''; + + if ( ! $parsed_args['hide_if_empty'] || ! empty( $categories ) ) { + $output = "\n"; + } + + /** + * Filters the taxonomy drop-down output. + * + * @since 2.1.0 + * + * @param string $output HTML output. + * @param array $parsed_args Arguments used to build the drop-down. + */ + $output = apply_filters( 'wp_dropdown_cats', $output, $parsed_args ); + + if ( $parsed_args['echo'] ) { + echo $output; + } + + return $output; +} + if( !function_exists( 'wpt_paginate_links' ) ){ diff --git a/includes/shortcode.php b/includes/shortcode.php index 85160a85..ec9b84d7 100644 --- a/includes/shortcode.php +++ b/includes/shortcode.php @@ -1039,108 +1039,89 @@ function wpt_texonomy_search_generator( $texonomy_keyword, $temp_number , $searc /** * Need for get_texonomy and get_terms */ - $texonomy_sarch_args = array('hide_empty' => false,'orderby' => 'count','order' => 'DESC'); - $texonomy_sarch_args = apply_filters( 'wpto_taxonomy_query_args', $texonomy_sarch_args, $texonomy_keyword, $temp_number, $selected_taxs ); - + $texonomy_sarch_args = array('hide_empty' => true,'orderby' => 'count','order' => 'DESC'); + $taxonomy_details = get_taxonomy( $texonomy_keyword ); - - if( ! $taxonomy_details ){ + + if( !$taxonomy_details ){ return false; } - $label = apply_filters( 'wpto_searchbox_taxonomy_name', $taxonomy_details->labels->menu_name, $texonomy_keyword, $temp_number, $taxonomy_details, $selected_taxs );//label; + $label = apply_filters( 'wpto_searchbox_taxonomy_name', $taxonomy_details->labels->menu_name, $texonomy_keyword, $temp_number );//label; $label_all_items = $taxonomy_details->labels->all_items; $html .= "
"; $html .= ""; $multiple_selectable = apply_filters( 'wpto_is_multiple_selectable', true, $texonomy_keyword, $temp_number ) ? 'multiple' : ''; - $html .= ""; + //$html .= ""; + $texonomy_boj = get_terms( $texonomy_keyword, $texonomy_sarch_args ); + var_dump($texonomy_boj); if( count( $texonomy_boj ) > 0 ){ //Search box's Filter Sorting Added at Version 3.1 $customized_texonomy_boj = false; -// $parents = get_term_parents_list($texonomy_boj->term_id,$texonomy_keyword, array( -// 'link' => false, -// 'separator'=> '/', -// 'inclusive'=> false, -// )); -// var_dump($texonomy_sarch_args,$texonomy_keyword,$texonomy_boj); -// var_dump($parents); - if( $selected_taxs && is_array( $selected_taxs ) && count( $selected_taxs ) > 0 ){ foreach( $selected_taxs as $termID ){ - $singleTerm = get_term( $termID ); $name = $singleTerm->name; $customized_texonomy_boj[$name] = $singleTerm; + + foreach( $customized_texonomy_boj as $item ){ + #### $html .= ""; // ({$item->count}) + } + #### $html .= ""; } + + $html .= wpt_wp_dropdown_categories( $defaults ); }else{ foreach( $texonomy_boj as $item ){ - //var_dump($item); $name = $item->name; $customized_texonomy_boj[$name] = $item; } $customized_texonomy_boj = wpt_sorting_array( $customized_texonomy_boj, $config_value['sort_searchbox_filter'] ); + foreach( $customized_texonomy_boj as $item ){ + #### $html .= ""; // ({$item->count}) + } + #### $html .= ""; + + //multiple $multiple_selectable + + $html .= wpt_wp_dropdown_categories( $defaults ); } -// var_dump( $customized_texonomy_boj ); - - $sorted_terms = []; - foreach( $customized_texonomy_boj as $item ){ - //var_dump($item); - $parents = get_term_parents_list($item->term_id,$texonomy_keyword, array( - 'link' => false, - 'separator'=> '/', - 'inclusive'=> false, - )); - //var_dump($item->parent, $item->name ); - $parentssss = rtrim( $parents, '/' ); - - if( ! empty( $parentssss ) ){ - $parents = array(); - $parents['parent_term'] = $item->name;//explode('/',$parents); - $parents['data'] = explode('/',$parentssss); - -// $count = count( $parents ); - //var_dump( str_repeat( '-', $count ) ); -// $taxo_tree_sepa = apply_filters( 'wpto_taxonomy_tree_separator', '- ', $terms ); -// $extra_message = str_repeat( $taxo_tree_sepa, $count ); - } - - - - - if( ! $item->parent ){ -// var_dump($item->name); - $html .= ""; - } - -// $html .= ""; // ({$item->count}) - - - - $depth = count( get_ancestors( $item->term_id, $texonomy_keyword ) ); -// var_dump($depth); - if( ! array_key_exists( $depth, $sorted_terms ) ){ - $sorted_terms[$item->name] = []; - } - $sorted_terms[$item->name]['terms'] = $item->name; - $sorted_terms[$item->name]['depth'] = $depth; - - -// wp_list_categories(); - } -// var_dump($sorted_terms); + } - $html .= ""; + From 68ebd048f50c64f0ad18881880e3558efbe5cdf3 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Sun, 7 Feb 2021 13:43:03 +0600 Subject: [PATCH 04/14] working for tax tree --- includes/functions.php | 5 ++- includes/shortcode.php | 98 ++++++++++++++++++++++++------------------ 2 files changed, 60 insertions(+), 43 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 54fece72..bd92821e 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -493,10 +493,11 @@ function wpt_wp_dropdown_categories( $args = '', $get_taxonomy = false ) { $get_terms_args = $parsed_args; unset( $get_terms_args['name'] ); $categories = get_terms( $get_terms_args ); - if( is_array( $get_taxonomy ) ){ + + if( is_array( $get_taxonomy ) && ! empty( $get_taxonomy ) ){ $categories = $get_taxonomy; } - var_dump($categories); + $name = esc_attr( $parsed_args['name'] ); $class = esc_attr( $parsed_args['class'] ); $id = $parsed_args['id'] ? esc_attr( $parsed_args['id'] ) : $name; diff --git a/includes/shortcode.php b/includes/shortcode.php index ec9b84d7..e80aa053 100644 --- a/includes/shortcode.php +++ b/includes/shortcode.php @@ -1039,7 +1039,7 @@ function wpt_texonomy_search_generator( $texonomy_keyword, $temp_number , $searc /** * Need for get_texonomy and get_terms */ - $texonomy_sarch_args = array('hide_empty' => true,'orderby' => 'count','order' => 'DESC'); + $texonomy_sarch_args = array('hide_empty' => true,'orderby' => 'count','order' => 'ASC'); $taxonomy_details = get_taxonomy( $texonomy_keyword ); @@ -1062,7 +1062,7 @@ function wpt_texonomy_search_generator( $texonomy_keyword, $temp_number , $searc 'hide_empty' => 1, 'child_of' => 0, 'exclude' => '', - 'echo' => 1, + 'echo' => 0,//1, 'selected' => 0, 'hierarchical' => 1,//0, // 1 for Tree format, and 0 for plane format 'name' => $texonomy_keyword,//'cat', @@ -1078,50 +1078,66 @@ function wpt_texonomy_search_generator( $texonomy_keyword, $temp_number , $searc 'data-key' => $texonomy_keyword, ); + $defaults = apply_filters( 'wpto_dropdown_categories_default', $defaults, $texonomy_keyword, $temp_number ); - - #### $html .= ""; - } - - $html .= wpt_wp_dropdown_categories( $defaults ); - }else{ - foreach( $texonomy_boj as $item ){ - $name = $item->name; - $customized_texonomy_boj[$name] = $item; - - } - $customized_texonomy_boj = wpt_sorting_array( $customized_texonomy_boj, $config_value['sort_searchbox_filter'] ); - foreach( $customized_texonomy_boj as $item ){ - #### $html .= ""; // ({$item->count}) - } - #### $html .= ""; - - //multiple $multiple_selectable - - $html .= wpt_wp_dropdown_categories( $defaults ); } - - - + }else{ + $customized_texonomy_boj = false; } + + $html .= wpt_wp_dropdown_categories( $defaults, $customized_texonomy_boj ); + + +// #### $html .= ""; +// } +// +// $html .= wpt_wp_dropdown_categories( $defaults ); +// }else{ +// foreach( $texonomy_boj as $item ){ +// $name = $item->name; +// $customized_texonomy_boj[$name] = $item; +// +// } +// $customized_texonomy_boj = wpt_sorting_array( $customized_texonomy_boj, $config_value['sort_searchbox_filter'] ); +// foreach( $customized_texonomy_boj as $item ){ +// #### $html .= ""; // ({$item->count}) +// } +// #### $html .= ""; +// +// //multiple $multiple_selectable +// +// $html .= wpt_wp_dropdown_categories( $defaults ); +// } +// +// +// +// } +// From bde4f17ebe4acfd67f8f1d6dad68c5ed387aa866 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Sun, 7 Feb 2021 14:20:15 +0600 Subject: [PATCH 05/14] working for tax tree --- includes/shortcode.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/shortcode.php b/includes/shortcode.php index e80aa053..4e997039 100644 --- a/includes/shortcode.php +++ b/includes/shortcode.php @@ -1077,6 +1077,9 @@ function wpt_texonomy_search_generator( $texonomy_keyword, $temp_number , $searc 'multiple' => $multiple_selectable, 'data-key' => $texonomy_keyword, ); + if( ! $multiple_selectable ){ + $defaults['show_option_all'] = esc_html__( 'Choose ', 'wpt_pro' ) . $label_all_items; + } $defaults = apply_filters( 'wpto_dropdown_categories_default', $defaults, $texonomy_keyword, $temp_number ); From 245e75ed7bda2b894084e9305dd2e8ee63178aa8 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Sun, 7 Feb 2021 16:28:08 +0600 Subject: [PATCH 06/14] set value empty for coose all cat or taxonomy --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index bd92821e..166604ff 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -538,7 +538,7 @@ function wpt_wp_dropdown_categories( $args = '', $get_taxonomy = false ) { /** This filter is documented in wp-includes/category-template.php */ $show_option_all = apply_filters( 'list_cats', $parsed_args['show_option_all'], null ); $selected = ( '0' === (string) $parsed_args['selected'] ) ? " selected='selected'" : ''; - $output .= "\t\n"; + $output .= "\t\n"; } if ( $parsed_args['show_option_none'] ) { From 4a6cb96d82076f0b22d305587fffed1456c650ee Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Sun, 7 Feb 2021 16:31:50 +0600 Subject: [PATCH 07/14] $taxonomy_details added for default filter --- includes/shortcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/shortcode.php b/includes/shortcode.php index 4e997039..160301bb 100644 --- a/includes/shortcode.php +++ b/includes/shortcode.php @@ -1081,7 +1081,7 @@ function wpt_texonomy_search_generator( $texonomy_keyword, $temp_number , $searc $defaults['show_option_all'] = esc_html__( 'Choose ', 'wpt_pro' ) . $label_all_items; } - $defaults = apply_filters( 'wpto_dropdown_categories_default', $defaults, $texonomy_keyword, $temp_number ); + $defaults = apply_filters( 'wpto_dropdown_categories_default', $defaults, $texonomy_keyword,$taxonomy_details, $temp_number ); if( $selected_taxs && is_array( $selected_taxs ) && count( $selected_taxs ) > 0 ){ $customized_texonomy_boj = array(); From 08babacc434e00c785d0e71fc2adec9f4c0ad53b Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 8 Feb 2021 11:34:33 +0600 Subject: [PATCH 08/14] version update just --- woo-product-table.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/woo-product-table.php b/woo-product-table.php index 73a58ae9..4f7f2ac2 100644 --- a/woo-product-table.php +++ b/woo-product-table.php @@ -7,7 +7,7 @@ * Author URI: https://codecanyon.net/user/codeastrology * Tags: woocommerce product,woocommerce product table, product table * - * Version: 2.8.2 + * Version: 2.8.3 * Requires at least: 4.0.0 * Tested up to: 5.6 * WC requires at least: 3.0.0 @@ -30,7 +30,7 @@ } if( !defined( 'WPT_DEV_VERSION' ) ){ - define( 'WPT_DEV_VERSION', '2.8.2.3' ); + define( 'WPT_DEV_VERSION', '2.8.3.5' ); } if( !defined( 'WPT_CAPABILITY' ) ){ From 01078669eec87292471c1d2d4ead76aac2cda223 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 8 Feb 2021 11:37:43 +0600 Subject: [PATCH 09/14] changelog added --- readme.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/readme.txt b/readme.txt index c8543c2b..4285037d 100644 --- a/readme.txt +++ b/readme.txt @@ -156,6 +156,11 @@ You can easily show specific category products. While creating new table click o == Changelog == += 2.8.3 = + * Fixed: Taxonomy hierarchy added. + * Fixed: Short Message showing in order issue has fixed. + * Fixed: Bug Fix. + = 2.8.2 = * Fixed: Responsive Tab Issue fixed. From daa0d91d0d07dbe1a42ab4ddc164f09d6a26c4e2 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 8 Feb 2021 11:38:01 +0600 Subject: [PATCH 10/14] shortmessage showing issue fixed --- includes/ajax_add_to_cart.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/ajax_add_to_cart.php b/includes/ajax_add_to_cart.php index 932c2a18..12c0daf5 100644 --- a/includes/ajax_add_to_cart.php +++ b/includes/ajax_add_to_cart.php @@ -546,12 +546,15 @@ function wpt_render_meta_on_cart_and_checkout( $cart_data, $cart_item = null ) { * @since 1.9 6.6.2018 d.m.y * @return Void This Function will add Customer Custom Message to Order */ - function wpt_order_meta_handler( $item_id, $values, $cart_item_key ) { + function wpt_order_meta_handler( $item_id, $item, $order_id ) { + $values = $item->legacy_values; + //function wpt_order_meta_handler( $item_id, $values, $cart_item_key ) { if( isset( $values['wpt_custom_message'] ) ) { $msg_string = __( 'Message', 'wpt_pro' ); $args['item_id'] = $item_id; $args['values'] = $values; - $args['cart_item_key'] = $cart_item_key; + $args['item'] = $item; + $args['cart_item_key'] = $order_id; $msg_string = apply_filters( 'wpto_shortmessage_string',$msg_string, $args ); wc_add_order_item_meta( $item_id, $msg_string, $values['wpt_custom_message'] ); } From 77f98d1c84da82c077a0bb1fb3f51cb965f956c2 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 8 Feb 2021 11:38:41 +0600 Subject: [PATCH 11/14] shortmessage showing issue fixed --- includes/ajax_add_to_cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/ajax_add_to_cart.php b/includes/ajax_add_to_cart.php index 12c0daf5..af51cbab 100644 --- a/includes/ajax_add_to_cart.php +++ b/includes/ajax_add_to_cart.php @@ -555,7 +555,7 @@ function wpt_order_meta_handler( $item_id, $item, $order_id ) { $args['values'] = $values; $args['item'] = $item; $args['cart_item_key'] = $order_id; - $msg_string = apply_filters( 'wpto_shortmessage_string',$msg_string, $args ); + $msg_string = apply_filters( 'wpto_shortmessage_string', $msg_string, $args ); wc_add_order_item_meta( $item_id, $msg_string, $values['wpt_custom_message'] ); } } From 6118ea85b9b438a51db7b2d7a75041bc26b9827f Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 8 Feb 2021 11:38:54 +0600 Subject: [PATCH 12/14] shortmessage showing issue fixed --- includes/ajax_add_to_cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/ajax_add_to_cart.php b/includes/ajax_add_to_cart.php index af51cbab..007eb4ce 100644 --- a/includes/ajax_add_to_cart.php +++ b/includes/ajax_add_to_cart.php @@ -548,7 +548,7 @@ function wpt_render_meta_on_cart_and_checkout( $cart_data, $cart_item = null ) { */ function wpt_order_meta_handler( $item_id, $item, $order_id ) { $values = $item->legacy_values; - //function wpt_order_meta_handler( $item_id, $values, $cart_item_key ) { + if( isset( $values['wpt_custom_message'] ) ) { $msg_string = __( 'Message', 'wpt_pro' ); $args['item_id'] = $item_id; From cfaeb22b9185e0a0b4340458ae9933c9ec32a5b6 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 8 Feb 2021 11:40:24 +0600 Subject: [PATCH 13/14] shortmessage showing issue fixed --- includes/ajax_add_to_cart.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/ajax_add_to_cart.php b/includes/ajax_add_to_cart.php index 007eb4ce..c6b83c2e 100644 --- a/includes/ajax_add_to_cart.php +++ b/includes/ajax_add_to_cart.php @@ -540,10 +540,11 @@ function wpt_render_meta_on_cart_and_checkout( $cart_data, $cart_item = null ) { * Adding Customer Message to Order * * @param type $item_id Session ID of Item's - * @param type $values Value's Array of Customer message - * @param type $cart_item_key + * @param type $item Value's Array of Customer message + * @param type $order_id * * @since 1.9 6.6.2018 d.m.y + * @fixed * @return Void This Function will add Customer Custom Message to Order */ function wpt_order_meta_handler( $item_id, $item, $order_id ) { From b002127d95755792dba78b9a9b4f74ce7832f078 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 8 Feb 2021 11:41:10 +0600 Subject: [PATCH 14/14] shortmessage showing issue fixed and comment added here --- includes/ajax_add_to_cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/ajax_add_to_cart.php b/includes/ajax_add_to_cart.php index c6b83c2e..e75db659 100644 --- a/includes/ajax_add_to_cart.php +++ b/includes/ajax_add_to_cart.php @@ -544,7 +544,7 @@ function wpt_render_meta_on_cart_and_checkout( $cart_data, $cart_item = null ) { * @param type $order_id * * @since 1.9 6.6.2018 d.m.y - * @fixed + * @fixed 8.2.2021 d.m.y fixed to this date * @return Void This Function will add Customer Custom Message to Order */ function wpt_order_meta_handler( $item_id, $item, $order_id ) {