Skip to content

Instantly share code, notes, and snippets.

@akther80
Last active March 5, 2019 21:40
Show Gist options
  • Save akther80/cd3ca6ae5dcf80f5ea49357e7adf61a0 to your computer and use it in GitHub Desktop.
Save akther80/cd3ca6ae5dcf80f5ea49357e7adf61a0 to your computer and use it in GitHub Desktop.
Tooltip for Single Product Page Wishlist in Unicase
<?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 );
}
(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