Skip to content

Commit

Permalink
Merge pull request #94 from codersaiful/2.8.6.1
Browse files Browse the repository at this point in the history
2.8.6.1
  • Loading branch information
codersaiful authored May 6, 2021
2 parents 2675ac1 + 5a71ff8 commit d413eb5
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 20 deletions.
46 changes: 32 additions & 14 deletions admin/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,33 @@ function wpt_admin_responsive_tab_file(){
function wpt_column_style_for_all( $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data ){

$style_property = isset( $additional_data['css_property'] ) && is_array( $additional_data['css_property'] ) ? $additional_data['css_property'] : array();
//$style = isset( $item['style'] ) ? $item['style'] : false;
$style = isset( $column_settings[$keyword]['style'] ) ? $column_settings[$keyword]['style'] : false;
$item_name_prefix = "column_settings{$_device_name}[$keyword][style]";
$class_name = "style_str{$_device_name}_{$keyword}";

$item_name_style_str = "column_settings{$_device_name}[$keyword][style_str]";
$style_str = isset( $column_settings[$keyword]['style_str'] ) ? $column_settings[$keyword]['style_str'] : false;

$style_str_arr = explode( ";", $style_str );
$style_str_arr = array_filter( $style_str_arr );
$style = array();
foreach( $style_str_arr as $each_style ){
$each_style_property = explode( ": ", $each_style );
$str_str_key_01 = !empty( $each_style_property[0] ) ? $each_style_property[0] : ' ';
$str_str_key_02 = !empty( $each_style_property[1] ) ? $each_style_property[1] : ' ';
$style[$str_str_key_01] = $str_str_key_02;
}

?>

<div class="wpt-style-wrapper style-wrapper-<?php echo esc_attr( $keyword ); ?>">
<div
data-target_value_wrapper="<?php echo esc_attr( $class_name ); ?>"
class="style_str_wrapper wpt-style-wrapper <?php echo esc_attr( $class_name ); ?> style-wrapper-<?php echo esc_attr( $keyword ); ?>">
<input
type="hidden"
class="str_str_value_string"
value="<?php echo esc_attr( $style_str ); ?>" name="<?php echo esc_attr( $item_name_style_str ); ?>">
<h3 class="style-heading"><?php echo esc_html( 'Style Area', 'wpt_pro' ); ?></h3>
<div class="wpt-style-body">
<table class="ultraaddons-table">
<table class="ultraaddons-table <?php echo esc_attr( $class_name ); ?>_value_wrapper" style_str_value_wrapper>
<?php
foreach( $style_property as $style_key => $label ){
$value = isset( $style[ $style_key ] ) ? $style[ $style_key ] : false;
Expand All @@ -99,8 +117,8 @@ function wpt_column_style_for_all( $keyword, $_device_name, $column_settings, $c
<th><label><?php echo esc_html($label); ?></label></th>
<td>
<input
class="ua_input wpt-<?php echo esc_attr( $style_key ); ?>"
name="<?php echo esc_attr( $item_name_prefix ); ?>[<?php echo esc_attr( $style_key ); ?>]"
class="ua_input wpt-<?php echo esc_attr( $style_key ); ?> str_str_each_value"
data-proerty_name="<?php echo esc_attr( $style_key ); ?>"
value="<?php echo esc_attr( $value ); ?>"
placeholder="<?php echo esc_attr($label); ?>">
</td>
Expand Down Expand Up @@ -172,13 +190,13 @@ function wpt_data_manipulation_on_save( $tab_data, $tab, $post_id, $save_tab_arr
}

}
if( 'column_settings' == $tab && is_array( $tab_data ) ){
foreach( $tab_data as $per_key => $per_data ){
if( !empty( $per_key ) && is_array( $per_data ) ){
$tab_data[$per_key]['style_str'] = isset( $per_data['style'] ) && is_array( $per_data['style'] ) ? wpt_convert_style_from_arr( $per_data['style'] ) : '';
}
}
}
// if( 'column_settings' == $tab && is_array( $tab_data ) ){
// foreach( $tab_data as $per_key => $per_data ){
// if( !empty( $per_key ) && is_array( $per_data ) ){
// $tab_data[$per_key]['style_str'] = isset( $per_data['style'] ) && is_array( $per_data['style'] ) ? wpt_convert_style_from_arr( $per_data['style'] ) : '';
// }
// }
// }

return $tab_data;
}
Expand Down
25 changes: 24 additions & 1 deletion admin/post_metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ function wpt_shortcode_metabox(){
add_meta_box( 'wpt_shortcode_metabox_id', 'Shortcode', 'wpt_shortcode_metabox_render', 'wpt_product_table', 'normal' );
add_meta_box( 'wpt_shortcode_configuration_metabox_id', 'Table Configuration', 'wpt_shortcode_configuration_metabox_render', 'wpt_product_table', 'normal' ); //Added at 4.1.4
//add_meta_box( 'wpt_column_panel_metabox_id', __( 'Available Columns', 'wpt' ), 'wpt_column_panel_metabox_render', 'wpt_product_table', 'side', 'low' ); //Added at 4.1.4

/**
* Added new feature for Product Table
*
* @since 2.8.5.1
* @by Saiful
*/
add_meta_box( 'wpt_export_import_metabox_id', __( 'Export/Import', 'wpt_pro' ), 'wpt_export_import_metabox_render', 'wpt_product_table', 'normal' );
}
}

Expand Down Expand Up @@ -98,6 +104,23 @@ function wpt_shortcode_metabox_render(){
}
}

