Skip to content

Commit

Permalink
Merge pull request #290 from codersaiful/3.3.9.0
Browse files Browse the repository at this point in the history
3.3.9.0
  • Loading branch information
codersaiful authored May 10, 2023
2 parents 393228b + 7861fa4 commit 17ca4e8
Show file tree
Hide file tree
Showing 23 changed files with 299 additions and 74 deletions.
5 changes: 4 additions & 1 deletion admin/admin-enqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ function wpt_admin_enqueue(){
*/
function wpt_admin_js_fast_load(){
wp_register_script( 'select2-wpt', WPT_Product_Table::getPath( 'BASE_URL' ) . 'assets/select2/js/select2.min.js', array( 'jquery' ), '4.0.13', true );
wp_enqueue_script( 'select2-wpt' );
if( 'wpt_product_table' == get_current_screen()->post_type ){
wp_enqueue_script( 'select2-wpt' );
}
//wp_enqueue_script( 'select2-wpt' );

wp_enqueue_script( 'wpt-admin', WPT_Product_Table::getPath( 'BASE_URL' ) . 'assets/js/admin.js', array( 'jquery','select2' ), '1.0.0', true );

Expand Down
7 changes: 4 additions & 3 deletions admin/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ function wpt_data_manipulation_on_save( $tab_data, $tab, $post_id, $save_tab_arr
* @version 2.8.3.5
*/
$query_relation = ! isset( $tab_data['query_relation'] ) ? 'IN' : $tab_data['query_relation'];
$query_relation = $tab_data['query_relation'] ?? 'IN';

$data = isset( $tab_data['data'] ) ? $tab_data['data'] : false;
$terms_string = 'terms';
Expand All @@ -328,7 +329,7 @@ function wpt_data_manipulation_on_save( $tab_data, $tab, $post_id, $save_tab_arr
'taxonomy' => $term_key,
'field' => 'id',
'terms' => $term_ids, //Array of Term's IDs
'operator' => $query_relation,//'IN'
'operator' => 'IN' //$query_relation,//
);
}
}
Expand Down Expand Up @@ -380,9 +381,9 @@ function wpt_add_tabs(){
/* translators: %s: Forum URL */
__( 'For further assistance with Product Table for WooCommerce, use the <a href="%1$s">community forum</a>. For help with premium support, <a href="%2$s">open a support request at CodeAstrology.com</a>.', 'woo-product-table' ),
'https://wordpress.org/support/plugin/woo-product-table/',
'https://codeastrology.com/support/submit-ticket/?utm_source=helptab&utm_content=tickets&utm_campaign=wptplugin'
'https://codeastrology.com/my-support/?utm_source=helptab&utm_content=tickets&utm_campaign=wptplugin'
) . '</p>' .
'<p><a href="https://wordpress.org/support/plugin/woo-product-table/" class="button">' . __( 'Community forum', 'woo-product-table' ) . '</a> <a href="https://codeastrology.com/support/submit-ticket/?utm_source=helptab&utm_content=tickets&utm_campaign=wptplugin" class="button">' . __( 'CodeAstrology.com support', 'woo-product-table' ) . '</a></p>',
'<p><a href="https://wordpress.org/support/plugin/woo-product-table/" class="button">' . __( 'Community forum', 'woo-product-table' ) . '</a> <a href="https://codeastrology.com/my-support/?utm_source=helptab&utm_content=tickets&utm_campaign=wptplugin" class="button">' . __( 'CodeAstrology.com support', 'woo-product-table' ) . '</a></p>',
)
);

Expand Down
2 changes: 1 addition & 1 deletion admin/handle/plugin-deactive/deactive-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Deactive_Form
*/
protected $required_screen_id = 'plugins'; // 'plugins';

protected $support_url = 'https://codeastrology.com/support/submit-ticket/';
protected $support_url = 'https://codeastrology.com/my-support/';

protected $common_target_msg = "Contact with our support email: [email protected]";

Expand Down
2 changes: 1 addition & 1 deletion admin/menu_plugin_setting_link.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function wpt_add_action_links($links) {
}
$wpt_links[] = '<a href="' . admin_url( 'post-new.php?post_type=wpt_product_table' ) . '" title="' . esc_attr__( 'Add new Shortcode', 'woo-product-table' ) . '">' . esc_html__( 'Create Table', 'woo-product-table' ).'</a>';
$wpt_links[] = '<a href="' . admin_url( 'edit.php?post_type=wpt_product_table&page=woo-product-table-config' ) . '" title="' . esc_attr__( 'Configure for Universal', 'woo-product-table' ) . '">' . esc_html__( 'Configure', 'woo-product-table' ) . '</a>';
$wpt_links[] = '<a href="https://codeastrology.com/support/?utm_source=Product+Table+Dashboard&utm_medium=Free+Version" title="' . esc_attr__( 'CodeAstrology Support', 'woo-product-table' ) . '" target="_blank">'.esc_html__( 'Support','woo-product-table' ).'</a>';
$wpt_links[] = '<a href="https://codeastrology.com/my-support/?utm_source=Product+Table+Dashboard&utm_medium=Free+Version" title="' . esc_attr__( 'CodeAstrology Support', 'woo-product-table' ) . '" target="_blank">'.esc_html__( 'Support','woo-product-table' ).'</a>';
$wpt_links[] = '<a href="https://github.com/codersaiful/woo-product-table" title="' . esc_attr__( 'Github Repo Link', 'woo-product-table' ) . '" target="_blank">'.esc_html__( 'Github Repository','woo-product-table' ).'</a>';

