Last active
March 5, 2019 21:40
-
-
Save akther80/cd3ca6ae5dcf80f5ea49357e7adf61a0 to your computer and use it in GitHub Desktop.
Tooltip for Single Product Page Wishlist in Unicase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_enqueue_scripts', 'uc_enqueue_child_script' ); | |
function uc_enqueue_child_script() { | |
global $unicase_version; | |
if( apply_filters( 'unicase_load_all_minifed_js', true ) ) { | |
$dep = 'unicase-all'; | |
} else { | |
$dep = 'unicase-js'; | |
} | |
wp_enqueue_script( 'uc-child-script', get_stylesheet_directory_uri() . '/assets/js/uc-child-scripts.js', array( $dep ), $unicase_version, true ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
"use strict"; | |
$(document).ready(function () { | |
$( '.single-product .entry-summary .price-container .action-buttons .add_to_wishlist, .single-product .entry-summary .price-container .action-buttons .yith-wcwl-wishlistaddedbrowse > a, .single-product .entry-summary .price-container .action-buttons .yith-wcwl-wishlistexistsbrowse > a, .single-product .entry-summary .price-container .action-buttons a.compare' ).each( function() { | |
$( this ).attr( 'data-toggle', 'tooltip' ); | |
$( this ).attr( 'title', $( this ).text().trim() ); | |
$( this ).tooltip( { placement: 'bottom' } ); | |
}); | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment