Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.1.0.0 #177

Merged
merged 21 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion admin/action-hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function wpt_admin_form_top(){
if( $validation ){
?>
<ul class="wpt_admin_form_links" style="margin: 0">
<li><a class="wpt_get_pro_form_top_link" target="_blank" title="Awesome Pro features is Waiting for you!" href="https://codecanyon.net/item/woo-product-table-pro/20676867?ref=CodeAstrology&utm_source=WPT_Installed_Plugin">Get Pro</a></li>
<li><a class="wpt_get_pro_form_top_link" target="_blank" title="Awesome Pro features is Waiting for you!" href="https://1.envato.market/e4Jjvz">Get Pro</a></li>
<li>
<a class="Header-link " href="https://github.com/codersaiful/woo-product-table" target="_blank">
<svg class="octicon octicon-mark-github v-align-middle" height="16"
Expand Down Expand Up @@ -647,6 +647,12 @@ function wpt_configure_all_message_part( $settings,$current_config_value,$field_
<input name="<?php echo esc_attr( $field_name ); ?>[select_all_items_message]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['select_all_items_message'] ); ?>" id="wpt_table_select_all_items_message" type="text" placeholder="<?php esc_attr_e( 'Please select all items.', 'wpt_pro' );?>">
</td>
</tr>
<tr class="<?php echo esc_attr( $user_can_edit ); ?>">
<th><label for="wpt_table_please_choose_items" class="wpt_label"><?php esc_html_e( '[Please Choose items] Alert!', 'wpt_pro' );?></label></th>
<td>
<input name="<?php echo esc_attr( $field_name ); ?>[please_choose_items]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['please_choose_items'] ); ?>" id="wpt_table_please_choose_items" type="text" placeholder="<?php esc_attr_e( 'Please select all items.', 'wpt_pro' );?>">
</td>
</tr>
<tr class="<?php echo esc_attr( $user_can_edit ); ?>">
<th><label for="wpt_table_out_of_stock_message" class="wpt_label"><?php esc_html_e( '[Out of Stock] Message', 'wpt_pro' );?></label></th>
<td>
Expand Down
2 changes: 1 addition & 1 deletion admin/includes/right_side.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<a href="https://codecanyon.net/downloads" target="_blank"><img class="rate_us_image" src="<?php echo WPT_Product_Table::getPath( 'BASE_URL' ); ?>assets/images/rate_us.png"></a>
<h1>It can take only 2 Minutes.</h1>
<a href="https://wordpress.org/support/plugin/woo-product-table/reviews/?filter=5#new-post" target="_blank">Rate Us on WordPress.org</a>
<a href="https://codecanyon.net/item/woo-product-table-pro/20676867?ref=CodeAstrology&utm_source=WPT_Installed_Plugin" target="_blank">Rate Us on CodeCanyon</a>
<a href="https://1.envato.market/e4Jjvz" target="_blank">Rate Us on CodeCanyon</a>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions admin/menu_plugin_setting_link.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
function wpt_add_action_links($links) {
if( ! class_exists( 'WOO_Product_Table' ) ){
$wpt_links[] = '<a href="https://codecanyon.net/item/woo-product-table-pro/20676867?ref=CodeAstrology&utm_source=WPT_Installed_Plugin" title="' . esc_attr__( 'Many awesome features is waiting for you', 'wpt_pro' ) . '" target="_blank">'.esc_html__( 'GET PRO VERSION','wpt_pro' ).'</a>';
$wpt_links[] = '<a href="https://1.envato.market/e4Jjvz" title="' . esc_attr__( 'Many awesome features is waiting for you', 'wpt_pro' ) . '" target="_blank">'.esc_html__( 'GET PRO VERSION','wpt_pro' ).'</a>';
}
$wpt_links[] = '<a href="' . admin_url( 'post-new.php?post_type=wpt_product_table' ) . '" title="' . esc_attr__( 'Add new Shortcode', 'wpt_pro' ) . '">' . esc_html__( 'Create Table', 'wpt_pro' ).'</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', 'wpt_pro' ) . '">' . esc_html__( 'Configure', 'wpt_pro' ) . '</a>';
Expand All @@ -37,7 +37,7 @@ function wpt_admin_menu() {
add_submenu_page( 'edit.php?post_type=wpt_product_table', esc_html__( 'Woo Product Table Documentaion', 'wpt_pro' ), esc_html__( 'Documentation', 'wpt_pro' ), WPT_CAPABILITY, 'https://wooproducttable.com/documentation/' );
add_submenu_page( 'edit.php?post_type=wpt_product_table', esc_html__( 'Contribute to our Github Repository', 'wpt_pro' ), sprintf( esc_html__( 'Github %s Repo%s', 'wpt_pro' ), '<span style="color:#ffff21;">', '</span>'), WPT_CAPABILITY, 'https://github.com/codersaiful/woo-product-table' );
add_submenu_page( 'edit.php?post_type=wpt_product_table', esc_html__( 'FAQ & Support page - Contact With US', 'wpt_pro' ), sprintf( esc_html__( 'FAQ %s& Contact%s', 'wpt_pro' ), '<span style="color:#ff8921;">', '</span>'), WPT_CAPABILITY, 'wpt_fac_contact_page', 'wpt_fac_support_page' );
add_submenu_page( 'edit.php?post_type=wpt_product_table', esc_html__( 'GET PRO VERSION', 'wpt_pro' ), __( '<i>Get <strong>Pro</strong></i>', 'wpt_pro' ), WPT_CAPABILITY, 'https://codecanyon.net/item/woo-product-table-pro/20676867?ref=CodeAstrology&utm_source=WPT_Installed_Plugin' );
add_submenu_page( 'edit.php?post_type=wpt_product_table', esc_html__( 'GET PRO VERSION', 'wpt_pro' ), __( '<i>Get <strong>Pro</strong></i>', 'wpt_pro' ), WPT_CAPABILITY, 'https://1.envato.market/e4Jjvz' );
add_submenu_page( 'edit.php?post_type=wpt_product_table', esc_html__( 'Pro Features', 'wpt_pro' ), __( 'Pro Features', 'wpt_pro' ), 'manage_options', 'wpt-pro-features', 'wpt_pro_features_content' );
//add_submenu_page( 'edit.php?post_type=wpt_product_table', esc_html__( 'Browse Plugins', 'wpt_pro' ), __( 'Browse Plugins', 'wpt_pro' ), WPT_CAPABILITY, 'wpt-browse-plugins', 'wpt_browse_all_plugin_list' );
}
Expand Down
15 changes: 14 additions & 1 deletion assets/css/universal.css
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ a.button.wpt_woo_add_cart_button.add_to_cart_button.disabled.loading {
.wpt_search_box{overflow: hidden;}
.wpt_search_box .search_box_wrapper {
display: flex;
align-items: end;
}
.wpt_device_mobile .wpt_search_box .search_box_wrapper {
display: flex;
Expand Down Expand Up @@ -973,6 +974,10 @@ div.wpt_notice_board>div:hover:after {
}
/*Pagination Style End*/
/*------new for per product--------*/
button.single_add_to_cart_button{
position: relative;
}
button.single_add_to_cart_button >span.wpt_ccount,
a.button.wpt_woo_add_cart_button>span.wpt_ccount {
position: absolute;
background: white !important;
Expand Down Expand Up @@ -1860,4 +1865,12 @@ tr.visible_row.wpt_row .col_inside_tag.action {
tr.visible_row.wpt_row .col_inside_tag.action a {
margin-bottom: 5px;
}
tr.visible_row.wpt_row .col_inside_tag.action a:last-child{margin-bottom: inherit;}
tr.visible_row.wpt_row .col_inside_tag.action a:last-child{margin-bottom: inherit;}

/* for cascade filtering */
select.search_select.cascade-filtering {
background: url(../images/loading.gif) #7b7b7b59 no-repeat center center !important;
opacity: 0.4;
cursor: not-allowed;
background-size: 30px !important;
}
19 changes: 10 additions & 9 deletions assets/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
var ajax_url = WPT_DATA.ajax_url;
var site_url = WPT_DATA.site_url;

console.log(WPT_DATA);//Only for Developer
//console.log(WPT_DATA);//Only for Developer
if( ajax_url === 'undefined' ){
console.log( 'WOO PRODUCT TABLE is not Available to this page \nOR:::SORRY!!!!: woocommerce_params is Undefine also ajax_url also undefined. So ajax will not work not. Contact with codersaiful@gmail.com' );
//console.log( 'WOO PRODUCT TABLE is not Available to this page \nOR:::SORRY!!!!: woocommerce_params is Undefine also ajax_url also undefined. So ajax will not work not. Contact with codersaiful@gmail.com' );
return false;
}

Expand Down Expand Up @@ -220,7 +220,7 @@
}
return temp_cjson;
}
console.log(config_json);
//console.log(config_json);
var footer_cart = config_json.footer_cart;
var footer_cart_size = config_json.footer_cart_size;
var footer_possition = config_json.footer_possition;
Expand Down Expand Up @@ -251,7 +251,7 @@
noticeBoard.prepend(eachNoticeInnter);
eachNoticeInnter.fadeIn();
setTimeout(function(){
eachNoticeInnter.fadeOut();
eachNoticeInnter.fadeOut('slow');
eachNoticeInnter.remove();
},notice_timeout); //Detault 3000
}
Expand All @@ -265,7 +265,7 @@
}

$('body').on('click','div.wpt_notice_board>div',function(){
$(this).fadeOut('fast');
$(this).fadeOut('slow');
});

/**
Expand Down Expand Up @@ -1134,7 +1134,7 @@
currentAllSelectedButtonSelector.removeClass('disabled');
currentAllSelectedButtonSelector.removeClass('loading');
tableWrapperTag.removeClass('loading-table');
alert('Please Choose items.');
alert(config_json.please_choose_items);
return false;
}
$.ajax({
Expand Down Expand Up @@ -1249,7 +1249,6 @@
});
}
//******************/

if(typeof fragments.wpt_per_product !== 'string' && typeof fragments.wpt_per_product === 'undefined'){
return false;
}
Expand All @@ -1273,6 +1272,7 @@
$( '.wpt_row_product_id_' + key + ' .wpt_action .wpt_woo_add_cart_button' ).addClass( 'added' );
if(!$('.wpt_ccount.wpt_ccount_' + key ).length){
$( '.wpt_row_product_id_' + key + ' .wpt_action .wpt_woo_add_cart_button' ).append( '<span class="wpt_ccount wpt_ccount_' + key + '">' + value + '</span>' );
$( '.wpt_row_product_id_' + key + ' .single_add_to_cart_button' ).append( '<span class="wpt_ccount wpt_ccount_' + key + '">' + value + '</span>' );
}
});
}else{
Expand Down Expand Up @@ -1707,7 +1707,8 @@
$( thisRow ).attr('data-quantity', Qty_Val);
$( thisRow + ' a.wpt_woo_add_cart_button').attr('data-quantity', Qty_Val);
$( thisRow + ' a.add_to_cart_button ').attr('data-quantity', Qty_Val);

var Item_URL = '?add-to-cart=' + product_id + '&quantity=' + Qty_Val;
$( thisRow + ' a.add_to_cart_button ').attr('href', Item_URL);
var targetTotalSelector = $('#table_id_' + temp_number + ' .product_id_' + product_id + ' .wpt_total_item.total_general');


Expand Down Expand Up @@ -2361,7 +2362,7 @@
if (itemAmount < 1) {
currentAllSelectedButtonSelector.removeClass('disabled');
currentAllSelectedButtonSelector.removeClass('loading');
alert('Please Choose items.');
alert(config_json.please_choose_items);
return false;
}
currentAllSelectedButtonSelector.removeClass('disabled');
Expand Down
37 changes: 36 additions & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,41 @@ function wpt_per_item_fragment($fragments)
}
}

//add_filter( 'woocommerce_add_to_cart_fragments', 'wpt_per_variation_item_fragment', 999 , 1 );

if( !function_exists( 'wpt_per_variation_item_fragment' ) ) {
function wpt_per_variation_item_fragment($fragments)
{
ob_start();
$Cart = WC()->cart->cart_contents;
$product_response = false;
if( is_array( $Cart ) && count( $Cart ) > 0 ){
foreach($Cart as $perItem){
//var_dump($perItem);
$pr_id = (String) $perItem['variation_id'];
$pr_id = apply_filters( 'wpto_id_of_item', $pr_id, $perItem );
$pr_value = (String) $perItem['quantity'];
$product_response[$pr_id] = (String) (isset( $product_response[$pr_id] ) ? $product_response[$pr_id] + $pr_value : $pr_value);
}
}

if( is_array( $product_response ) && count( $product_response ) > 0 ){
foreach( $product_response as $key=>$value ){
$pr_id = (String) $key;
$pr_value = (String) $value;
$fragments["span.wpt_ccount.wpt_ccount_$pr_id"] = "<span class='wpt_ccount wpt_ccount_$pr_id'>$pr_value</span>";
}
}
$footer_cart_link = apply_filters( 'wpto_footer_cart_link', wc_get_cart_url() );
$fragments['.wpt-footer-cart-wrapper>a'] = '<a href="' . $footer_cart_link . '">' . WC()->cart->get_cart_subtotal() . '</a>';
echo wp_json_encode($product_response);

$fragments["wpt_per_product"] = ob_get_clean();
//WC_AJAX::get_refreshed_fragments();
return $fragments;
}
}