return array_merge( $wpt_links, $links );
Expand Down
21 changes: 11 additions & 10 deletions admin/tabs/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
</th>
<td>
<select name="basics[query_relation]" data-name='ajax_action' id="wpt_table_operation" class="wpt_fullwidth wpt_data_filed_atts ua_input" >
<option value="IN" <?php echo isset( $meta_basics['query_relation'] ) && $meta_basics['query_relation'] == 'IN' ? 'selected' : false; ?>><?php esc_html_e('IN Operation','woo-product-table');?></option>
<option value="IN" <?php echo isset( $meta_basics['query_relation'] ) && $meta_basics['query_relation'] == 'IN' ? 'selected' : false; ?>><?php esc_html_e('IN/OR Operation','woo-product-table');?></option>
<option value="AND" <?php echo isset( $meta_basics['query_relation'] ) && $meta_basics['query_relation'] == 'AND' ? 'selected' : false; ?>><?php esc_html_e('AND Operation','woo-product-table');?></option>
</select>
</td>
Expand Down Expand Up @@ -283,7 +283,7 @@

<option value="title" <?php echo isset( $meta_conditions['sort_order_by'] ) && $meta_conditions['sort_order_by'] == 'title' ? 'selected' : ''; ?>><?php esc_html_e( 'Product Title', 'woo-product-table' ); ?></option>

<option value="date" <?php echo isset( $meta_conditions['sort_order_by'] ) && $meta_conditions['sort_order_by'] == 'date' ? 'selected' : ''; ?>><?php esc_html_e( 'Date', 'woo-product-table' ); ?></option>
<option value="publish-date" <?php echo isset( $meta_conditions['sort_order_by'] ) && $meta_conditions['sort_order_by'] == 'publish-date' ? 'selected' : ''; ?>><?php esc_html_e( 'Date', 'woo-product-table' ); ?></option>
<option value="meta_value" <?php echo isset( $meta_conditions['sort_order_by'] ) && $meta_conditions['sort_order_by'] == 'meta_value' ? 'selected' : ''; ?>><?php esc_html_e( 'Custom Meta Value', 'woo-product-table' ); ?></option>


Expand All @@ -298,8 +298,9 @@
$selected = $val == $id ? 'selected' : '';
?>
<option value="<?php echo esc_attr( $id ); ?>"
<?php echo esc_attr( $selected ); ?>>
<?php esc_html_e( $name ); ?></option>
<?php echo esc_attr( $selected ); ?>>
<?php esc_html_e( $name ); ?>
</option>
<?php endforeach; ?>
<option value="author" <?php echo isset( $meta_conditions['sort_order_by'] ) && $meta_conditions['sort_order_by'] == 'author' ? 'selected' : ''; ?>><?php esc_html_e( 'Author', 'woo-product-table' ); ?></option>

