Skip to content

Commit

Permalink
Merge pull request #21 from codersaiful/2.7.0.32
Browse files Browse the repository at this point in the history
2.7.0.32 - Freeze column added, Audio player Column Added and spelling fix from condition tab
  • Loading branch information
codersaiful authored Sep 15, 2020
2 parents 6f2deb9 + 4fe60b5 commit a32e17e
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 12 deletions.
17 changes: 17 additions & 0 deletions admin/action-hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,23 @@ function wpt_configure_basic_part( $settings,$current_config_value,$field_name )
<h3 class="with-background dark-background"><?php esc_html_e( 'Basic Settings', 'wpt_pro' );?></h3>
<table class="ultraaddons-table">
<tbody>
<?php if(class_exists( 'WOO_Product_Table' ) ){ ?>
<tr class="table_disable_plugin_noti">
<th>
<label class="wpt_label wpt_disable_plugin_noti" for="wpt_disable_plugin_noti"><?php esc_html_e( 'Plugin Recomendation', 'wpt_pro' );?></label>
</th>
<td>
<label class="switch">
<input name="<?php echo esc_attr( $field_name ); ?>[disable_plugin_noti]" type="checkbox" id="wpt_disable_plugin_noti" <?php echo isset( $current_config_value['disable_plugin_noti'] ) ? 'checked="checked"' : ''; ?>>
<div class="slider round"><!--ADDED HTML -->
<span class="on">Enable</span><span class="off">Disable</span><!--END-->
</div>
</label>
<p><?php echo esc_html( 'To enable or disable our plugin Notification for our Product Table', 'wpt_pro' ); ?></p>

</td>
</tr>
<?php } ?>
<tr>
<th><label class="wpt_label" for="wpt_table_custom_add_to_cart"><?php esc_html_e( 'Add to Cart Icon', 'wpt_pro' ); ?></label></th>
<td>
Expand Down
2 changes: 1 addition & 1 deletion admin/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ 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 ) ){
$per_data[$per_key]['style_str'] = isset( $per_data['style'] ) && is_array( $per_data['style'] ) ? wpt_convert_style_from_arr( $per_data['style'] ) : '';
$tab_data[$per_key]['style_str'] = isset( $per_data['style'] ) && is_array( $per_data['style'] ) ? wpt_convert_style_from_arr( $per_data['style'] ) : '';
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions admin/tabs/column_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ class="colum_data_input <?php echo esc_attr( $keyword ); ?>"
</div>
<span data-key="<?php echo esc_attr( $keyword ); ?>" class="extra_all_on_off on_now"><i class="on_off_icon"></i>Expand</span>
<div class="wpt_column_setting_extra for_all extra_all_<?php echo esc_attr( $keyword ); ?>">
<?php do_action( 'wpto_column_setting_form_inside_' . $keyword, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data ); ?>
<?php do_action( 'wpto_column_setting_form', $keyword, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data ); ?>

</div>
<div class="wpt_column_setting_extra for_all profeatures-message">
<?php do_action( 'wpo_pro_feature_message', 'column_extra' ); ?>
Expand Down
2 changes: 1 addition & 1 deletion admin/tabs/conditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</th>
<td>
<input name="conditions[meta_value_sort]" value="<?php echo isset( $meta_conditions['meta_value_sort'] ) ? $meta_conditions['meta_value_sort'] : ''; ?>" data-name='meta_value_sort' id="wpt_product_meta_value_sort" class="wpt_fullwidth wpt_data_filed_atts ua_input" type="text">
<p style="color: #00aef0;"><?php esc_html_e( 'Type your Right meta value here. EG: "_sku,_price,_customNumber" - use any one only, there should now and space', 'wpt_pro' ); ?></p>
<p style="color: #00aef0;"><?php esc_html_e( 'Type your Right meta value here. EG: "_sku,_price,_customNumber" - use any one only, there should no any space or comma', 'wpt_pro' ); ?></p>
</td>
</tr>
</table>
Expand Down
3 changes: 3 additions & 0 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,9 @@ body.wpt_admin_body .ultraaddons-panel td p{
select.wpt_table_on_archive {
margin-bottom: 15px;
}
.wpt_tab_content.tab-content .table_disable_plugin_noti{
display: none !important;
}
/* Responsive Design Starts */
@media screen and (max-width: 782px){
.wpt_column_setting_single_extra>div label {
Expand Down
39 changes: 39 additions & 0 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -804,3 +804,42 @@ function wpt_args_manipulation_frontend( $args ){
}
add_filter( 'wpto_table_query_args', 'wpt_args_manipulation_frontend' );

if( !function_exists( 'wpt_freeze_column_maintain' ) ){

/**
* Freeze Column Maintain using following Action Hook
* do_action( 'wpto_table_wrapper_bottom', $table_ID, $args, $column_settings, $enabled_column_array, $config_value, $atts );
*
* @param type $table_ID
* @param type $args
* @param type $column_settings
* @param type $enabled_column_array
*/
function wpt_freeze_column_maintain( $table_ID, $args, $column_settings, $enabled_column_array ){
$style = false;
if( isset( $enabled_column_array['freeze'] ) && $column_settings['freeze'] ){
$style = isset( $column_settings['freeze']['style'] ) ? $column_settings['freeze']['style'] : false;
}
if( $style ){
$default_width = apply_filters( 'wpto_default_width_freeze_col', '120px', $table_ID );
$width = isset( $style['width'] ) && !empty( $style['width'] ) ? $style['width'] : $default_width;
$selector = '#table_id_' . $table_ID . ' .wpt_table_tag_wrapper';
$css_code = <<<EOF
<style>
$selector th.wpt_freeze,$selector td.wpt_freeze {
position: absolute;
left: 0;
top: auto;
width: $width;
}
$selector, $selector table, $selector tr{position: static;}
$selector{margin-left: $width;}
</style>
EOF;
echo $css_code;
}
}
}
add_action( 'wpto_table_wrapper_bottom', 'wpt_freeze_column_maintain',9910,4 );
4 changes: 2 additions & 2 deletions includes/items/blank.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* Add content to Blank Type Column, Remember, It's Not Blank Column, It's Blank Type new Added Column
* Able to add any content to All Blank Type Column Data
*/
do_action( 'wpto_blank_type_column', $keyword, $table_ID, $product, $column_settings );
do_action( 'wpto_blank_type_column', $settings, $product, $keyword, $table_ID, $column_settings );

/**
* @Hook Actin: wpto_blank_type_column_($keyword)
* Add content to Blank Type Column, Remember, It's Not Blank Column, It's Blank Type new Added Column
* Able to add any content to Specific Column based on
*/
do_action( 'wpto_blank_type_column_' . $keyword, $table_ID, $product, $column_settings );
do_action( 'wpto_blank_type_column_' . $keyword, $settings, $product, $table_ID, $column_settings );
//Nothing for Display
2 changes: 1 addition & 1 deletion includes/items/blank_type.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
* For more, User able to add Blank Type - by Add new Colum and Column Type -Blank Type
* Here: Keyword is: $keyword => blank
*/
do_action( 'wpto_blank_centent', $table_ID, $product, $type );
do_action( 'wpto_blank_centent', $setting, $product, $keyword, $table_ID, $column_settings );
//Nothing for Display
4 changes: 4 additions & 0 deletions includes/items/freeze.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php


do_action( 'wpto_freeze_column', $settings, $product, $keyword, $table_ID, $column_settings );
8 changes: 4 additions & 4 deletions includes/shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ function wpt_shortcode_generator( $atts = false ) {
* To Insert Content at Top of the Table, Just inside of Wrapper tag of Table
* Available Args $table_ID, $args, $config_value, $atts;
*/
do_action( 'wpto_action_start_table', $table_ID, $args, $config_value, $atts );
do_action( 'wpto_action_start_table', $table_ID, $args, $column_settings, $enabled_column_array, $config_value, $atts );
$html .= ob_get_clean();

/**
Expand Down Expand Up @@ -510,7 +510,7 @@ function wpt_shortcode_generator( $atts = false ) {
* To Insert Content at Top of the Table, Just inside of Wrapper tag of Table
* Available Args $table_ID, $args, $config_value, $atts;
*/
do_action( 'wpto_action_table_wrapper_top', $table_ID, $args, $config_value, $atts );
do_action( 'wpto_action_table_wrapper_top', $table_ID, $args, $column_settings, $enabled_column_array, $config_value, $atts );
$html .= ob_get_clean();

$html .= ($minicart_position == 'top' ? $table_minicart_message_box : false);//$minicart_position //"<div class='tables_cart_message_box_{$temp_number}'></div>";
Expand Down Expand Up @@ -644,7 +644,7 @@ function wpt_shortcode_generator( $atts = false ) {
}
$Load_More = '<div id="wpt_load_more_wrapper_' . $temp_number . '" class="wpt_load_more_wrapper ' . $config_value['disable_loading_more'] . '"><button data-temp_number="' . $temp_number . '" data-load_type="current_page" data-type="load_more" class="button wpt_load_more">' . $Load_More_Text . '</button></div>';
$html .= ( $posts_per_page != -1 ? $Load_More : '' );//$Load_More;

$html .= $html_check_footer;
$html .= apply_filters('wpt_after_table', '', $temp_number ); //Apply Filter Just Before Table Wrapper div tag

Expand All @@ -661,7 +661,7 @@ function wpt_shortcode_generator( $atts = false ) {
* To Insert Content at Bottom of the Table, Just inside of Wrapper tag of Table
* Available Args $table_ID, $args, $config_value, $atts;
*/
do_action( 'wpto_table_wrapper_bottom', $table_ID, $args, $config_value, $atts );
do_action( 'wpto_table_wrapper_bottom', $table_ID, $args, $column_settings, $enabled_column_array, $config_value, $atts );
$html .= ob_get_clean();

$html .= "</div>"; //End of Table wrapper.
Expand Down
8 changes: 5 additions & 3 deletions woo-product-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Requires at least: 4.0.0
* Tested up to: 5.5.1
* WC requires at least: 3.0.0
* WC tested up to: 4.3.3
* WC tested up to: 4.5.0
*
* Text Domain: wpt_pro
* Domain Path: /languages/
Expand Down Expand Up @@ -78,7 +78,7 @@
WPT_Product_Table::getInstance();

$column_array = array(

'freeze' => __( 'Freeze Colum', 'wpt_pro' ),
'thumbnails' => __( 'Thumbnails', 'wpt_pro' ),
'product_title' => __( 'Products', 'wpt_pro' ),
'action' => __( 'Action', 'wpt_pro' ),
Expand Down Expand Up @@ -173,6 +173,7 @@
*/
$default = array(
'custom_message_on_single_page'=> true, //Set true to get form in Single Product page for Custom Message
'disable_plugin_noti'=> 'on',
'footer_cart' => 'always_show', //hide_for_zerro
'footer_cart_size' => '74',
'footer_bg_color' => '#0a7f9c',
Expand Down Expand Up @@ -489,7 +490,8 @@ public function __construct() {
* @access public
*/
public function admin_notice() {
if ( ! current_user_can( 'activate_plugins' ) ) {
$config = get_option( 'wpt_configure_options' );
if ( !isset( $config['disable_plugin_noti'] ) || ! current_user_can( 'activate_plugins' ) ) {
return;
}

Expand Down

0 comments on commit a32e17e

Please sign in to comment.