On a single product page, I would like to add more information icon (i or ?) on a specific pa_attribute. So if you click on a ? icon you will see a pop up for more information about that specific attribute. (example:https://laadkompas.nl/offerte-aanvraag-1/?car-type=Universeel%2C+verschillende+elektrische+auto%27s&installatie=Ja&compire=Thuislocatie)
I did some research but I could not compile the code, because I could not get a specific php pa_attribute.
Iv found this code: but its not related on an pa=attribute and its a Tooltip.
add_action( 'woocommerce_before_variations_form', 'krank_custom_action', 2 );
function krank_custom_action() {
echo ' <button class="krank-tooltip ttone" type="button" data-toggle="tooltip" data-placement="top" title="this is a text ">?</button>
Can somebody compile this code to get a specific pa attribute with a extra information tooltip or a popup on a single product page (Woocommerce)?
2
Answers
I did some research and found the right code. Its related on a specific pa_attribute but now I need it make the icon (?) clickable and get more information about that specific product attribute.
Can somebody make a clickable tooltip on that specific attribute to get more information?
I was in same situation and your question and answer helped me alot. I share my final work here maybe helful for someoneelse later:
I prefered to use
fontawsome
icons in my situation rather than loading an image and also based on my template opportunities I used to execute mytemplate shortcode
(my theme is flatsome with ux-builder) to achieve what I wanted (and same thing you asked for):