Expand All @@ -312,12 +313,12 @@
<?php }else{
foreach ( $catalog_orderby_options as $id => $name ) : ?>
<option disabled><?php echo esc_html( $name ); ?> (<?php echo esc_html__( 'Pro', 'woo-product-table' ); ?>)</option>
<?php endforeach; ?>
<option disabled><?php echo esc_html__( 'Custom Meta Number(Pro)', 'woo-product-table' ); ?></option>
<option disabled><?php echo esc_html__( 'Author(Pro)', 'woo-product-table' ); ?></option>
<option disabled><?php echo esc_html__( 'Type(Pro)', 'woo-product-table' ); ?></option>
<option disabled><?php echo esc_html__( 'Modified(Pro)', 'woo-product-table' ); ?></option>
<option disabled><?php echo esc_html__( 'Rand(Pro)', 'woo-product-table' ); ?></option>
<?php endforeach; ?>
<option disabled><?php echo esc_html__( 'Custom Meta Number(Pro)', 'woo-product-table' ); ?></option>
<option disabled><?php echo esc_html__( 'Author(Pro)', 'woo-product-table' ); ?></option>
<option disabled><?php echo esc_html__( 'Type(Pro)', 'woo-product-table' ); ?></option>
<option disabled><?php echo esc_html__( 'Modified(Pro)', 'woo-product-table' ); ?></option>
<option disabled><?php echo esc_html__( 'Rand(Pro)', 'woo-product-table' ); ?></option>
<?php } ?>
<option value="parent" <?php echo isset( $meta_conditions['sort_order_by'] ) && $meta_conditions['sort_order_by'] == 'parent' ? 'selected' : ''; ?>><?php esc_html_e( 'Parent', 'woo-product-table' ); ?></option>
<option value="comment_count" <?php echo isset( $meta_conditions['sort_order_by'] ) && $meta_conditions['sort_order_by'] == 'comment_count' ? 'selected' : ''; ?>><?php esc_html_e( 'Reviews/Comment Count', 'woo-product-table' ); ?></option>
Expand Down
6 changes: 4 additions & 2 deletions admin/tabs/search_n_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
}
?>
</select>
<!-- <input name="search_n_filter[taxonomy_keywords]" data-name='taxonomy_keywords' id="wpt_taxonomy_keywords" value="<?php echo isset( $meta_search_n_filter['taxonomy_keywords'] ) ?$meta_search_n_filter['taxonomy_keywords'] : 'product_cat,product_tag'; ?>" class="wpt_fullwidth wpt_data_filed_atts ua_input" type="text" placeholder="<?php esc_attr_e( 'eg: product_cat,product_tag,color,size', 'woo-product-table' ); ?>"> -->

<p class="warning">
<b>IMPORTANT Tips:</b>
<span>To CHOOSE selected Taxonomy(Category,Tag), PLEASE Save & RELOAD,
Expand Down Expand Up @@ -185,7 +185,9 @@
<?php
foreach ( $tax_object as $tax_item ) {
$tax_array_key = $per_keyword;
echo "<option value='{$tax_item->term_id}' " . ( isset( $meta_search_n_filter[$tax_array_key] ) && is_array( $meta_search_n_filter[$tax_array_key] ) && in_array( $tax_item->term_id, $meta_search_n_filter[$tax_array_key] ) ? 'selected' : false ) . ">{$tax_item->name} - {$tax_item->slug} ({$tax_item->count})</option>";
$selected = ( isset( $meta_search_n_filter[$tax_array_key] ) && is_array( $meta_search_n_filter[$tax_array_key] ) && in_array( $tax_item->term_id, $meta_search_n_filter[$tax_array_key] ) ? 'selected' : false );//
// $selected = 'selected';//
echo "<option value='{$tax_item->term_id}' " . $selected . ">{$tax_item->name} - {$tax_item->slug} ({$tax_item->count})</option>";
}
?>
</select>
Expand Down
7 changes: 4 additions & 3 deletions assets/css/universal.css
Original file line number Diff line number Diff line change
Expand Up @@ -928,10 +928,10 @@ div.wpt-wrap .elementor-menu-cart__product-image img {
}

