From 6b0a1eeb130038fd5cd4ec2d88e65389abdd48da Mon Sep 17 00:00:00 2001 From: fatimakhatungit Date: Sun, 24 Jul 2022 18:40:36 +0600 Subject: [PATCH 1/4] price --- assets/css/templates/beautiful_blacky.css | 4 ++++ assets/css/templates/default.css | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/css/templates/beautiful_blacky.css b/assets/css/templates/beautiful_blacky.css index 5e66352e..0e739a00 100644 --- a/assets/css/templates/beautiful_blacky.css +++ b/assets/css/templates/beautiful_blacky.css @@ -662,4 +662,8 @@ body.wpt_table_body .beautiful_blacky_wrapper .wpt_search_box .search_box_wrappe .woocommerce-noreviews, p.no-comments { background-color: #37aee9 !important; +} + +div.wpt-footer-cart-wrapper>a:after, div.wpt-footer-cart-wrapper>a { + background-color: #37aee9 !important; } \ No newline at end of file diff --git a/assets/css/templates/default.css b/assets/css/templates/default.css index 8fbbb106..dc83d080 100644 --- a/assets/css/templates/default.css +++ b/assets/css/templates/default.css @@ -694,4 +694,4 @@ body.wpt_table_body .default_wrapper button:focus { background-color: transparent; border: 1px solid var(--wpt-default-primary); color: var(--wpt-default-primary); -} \ No newline at end of file +} From 3e7ddd079da08e9d49425d89e0440f9a2cb3e872 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 25 Jul 2022 11:46:29 +0600 Subject: [PATCH 2/4] new function wpt_remove_empty_value_from_array( $array ) added for remove all empty value from an array --- admin/functions.php | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/admin/functions.php b/admin/functions.php index 4430e4f3..929d739a 100644 --- a/admin/functions.php +++ b/admin/functions.php @@ -56,6 +56,57 @@ function wpt_default_option( $page ){ } } +/** + * Remove empty Array value from an Multi-dimensional Array + * I have taken help from a stackoverflow tips. + * + * @param Array $array Obviously should be an Array + * @return Array + * + * @link https://stackoverflow.com/questions/9895130/recursively-remove-empty-elements-and-subarrays-from-a-multi-dimensional-array + * + */ +function wpt_remove_empty_value_from_array( $array ){ + + + if( ! is_array( $array ) ) return $array; + // foreach($array as $key=>&$arr){ + // if( empty( $arr ) ){ + // unset( $array[$key] ); + // } + // if( is_array($arr) ){ + // wpt_remove_empty_value_from_array( $arr ); + // } + // } + // return $array; + + // $array = array_filter($array,function($val){ + // if( is_array( $val ) ){ + // return wpt_remove_empty_value_from_array( $val ); + // } + // return ! empty($val); + // }); + + // $array = array_filter(array_map('array_filter', $array)); + // return $array; + + foreach ($array as $key => &$value) { + if (empty($value)) { + unset($array[$key]); + } + else { + if (is_array($value)) { + $value = wpt_remove_empty_value_from_array($value); + if (empty($value)) { + unset($array[$key]); + } + } + } + } + + return $array; +} + /** From 6ef527931d8a04c9d186c85377d7b48493617cd0 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 25 Jul 2022 12:38:43 +0600 Subject: [PATCH 3/4] data saving optimized and save #admin/post_metabox.php --- admin/functions.php | 4 ++-- admin/post_metabox.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/admin/functions.php b/admin/functions.php index 929d739a..4d75de6d 100644 --- a/admin/functions.php +++ b/admin/functions.php @@ -91,13 +91,13 @@ function wpt_remove_empty_value_from_array( $array ){ // return $array; foreach ($array as $key => &$value) { - if (empty($value)) { + if ( ! is_bool( $value ) && empty($value)) { unset($array[$key]); } else { if (is_array($value)) { $value = wpt_remove_empty_value_from_array($value); - if (empty($value)) { + if (! is_bool( $value ) && empty($value)) { unset($array[$key]); } } diff --git a/admin/post_metabox.php b/admin/post_metabox.php index 279c0209..0d09e51a 100644 --- a/admin/post_metabox.php +++ b/admin/post_metabox.php @@ -343,8 +343,8 @@ function wpt_shortcode_configuration_metabox_save_meta( $post_id, $post ) { // s ); $submitte_data = filter_input_array( INPUT_POST, $filtar_args ); - $submitte_data = array_filter( $submitte_data ); + $submitte_data = wpt_remove_empty_value_from_array($submitte_data); /********* Column Setting Optimizing Start here ***********/ //Fixing for tablet setting @@ -461,9 +461,10 @@ function wpt_shortcode_configuration_metabox_save_meta( $post_id, $post ) { // s * Only for customer use at this moment. */ $tab_data = apply_filters( 'wpto_tab_data_on_save_' . $tab, $tab_data, $post_id, $save_tab_array ); + $tab_data = wpt_remove_empty_value_from_array( $tab_data ); update_post_meta( $post_id, $tab, $tab_data ); } - + /** * @Hook Action: wpto_on_save_post * To change data when Form will save. From 5a9d43d7a68d01bcf88ee2bacf38784b6660e78e Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Mon, 25 Jul 2022 12:49:41 +0600 Subject: [PATCH 4/4] class issue has been fixed --- includes/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index b92af49e..7de065aa 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1093,8 +1093,9 @@ function wpt_get_value_with_woocommerce_unit( $target_unit, $value ){ function wpt_adding_body_class( $class ) { global $post,$shortCodeText; - - if( isset($post->post_content) && has_shortcode( $post->post_content, $shortCodeText ) ) { + + if( ( isset($post->post_content) && has_shortcode( $post->post_content, $shortCodeText ) ) + || $post->post_type == 'wpt_product_table' ) { $class[] = 'wpt_table_body'; $class[] = 'woocommerce'; }