I am trying to add a button to my product pages that when clicked it will scroll down to the description tab. I looked at another topic and grabbed the code below, but it is just taking me back to the same page instead of going down to the tab.

add_action('woocommerce_after_add_to_cart_button','cmk_additional_button');
function cmk_additional_button() {
$productID = get_the_ID();
$yourCustomLinkValue =  get_post_meta($productID,'#tab-decription',true);
echo '<a href="'.$yourCustomLinkValue.'">Read More About Item</a>';    
}

The description tab does have the id of #tab-description

Read more here: Adding button after add to cart button WooCommerce


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: