Skip to content

Commit

Permalink
Merge pull request #330 from codersaiful/3.4.9.0
Browse files Browse the repository at this point in the history
3.4.9.0
  • Loading branch information
codersaiful authored May 7, 2024
2 parents b3818e8 + 29162aa commit c0db75f
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 23 deletions.
17 changes: 10 additions & 7 deletions admin/action-hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -1046,12 +1046,15 @@ function wpt_configure_label_part($settings, $current_config_value,$field_name){
* @return void
*/
function wpt_configure_external_part( $settings,$current_config_value,$field_name ){
if( ! defined( 'YITH_WCQV_VERSION' ) ) return;
$display = '';
if( ! defined( 'YITH_YWRAQ_VERSION' ) ){
$display = 'display:none';
}

$page = isset( $settings['page'] ) ? $settings['page'] : 'not_set_page';

?>
<div class="wpt-section-panel basic-settings yith <?php echo esc_attr( $page ); ?>" id="wpt-yith-settings">
<div class="wpt-section-panel basic-settings yith <?php echo esc_attr( $page ); ?>" id="wpt-yith-settings" style="<?php echo esc_attr( $display ); ?>">
<table class="wpt-my-table basic-setting-table">
<thead>
<tr>
Expand All @@ -1074,7 +1077,7 @@ function wpt_configure_external_part( $settings,$current_config_value,$field_nam
<label for="wpt_table_quick_view_btn_text" class="wpt_label"><?php echo sprintf(esc_html__( '%s[Quick View]%s - Button Text', 'woo-product-table' ), '<b>', '</b>' ); ?></label>
</div>
<div class="form-field col-lg-6">
<input name="<?php echo esc_attr( $field_name ); ?>[quick_view_btn_text]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['quick_view_btn_text'] ); ?>" id="wpt_table_quick_view_btn_text" type="text" placeholder="<?php esc_attr_e( 'eg: Quick View', 'woo-product-table' ); ?>">
<input name="<?php echo esc_attr( $field_name ); ?>[quick_view_btn_text]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['quick_view_btn_text'] ?? __( 'Quick View', 'woo-product-table' ) ); ?>" id="wpt_table_quick_view_btn_text" type="text" placeholder="<?php esc_attr_e( 'eg: Quick View', 'woo-product-table' ); ?>">
</div>
</div>
</td>
Expand All @@ -1092,7 +1095,7 @@ function wpt_configure_external_part( $settings,$current_config_value,$field_nam
<label for="wpt_table_yith_browse_list" class="wpt_label"><?php echo sprintf(esc_html__( '%s[Browse Quote list]%s - text ', 'woo-product-table' ), '<b>', '</b>' ); ?></label>
</div>
<div class="form-field col-lg-6">
<input name="<?php echo esc_attr( $field_name ); ?>[yith_browse_list]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['yith_browse_list'] ); ?>" id="wpt_table_yith_browse_list" type="text" placeholder="<?php esc_attr_e( 'Browse the list - text write here', 'woo-product-table' ); ?>">
<input name="<?php echo esc_attr( $field_name ); ?>[yith_browse_list]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['yith_browse_list'] ?? __( 'Browse the list', 'woo-product-table' ) ); ?>" id="wpt_table_yith_browse_list" type="text" placeholder="<?php esc_attr_e( 'Browse the list - text write here', 'woo-product-table' ); ?>">
</div>
</div>
</td>
Expand All @@ -1110,7 +1113,7 @@ function wpt_configure_external_part( $settings,$current_config_value,$field_nam
<label for="wpt_table_yith_add_to_quote_text" class="wpt_label"><?php echo sprintf(esc_html__( '%s[Add to Quote]%s - button text', 'woo-product-table' ), '<b>', '</b>' ); ?></label>
</div>
<div class="form-field col-lg-6">
<input name="<?php echo esc_attr( $field_name ); ?>[yith_add_to_quote_text]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['yith_add_to_quote_text'] ); ?>" id="wpt_table_yith_add_to_quote_text" type="text" placeholder="<?php esc_attr_e( 'Add to Quote text write here', 'woo-product-table' ); ?>">
<input name="<?php echo esc_attr( $field_name ); ?>[yith_add_to_quote_text]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['yith_add_to_quote_text'] ?? __( 'Add to Quote', 'woo-product-table' ) ); ?>" id="wpt_table_yith_add_to_quote_text" type="text" placeholder="<?php esc_attr_e( 'Add to Quote text write here', 'woo-product-table' ); ?>">
</div>
</div>
</td>
Expand All @@ -1127,7 +1130,7 @@ function wpt_configure_external_part( $settings,$current_config_value,$field_nam
<label for="wpt_table_yith_add_to_quote_adding" class="wpt_label"><?php echo sprintf(esc_html__( '%s[Quote Adding]%s - text', 'woo-product-table' ), '<b>', '</b>' ); ?></label>
</div>
<div class="form-field col-lg-6">
<input name="<?php echo esc_attr( $field_name ); ?>[yith_add_to_quote_adding]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['yith_add_to_quote_adding'] ); ?>" id="wpt_table_yith_add_to_quote_adding" type="text" placeholder="<?php esc_attr_e( 'Adding text write here', 'woo-product-table' ); ?>">
<input name="<?php echo esc_attr( $field_name ); ?>[yith_add_to_quote_adding]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['yith_add_to_quote_adding'] ?? __( 'Adding', 'woo-product-table' ) ); ?>" id="wpt_table_yith_add_to_quote_adding" type="text" placeholder="<?php esc_attr_e( 'Adding text write here', 'woo-product-table' ); ?>">
</div>
</div>
</td>
Expand All @@ -1145,7 +1148,7 @@ function wpt_configure_external_part( $settings,$current_config_value,$field_nam
<label for="wpt_table_yith_add_to_quote_added" class="wpt_label"><?php echo sprintf(esc_html__( '%s[Quote Added]%s - text ', 'woo-product-table' ), '<b>', '</b>' ); ?></label>
</div>
<div class="form-field col-lg-6">
<input name="<?php echo esc_attr( $field_name ); ?>[yith_add_to_quote_added]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['yith_add_to_quote_added'] ); ?>" id="wpt_table_yith_add_to_quote_added" type="text" placeholder="<?php esc_attr_e( 'Quote Added text write here', 'woo-product-table' ); ?>">
<input name="<?php echo esc_attr( $field_name ); ?>[yith_add_to_quote_added]" class="wpt_data_filed_atts ua_input" value="<?php echo esc_attr( $current_config_value['yith_add_to_quote_added'] ?? __( 'Quote Added', 'woo-product-table' ) ); ?>" id="wpt_table_yith_add_to_quote_added" type="text" placeholder="<?php esc_attr_e( 'Quote Added text write here', 'woo-product-table' ); ?>">
</div>
</div>
</td>
Expand Down
42 changes: 33 additions & 9 deletions admin/page-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ public function admin_menu()
if( ! $this->is_pro ){
add_submenu_page( $this->main_slug, esc_html__( 'GET PRO VERSION', 'woo-product-table' ), __( 'Get <strong>Pro</strong>', 'woo-product-table' ), 'read', 'https://wooproducttable.com/pricing/' );
}
// var_dump($this->license);

//License Menu if pro version is getter or equal V2.0.8.4
// if( is_object( $this->license ) && version_compare($this->pro_version, '2.0.8.4', '>=')){
// add_submenu_page( $this->main_slug, __('Min Max Control License', 'wcmmq_pro'), __( 'License', 'wcmmq_pro' ), $capability, 'wcmmq-license', [$this->license, 'license_page'] );
// }

}

Expand Down Expand Up @@ -159,14 +153,18 @@ public function handle_license_n_update()
$this->license_status_key = 'wpt_pro_license_status';
$this->license_status = get_option( $this->license_status_key );
$this->license_data = get_option($this->license_data_key);


add_action( 'admin_notices', [$this, 'license_activation_message'] );

/**
* Actually if not found lisen data, we will return null here
*
* @since 3.4.3.0
* @author Saiful Islam <[email protected]>
*/
if( empty( $this->license_status ) || empty( $this->license_data ) ) return;

$expires = isset($this->license_data->expires) ? $this->license_data->expires : '';
$this->item_id = isset($this->license_data->item_id) ? $this->license_data->item_id : '';
if('lifetime' == $expires) return;
Expand Down Expand Up @@ -198,9 +196,35 @@ public function handle_license_n_update()
add_action( 'admin_notices', [$this, 'renew_license_notice'] );
}


}

public function license_activation_message()
{

if( ! empty( $_GET['page'] ) && $_GET['page'] === 'woo-product-table-license' ) return;
if(empty($this->item_id)) return;
$wpt_logo = WPT_ASSETS_URL . 'images/logo.png';

if( empty( $this->license_status ) || $this->license_status === 'invalid' || $this->license_status === 'site_inactive' || $this->license_status === 'inactive' ){
$wpt_logo = WPT_ASSETS_URL . 'images/logo.png';

$link_label = __( 'Activate License', 'wpt_pro' );
$link = admin_url('edit.php?post_type=wpt_product_table&page=woo-product-table-license');
$message = esc_html__( ' Please Activate License to get Pro Feature', 'wpt_pro' );
ob_start();
?>
<div class="error wpt-renew-license-notice">
<div class="wpt-license-notice-inside">
<img src="<?php echo esc_url( $wpt_logo ); ?>" class="wpt-license-brand-logo">
Your License of <strong>Woo Product Table pro</strong> is <span style="color: #d00;font-weight:bold;">Invalid/Inactive</span>
%1$s <a href="%2$s">%3$s</a>
</div>
</div>
<?php
$full_message = ob_get_clean();
printf( $full_message, $message, $link, $link_label );
}
}
public function renew_license_notice()
{

Expand All @@ -209,7 +233,7 @@ public function renew_license_notice()
$expired_date = date( 'd M, Y', $this->exp_timestamp );
$link_label = __( 'Renew License', 'wpt_pro' );
$link = "https://codeastrology.com/checkout/?edd_license_key={$this->license_key}&download_id={$this->item_id}";
$message = esc_html__( ' Renew it to get latest update.', 'wpt_pro' ) . '</strong>';
$message = esc_html__( ' Renew it to enable pro features.', 'wpt_pro' ) . '</strong>';
ob_start();
?>
<div class="error wpt-renew-license-notice">
Expand Down
4 changes: 2 additions & 2 deletions admin/post_metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ function wpt_redirect_after_save($location, $post_id) {
*/

if ( ! isset( $_POST['wpt_shortcode_nonce_value'] ) ) { // Check if our nonce is set.
return;
return $location;
}

// verify this came from the our screen and with proper authorization,
// because save_post can be triggered at other times
if( ! wp_verify_nonce( $_POST['wpt_shortcode_nonce_value'], plugin_basename(__FILE__) ) ) {
return;
return $location;
}

$wpt_last_active_tab = $_POST['wpt_last_active_tab'] ?? 'column_settings';
Expand Down
1 change: 1 addition & 0 deletions assets/js/wpt-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jQuery(function($) {
var thisButton = $(this);
var thisPagination = thisButton.closest('.wpt_my_pagination');
var page_number = $(thisButton).text();
page_number = parseInt(page_number.replace(/,/g, ''), 10);
var others = {
page_number: page_number,
isMob: isMob,
Expand Down
9 changes: 6 additions & 3 deletions includes/items/quoterequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

return;
}

$wpt_nonce = wp_create_nonce( 'add-request-quote-' . $data['id'] );
$default_quantity = apply_filters( 'woocommerce_quantity_input_min', 1, $product );
$quote_class = 'enabled';
Expand All @@ -53,13 +54,15 @@
}

$c_product_id = $data['id'];
$Add_to_Quote = $config_value['yith_add_to_quote_text'];//'Add to Quote';
$data_message = '{"text":"'. $Add_to_Quote .'","adding":"' . $config_value['yith_add_to_quote_adding'] . '","added":"' . $config_value['yith_add_to_quote_added'] . '"}';
$Add_to_Quote = $config_value['yith_add_to_quote_text'] ?? __('Add to Quote', 'woo-product-table');//'Add to Quote';
$adding = $config_value['yith_add_to_quote_adding'] ?? __('Adding...', 'woo-product-table');//'Adding...';
$added = $config_value['yith_add_to_quote_added'] ?? __('Added', 'woo-product-table');//'Added';
$data_message = '{"text":"'. $Add_to_Quote .'","adding":"' . $adding . '","added":"' . $added . '"}';

$q_final_class = "{$quote_class} yith_request_temp_{$temp_number}_id_{$data['id']} wpt_yith_add_to_quote_request wpt_add-request-quote-button";

?>
<a data-yith_browse_list='<?php echo esc_attr( $config_value['yith_browse_list'] ); ?>'
<a data-yith_browse_list='<?php echo esc_attr( $config_value['yith_browse_list'] ?? __('Browse the list', 'woo-product-table') ); ?>'
data-response_msg=''
data-msg='<?php echo esc_attr( $data_message ); ?>'
data-wp_nonce='<?php echo esc_attr( $wpt_nonce ); ?>'
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ You can easily show specific category products. While creating new table click o
== Changelog ==

= 3.4.9 =
* Fixed: YITH qutoe request button quantity issue solved.
* Variation List showing on Shop Page for Variable product issue has been fixed
* Fixed: last-active-tab issue has been fixed.
* Bug fixed
Expand Down
14 changes: 12 additions & 2 deletions woo-product-table.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* Plugin Name: Product Table for WooCommerce by CodeAstrology (WooproductTable)
* Requires Plugins: woocommerce
* Plugin URI: https://wooproducttable.com/pricing/?utm_source=WPT+Plugin+Dashboard&utm_medium=Free+Version
* Description: (WooProductTable - woo product table) WooCommerce product table plugin helps you to display your products in a searchable table layout with filters. Boost conversions & sales. Woo Product Table is best for Wholesale. wooproducttable, woo-product-table
* Author: CodeAstrology Team
Expand All @@ -11,7 +12,7 @@
* Requires at least: 4.0.0
* Tested up to: 6.5.2
* WC requires at least: 5.0.0
* WC tested up to: 8.7.2
* WC tested up to: 8.8.3
*
*
* Text Domain: woo-product-table
Expand Down Expand Up @@ -446,6 +447,15 @@ public function init(){
* @author Saiful Islam <[email protected]>
*/
include_once $dir . '/autoloader.php';

/**
* Include Functions
* it was bottom site of this method,
* I have bring at the begining of this method.
*
* @since 3.4.9.0
*/
include_once $this->path('BASE_DIR','includes/functions.php');
//why this file outside of is_admin() actually if we want to show preview, need load outside.
include_once $this->path('BASE_DIR','admin/wpt_product_table_post.php');
if( is_admin() ){
Expand Down Expand Up @@ -501,7 +511,7 @@ public function init(){
*/
//include_once $this->path('BASE_DIR','includes/wpt_product_table_post.php');
include_once $this->path('BASE_DIR','includes/enqueue.php');
include_once $this->path('BASE_DIR','includes/functions.php');

include_once $this->path('BASE_DIR','includes/helper-functions.php');
include_once $this->path('BASE_DIR','includes/shortcode.php');

Expand Down

0 comments on commit c0db75f

Please sign in to comment.