fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Tooltip text truncated and second tooltip

Wolfgang Dick

Hi there

Can you help me with these two little issues please?

1. the tooltip text is truncated
Example:
as is: Special Edition
to be: Special Edition “COLORPHORIA” – Türkis

2. there is a second ugly tooltip box which I would like to hide

Please see the image below as an explanation. The behavior can also be seen here: https://www.liebesschaukel.ch/produkt/liebesschaukel-shop-lonesome-dragon-private-euphoria/

 

Variation Swatches Issue Tooltips.jpg

Thanks a lot for your support and have a great day!

Wolfgang

 

Hakik Zaman

Hi Wolfgang,

Thanks for reaching out to us. Please add the following CSS at Appearance > Customize > Additional CSS

[data-wvstooltip]:before {
content: attr(data-title) " " attr(data-wvstooltip-out-of-stock);
}

Add the following snippet using the Code Snippets plugin or add it inside your current child theme’s functions.php file-

add_action('wp_footer', function(){
?>
<script id="gwp-remove-title-support">
jQuery('li.variable-item').removeAttr("title");
</script>
<?php
}, 99);

Note: It is recommended to add the Custom Code to the child theme’s functions.php file, to avoid any data loss while updating the Parent Theme.

Thank You

Wolfgang Dick

Hi Hakik, thanks a lot for your reply and the codes. You guys are wizards, it works perfectly!

Just one little thing: is it possible to remove the stock status text in the tooltip? Now the tooltip text is too long for mobile screens.

Please have a look into the screenshot with an example. Would it be possible to always remove the stock status – in the example it is out of stock “(nicht verfügbar)” in the tooltip text? The stock status is written in red letters anyways under the swatches.

Thank you very much, have a great day

Wolfgang

Hakik Zaman

Hi Wolfgang,

Unfortunately, the screenshot was not attached.

Please upload your screenshot here- https://paste.pics/ and post directly the screenshot link using this reply box.

Hope to hear from you soon.

Thank You

Hakik Zaman

Hi Wolfgang,

Please add the following snippet using the Code Snippets plugin

add_action( 'woo_variation_swatches_pro_archive_page_loaded', function( $wvs_archive_pro ){
add_filter( 'woo_variation_swatches_js_options', function( $options ){
$options[ 'out_of_stock_tooltip_text' ] = '';
return $options;
}, 99, 1);
});

Note: The above snippet will not work in your theme’s functions.php file. You have to add it using the Code Snippets plugin.

Please let me know if it helps.

Thank You

Wolfgang Dick

Wow, that works like a charm – thank you so much Hakik!