.wpt_search_box .search_box_wrapper a.search_box_reset,
a.search_box_reset {
.wpt_search_box .search_box_wrapper a.search_box_reset, a.search_box_reset {
position: absolute;
right: 8px;
top: 0;
right: -28px;
bottom: 0;
height: 25px;
padding: 0;
width: 25px;
Expand All @@ -948,6 +948,7 @@ a.search_box_reset {
border: none !important;
text-decoration: none !important;
display: none;
min-width: 0;
}
a.search_box_reset:focus,
.wpt_search_box .search_box_wrapper a.search_box_reset:hover, a.search_box_reset:hover {
Expand Down
37 changes: 34 additions & 3 deletions assets/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ jQuery(function($) {
setValueToTargetTD_IfAvailable('stock', targetAttributeObject.availability_html);

//Set Total Price display_price
var targetQty = $('#table_id_' + temp_number + ' #product_id_' + product_id + ' wpt_quantity .quantity input.input-text.qty.text').val();
var targetQty = $('#table_id_' + temp_number + ' #product_id_' + product_id + ' input.input-text.qty.text').val();
if(!targetQty){
targetQty = 1;
}
Expand Down Expand Up @@ -1637,13 +1637,44 @@ jQuery(function($) {
});
var page_number = $('#table_id_' + table_id + ' table').attr('data-page_number');
page_number = parseInt( page_number ) - 1;
link += "paged=" + page_number + "&";

link += "paged=" + page_number;
$('a.search_box_reset').show();
link += extra;
//window.location.href = link;
window.history.pushState('data', null, link.replace(/(^&)|(&$)/g, ""));
}

// var extra_link_tax_cf = "";
// if( !$.isEmptyObject(texonomies)){
// extra_link_tax_cf = "tax=" + JSON.stringify(targetTableArgs.args.tax_query)
// }
// if( !$.isEmptyObject(custom_field)){
// extra_link_tax_cf = "meta=" + JSON.stringify(targetTableArgs.args.meta_query)
// }

//Set a Attr value in table tag, If already queried
// $('#table_id_' + temp_number + ' table.wpt_product_table').attr('data-queried','true');
/**
* Generate here where query
*/
// generate_url_by_search_query(temp_number, extra_link_tax_cf);

$(document.body).on('wpt_ajax_load_data',function(Event,data){
var table_id = data.table_id;

var page_number = data.others.page_number;
var extra_link_tax_cf = "";
if( typeof data.args.tax_query === 'object' && !$.isEmptyObject(data.args.tax_query)){
extra_link_tax_cf = "&tax=" + JSON.stringify(data.args.tax_query)
}
if( typeof data.args.meta_query === 'object' && !$.isEmptyObject(data.args.meta_query)){
extra_link_tax_cf = "&meta=" + JSON.stringify(data.args.meta_query)
}
generate_url_by_search_query(table_id, extra_link_tax_cf);


});

$(document.body).on('click','h1.entry-title-BACKUP',function(){
var temp_number = '19541';
var newjsonData = $('#table_id_' + temp_number + ' mypagi').attr('myjson');
Expand Down
18 changes: 18 additions & 0 deletions assets/js/wpt-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,19 @@ jQuery(function($) {

});

/**
* Solved topic here are:
* 1* paginated val
* 2*
*/
$(document.body).on('wpt_ajax_loaded',function(){
paginated_val = 0;

/**
* set Change trigger after load filter table
*
*/
$('.wpt_varition_section.variations').change();
});


Expand Down Expand Up @@ -313,6 +324,13 @@ jQuery(function($) {

try{
ownFragmentPerItemsHandle( ownFragment );

/**
* If any customer want to do something based on Fragment refresh,
* Then u can use this.
*
*/
$(document.body).trigger('wpt_fragents_loaded',ownFragment);
}catch(e){
console.log('Something went wrong on ownFragment loads.',ownFragment);
}
Expand Down
18 changes: 16 additions & 2 deletions inc/handle/args.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,23 @@ public static function manage( Shortcode $shortcode ){
* we store like query and stored it in basics tab
* and I made a property by following code at Class Shortcode:inc/shortcode.php
* $this->basics_args = $this->basics['args'] ?? [];
*
* *******************************************
* Notice:
* ********************************************
* Here was array_merge() function
* but for using that function, we got a problem on category_include and category_exclude at a time.
*
* that's why, I have used new func array_merge_recursive() so that exclude and eclude can work both at a time
* function change at @version 3.3.8.0
*/
self::$args = array_merge( $args, $shortcode->basics_args );

self::$args = array_merge_recursive( $args, $shortcode->basics_args );

if( ! empty( self::$args['tax_query'] ) && $shortcode->basics['query_relation'] ){
$query_rel = $shortcode->basics['query_relation'] ?? 'OR';
self::$args['tax_query']['relation'] = $query_rel == 'AND' ? $query_rel : 'OR';
}

if( $shortcode->req_product_type == 'product_variation' ){

self::$tax_query = self::$args['tax_query'] ?? [];
Expand Down
18 changes: 14 additions & 4 deletions inc/handle/enable-column.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,25 @@ public static function manage( Shortcode $shortcode ){
}
//If set Only Product Variation
if( $shortcode->req_product_type == 'product_variation' ){
unset( $shortcode->_enable_cols['category'] );
unset( $shortcode->_enable_cols['tags'] );
/**
* We have remove @version 3.3.8.1 because, in category item
* we have taken parent product it when it variation product.
*/
// unset( $shortcode->_enable_cols['category'] );

/**
* We have remove @version 3.3.8.1 because, in tag item
* we have taken parent product it when it variation product.
*/
// unset( $shortcode->_enable_cols['tags'] );
unset( $shortcode->_enable_cols['weight'] );
unset( $shortcode->_enable_cols['length'] );
unset( $shortcode->_enable_cols['width'] );
unset( $shortcode->_enable_cols['height'] );
unset( $shortcode->_enable_cols['rating'] );
unset( $shortcode->_enable_cols['attribute'] );
unset( $shortcode->_enable_cols['variations'] );
//removed@version 3.3.8.1
// unset( $shortcode->_enable_cols['attribute'] );
// unset( $shortcode->_enable_cols['variations'] );
}


Expand Down
8 changes: 8 additions & 0 deletions inc/shortcode-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ class Shortcode_Base extends Base{
public $_root = __CLASS__;
public $shortcde_text = 'Product_Table';

/**
* actually public $table_id is not available here
* it will override at extened class
*
* @var null|int It's actually int number ot post id for woo_product_table post_type
*/
public $table_id = 0;

/**
* Very important Property,
* Default is true, But somethime, we need to disable table.
Expand Down
Loading

0 comments on commit 17ca4e8

Please sign in to comment.