Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #2847847
Add tooltip to thumbnails
Closed

Comments

  •  6
    Samuel started the conversation

    How can I add a tooltip to the thumbnails images so the title is displayed whenever the user hovers over them?

    Thank you!

  •  6
    Samuel replied

    Just to clarify, I would like only the name of the variation to display on the tooltip and not the whole 'products name + variation name'. 

    Please find a screenshot attached as an example.

  •  767
    Janilyn replied

    Hi Samuel,

    Thank you for contacting WPClever Support Forum. 

    We’ve received your ticket and assigned one of our developers to help you with that. He’ll be looking into your question and responding with specific instructions as soon as possible. 

    Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.

    Best regards.

    PS: I received a piece of news from our developers that we will have a periodic thorough checkup on our system in a few days so customization support might be a bit slow. 

    During the process, there might be some issues concerning the communication and response from us. Don't worry, we will try our best to work on your case to fix the issue as soon as possible.


    Janilyn T. - WPClever Support Agent

  •  1,226
    Dustin replied

    Hi Samuel,

    Yes, I can help you do that.

    Please follow these steps:

    1. Add the below custom code (How to add custom code?)

    add_action( 'wp_enqueue_scripts', 'woosb_enqueue_hint_for_frontend', 99 );
    function woosb_enqueue_hint_for_frontend() {
        wp_enqueue_style( 'hint', WOOSB_URI . 'assets/css/hint.css' );
    }
    add_action( 'woosb_before_item', 'woosb_thumbnail_with_tooltip', 99, 3 );
    function woosb_thumbnail_with_tooltip( $_product, $product, $count ) {
        ?>
        <div class="woosb-thumb hint--top" aria-label="<?php echo esc_attr( $_product->get_name() ); ?>">
            <?php echo $_product--->get_image(); ?>
        </div>
        <?php
    }

    And the result https://www.screencast.com/t/Bz9B5wxinIC

    2. Now, to hide the old product thumbnail, please add below CSS code to WP-Admin → Appearance → Customize → Additional CSS:

    .woosb-product .woosb-thumb:nth-child(2) {
        display: none !important;
    }

    And the result https://www.screencast.com/t/SEfbSZ5nu

    Best regards,
    Dustin