Affiliate/external product button not working correctly on Sticky add to cart
-
For reviews I use affiliate/external products. And I also use the ‘Sticky add to cart’ footer element.
However, when I click on the link, it hoovers to the Product button on top of the page instead of following the external link.
I can’t find the cause in the source code, because the button is a link.
I switched the ‘AJAX Add to cart’ option off, but that doesn’t make a difference.
What causes the issue and how can I solve it? Thanks in advance!
Hello,
Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.
Best Regards
Thanks, check private content
Hello,
Please try to add this code to the child theme in the functions.php
file.
add_action(
'wp_enqueue_scripts',
function() {
ob_start();
?>
jQuery(document).ready(function() {
if ( jQuery('.single-product-page').hasClass('product-type-external') ) {
jQuery('.wd-sticky-add-to-cart').off('click');
}
});
<?
$script = ob_get_clean();
wp_add_inline_script( 'wd-sticky-add-to-cart', $script );
},
30
);
Best Regards.
That works, thank you very much!!
Most Welcome!!!.
I’m so happy to hear you are pleased with the Theme and Support. XTEMOS strives to deliver the best customer experience, and it makes our day to hear we have accomplished that.
We count ourselves lucky to have you as a customer. You can always reach us at any time. We are always here to help you.
Thanks for contacting us.
Have a great day.
Topic Closed.
Best Regards.
The topic ‘Affiliate/external product button not working correctly on Sticky add to cart’ is closed to new replies.