I am trying to print a message (link) through PHP if a div is present on a page. Basically the div is present on some product pages on an ecommerce website, while it is not present on other product pages. The ecommerce is a Woocommerce and that's why I am using Woo hooks in the code.
Basically I get nothing in return (even when visiting pages where the div is present). What am I missing?
add_filter('woocommerce_before_add_to_cart_button', 'size_guide_display', 15);
function size_guide_display() {
$sizeguide = $html->find("div#tab-SizeChart_tab");
if ($sizeguide) :
echo '<a href="#tab-SizeChart_tab" title="Storleksguide" class="size_guide_link">Storleksguide</a>';
endif;
}
I'll be very happy for any reply :-) Pretty novice with PHP.
Thanks!