/**
* Displays or retrieves the HTML dropdown list of categories.
*
Expand Down Expand Up @@ -1634,7 +1669,7 @@ function wpt_b2bking_plugin_integration( $args ){

// set products to visible b2bking products (at group or user level)
$b2bking_visible_ids = get_transient('b2bking_user_'.$user_id.'_ajax_visibility');
$b2bking_visible_ids = $args['post__in'] && is_array( $args['post__in'] ) ? array_intersect($args['post__in'], $b2bking_visible_ids): $b2bking_visible_ids;
$b2bking_visible_ids = isset( $args['post__in'] ) && is_array( $args['post__in'] ) ? array_intersect($args['post__in'], $b2bking_visible_ids): $b2bking_visible_ids;
$args['post__in'] = $b2bking_visible_ids;
}
}
Expand Down
8 changes: 5 additions & 3 deletions includes/items/action.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php
$wpt_single_action = false;
if( $table_type == 'advance_table'){

woocommerce_template_single_add_to_cart();

if ($product_type != 'variation') {
woocommerce_template_single_add_to_cart();
}else{
woocommerce_template_loop_add_to_cart();
}
}else{
$variation_in_action = false;
if( 'variable' == $product_type && is_array( $table_column_keywords ) && count( $table_column_keywords ) > 1 ){
Expand Down
6 changes: 6 additions & 0 deletions includes/items/advanced_action.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
if ($product_type != 'variation') {
woocommerce_template_single_add_to_cart();
}else{
woocommerce_template_loop_add_to_cart();
}
4 changes: 2 additions & 2 deletions includes/shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ function wpt_shortcode_generator( $atts = false ) {
if($table_type != 'normal_table'){
//unset( $enabled_column_array['price'] );
unset( $enabled_column_array['variations'] );
unset( $enabled_column_array['total'] );
unset( $enabled_column_array['quantity'] );
//unset( $enabled_column_array['total'] );
//unset( $enabled_column_array['quantity'] );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 class="project-tagline"></h2>
<section class="main-content">
<p>=== Woo Product Table - Free WooCommerce Table view solution ===
Contributors: codersaiful,codeastrology
Donate link: <a href="https://codecanyon.net/item/woo-product-table-pro/20676867?ref=CodeAstrology&utm_source=WPT_Installed_Plugin">https://codecanyon.net/item/woo-product-table-pro/20676867</a>
Donate link: <a href="https://1.envato.market/e4Jjvz">https://codecanyon.net/item/woo-product-table-pro/20676867</a>
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.3.2
Expand All @@ -33,7 +33,7 @@ <h2 class="project-tagline"></h2>
<p>== Description ==
Auto Responsive Mobile &amp; Tab, Nice Design, Fast Speed <em>WooCommerce Product Table</em>. Tiny Shortcode, Easy customizable, Ajax Add to cart, Ajax Search, Pagination &amp; Load More.
<em>Woo Product Table - Free WooCommerce Table view solution</em> offers to show all products display as a table in page by light shortcode. Fully responsive and mobile friendly. Easily customizable - color,background,title,text color etc.</p>
<p><strong><a href="https://codecanyon.net/item/woo-product-table-pro/20676867?ref=CodeAstrology&utm_source=WPT_Installed_Plugin">$10 Discount for Limited Time</a></strong></p>
<p><strong><a href="https://1.envato.market/e4Jjvz">$10 Discount for Limited Time</a></strong></p>
<p><strong>Demo List</strong></p>
<ul>
<li>
Expand Down
12 changes: 10 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ 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, wooproducttable,woocommerce product table, product table, wc table, quick order table, wholesale table, restaurants table
Requires at least: 4.0.0
Tested up to: 5.8.2
Stable tag: 3.0.8
Tested up to: 5.9
Stable tag: 3.1.0
Requires PHP: 5.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -211,6 +211,14 @@ You can easily show specific category products. While creating new table click o

== Changelog ==

= 3.0.9 =
* Variation table position controller
* Bug Fix

= 3.0.8 =
* CSS issue solved
* Bug Fix

= 3.0.7 =
* Fixed: YITH Quote Request Premium button issue has been solved.
* Fixed: Auto Responsive - column label show hide issue solved.
Expand Down
11 changes: 6 additions & 5 deletions woo-product-table.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
/**
* Plugin Name: Product Table for WooCommerce - (wooproducttable)
* Plugin URI: https://codecanyon.net/item/woo-product-table-pro/20676867?ref=CodeAstrology&utm_source=WPT_Installed_Plugin
* Plugin URI: https://wooproducttable.com/
* Description: WooCommerce all products display as a table in one page by shortcode. Fully responsive and mobile friendly. Easily customizable - color,background,title,text color etc.
* Author: CodeAstrology
* Author URI: https://profiles.wordpress.org/codersaiful/
* Tags: woocommerce product list,woocommerce product table, wc product table, product grid view, inventory, shop product table
*
* Version: 3.0.8
* Version: 3.1.0
* Requires at least: 4.0.0
* Tested up to: 5.8.2
* Tested up to: 5.9
* WC requires at least: 3.0.0
* WC tested up to: 5.9.0
* WC tested up to: 6.1.1
*
* Text Domain: wpt_pro
* Domain Path: /languages/
Expand All @@ -30,7 +30,7 @@
}

if( !defined( 'WPT_DEV_VERSION' ) ){
define( 'WPT_DEV_VERSION', '3.0.8.1' );
define( 'WPT_DEV_VERSION', '3.1.0.0' );
}

if( !defined( 'WPT_CAPABILITY' ) ){
Expand Down Expand Up @@ -112,6 +112,7 @@
'serial_number' => __( 'SL', 'wpt_pro' ),
'action' => __( 'Action', 'wpt_pro' ),
'freeze' => __( 'Freeze Colum', 'wpt_pro' ),
'advanced_action' => __( 'Advanced Action', 'wpt_pro' ),
);
$column_array = apply_filters( 'wpto_default_column_arr', $column_array );
WPT_Product_Table::$columns_array = $column_array;
Expand Down