if( ! function_exists( 'wpt_export_import_metabox_render' ) ){

function wpt_export_import_metabox_render(){
global $post;
$post_id = $post->ID;
//update_post_meta($post_id, $meta_key, $post_id);
//var_dump( get_post_meta($post_id));
$post_title = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/',"$1", $post->post_title );
?>
<div class="wpt-export-import-wrapper">
<textarea id="wpt-export-textarea" class="wpt-export-textarea ua-input"></textarea>
</div>
<?php
}
}


if( !function_exists( 'wpt_shortcode_configuration_metabox_render' ) ){
//Now start metabox for shortcode Generator
function wpt_shortcode_configuration_metabox_render(){
Expand Down
7 changes: 7 additions & 0 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,13 @@ a.button {}
}
/* Notice Style for UltraAddons | END*/

/* Export Import Features start */
.wpt-export-textarea{
width: 100%;
min-height: 100px;
}
/* Export Import Features end */

/* Responsive Design Starts */
@media screen and (max-width: 782px){
.wpt_column_setting_single_extra>div label {
Expand Down
20 changes: 20 additions & 0 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@
if(! $('body').hasClass('wpt_admin_body')){
return false;
}

$('body').on('focus','.str_str_each_value',function(){

//style_str_value_wrapper
var wrapper = $(this).closest('.style_str_wrapper');
var targetWrapper = wrapper.data('target_value_wrapper');
console.log(targetWrapper,"#" + targetWrapper + " .str_str_each_value");
var property_name, property_value;
var str_str = "";
$("." + targetWrapper + " .str_str_each_value").each(function() {
property_name = $(this).data('proerty_name');
property_value = $(this).val();
if( property_value ){
str_str += property_name + ": " + property_value + ";";
}
});
//str_str_value_string
$("." + targetWrapper + " .str_str_value_string").val(str_str);
});

//For select, used select2 addons of jquery
//$('.wpt_wrap select,.wpt_shortcode_gen_panel select, select#wpt_product_ids,select#product_tag_ids').select2();

Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: codersaiful,codeastrology
Donate link: https://codecanyon.net/item/woo-product-table-pro/20676867?ref=CodeAstrology&utm_source=WPT_Installed_DonateLink
Tags: wc product table,woocommerce product table, product table, wc table, quick order table, wholesale table, restaurants table
Requires at least: 4.0.0
Tested up to: 5.7.0
Tested up to: 5.7.1
Requires PHP: 5.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -156,6 +156,12 @@ You can easily show specific category products. While creating new table click o

== Changelog ==

= 2.8.6 =
* Illegal Offset issue fixed

= 2.8.5 =
* Device wise column setting feature added

= 2.8.4 =
* Fixed: Product not found issue solved
* Fixed: ShortMessage send issue has fixe. To see short message field in single product. Use: `add_action( 'woocommerce_before_add_to_cart_quantity', 'wpt_add_custom_message_field' );`
Expand Down
8 changes: 4 additions & 4 deletions woo-product-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://codecanyon.net/user/codeastrology
* Tags: woocommerce product list,woocommerce product table, wc product table, product grid view, inventory, shop product table
*
* Version: 2.8.5
* Version: 2.8.6
* Requires at least: 4.0.0
* Tested up to: 5.7.1
* WC requires at least: 3.0.0
Expand All @@ -30,7 +30,7 @@
}

if( !defined( 'WPT_DEV_VERSION' ) ){
define( 'WPT_DEV_VERSION', '2.8.5.4' );
define( 'WPT_DEV_VERSION', '2.8.6.5' );
}

if( !defined( 'WPT_CAPABILITY' ) ){
Expand Down Expand Up @@ -679,13 +679,13 @@ public function admin_notice_missing_main_plugin() {
public function admin_notice_pro_version_need_update() {

$message = sprintf(
esc_html__( '"%1$s" requires "%2$s" to be update to minimum version:("%3$s"). Please update your [Woo Product Table Pro] version', 'wpt_pro' ),
esc_html__( '"%1$s" recommend "%2$s" to be update to minimum version:("%3$s"). Please update your [Woo Product Table Pro] version', 'wpt_pro' ),
'<strong>' . esc_html__( 'Woo Product Table', 'wpt_pro' ) . '</strong>',
'<strong>' . esc_html__( 'Pro Version of Woo Product Table Pro', 'wpt_pro' ) . '</strong>',
'<strong>' . self::MINIMUM_WPT_PRO_VERSION . '</strong>'
);

printf( '<div class="notice notice-error is-dismissible"><p>%1$s</p></div>', $message );
printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );

}

Expand Down

0 comments on commit d413eb5

Please sign in to comment.