Skip to content

Commit

Permalink
quick view message done finally
Browse files Browse the repository at this point in the history
  • Loading branch information
codersaiful committed Feb 27, 2024
1 parent 0b6d99d commit b37252c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
11 changes: 11 additions & 0 deletions assets/js/wpt-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,5 +582,16 @@ jQuery(function($) {
}
});


$(document.body).on('click','.caqv-open-modal-notfound',function(){
// Show an alert
alert('Quick View by CodeAstrology plugin is required.\nPlease Install and Actvate it.\nPlugin will load on new tab.');

// Open another page in a new tab
var newPageUrl = 'https://wordpress.org/plugins/ca-quick-view/'; // Replace with the actual URL
window.open(newPageUrl, '_blank');
});


});
});
3 changes: 2 additions & 1 deletion includes/items/product_title.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
} elseif($title_variation == 'yith'){
$wpt_single_product_title .= "<a class='wpt_product_title_in_td yith-wcqv-button' data-product_id=" . $data['id'] . " href='#'>" . $the_title . "</a>";
}elseif($title_variation == 'ca_quick_view'){ //Quick View by Code Astrology //https://wordpress.org/plugins/ca-quick-view/
$wpt_single_product_title .= "<a class='wpt_product_title_in_td caqv-open-modal' data-id=" . $data['id'] . " >" . $the_title . "</a>";
$class_name = class_exists('CAWQV_PLUGIN_LITE') ? 'caqv-open-modal' : 'caqv-open-modal-notfound';
$wpt_single_product_title .= "<a class='wpt_product_title_in_td {$class_name}' data-id=" . $data['id'] . " >" . $the_title . "</a>";
}else{
$wpt_single_product_title .= "<span class='wpt_product_title_in_td'>" . $the_title . "</span>";
}
Expand Down
4 changes: 3 additions & 1 deletion includes/items/quick_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
$product_id = $product->get_id();
$qv_button_label = get_option( 'qv_button_label', __( 'Qiuck View', 'woo-product-table' ) );
$qv_button_label = __( $qv_button_label, 'woo-product-table' );

$class_name = class_exists('CAWQV_PLUGIN_LITE') ? 'caqv-open-modal' : 'caqv-open-modal-notfound';
?>
<button type="button" class="caqv-open-modal"
<button type="button" class="<?php echo esc_attr( $class_name ); ?>"
data-id="<?php echo esc_attr($product_id); ?>" >
<i class="btn-icon <?php echo esc_attr(get_option('cawqv_general_section', 'cawqv-icon-search')); ?>"></i>
<span><?php echo esc_html($qv_button_label, 'woo-product-table') ?> </span>
Expand Down
4 changes: 2 additions & 2 deletions includes/items/thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
$tag_end = "</div>";

}elseif($thumb_variation == 'ca_quick_view') {

$tag_start = "<div data-id='{$id}' class='caqv-open-modal'>";
$class_name = class_exists('CAWQV_PLUGIN_LITE') ? 'caqv-open-modal' : 'caqv-open-modal-notfound';
$tag_start = "<div data-id='{$id}' class='{$class_name}'>";
$tag_end = "</div>";

}elseif ($thumb_variation == 'url') {
Expand Down

0 comments on commit b37252c

Please sign in to comment.