Hi,
if you want to add a link/button to open compare table try to add this code on your theme functions.php. This code create a shortcode that print a button to open compare
add_shortcode('custom_compare_button', 'add_custom_compare_button' );
function add_custom_compare_button(){
global $yith_woocompare;
if( is_admin() || is_null( $yith_woocompare ) ) {
return '';
}
$link = $yith_woocompare->obj->view_table_url();
return '<a href="' . $link . '" class="button">View Compare</a>';
}
Then you can use it like this [custom_compare_button] or in code using this:
echo do_shortcode('[custom_compare_button]');
Let me know, regards. 🙂
Thank you so much for your Help and this Great Plugin
How to amend the Compare URL link so that it opens into a popup window?
Please advise. Thank you.
After looking through “/yith-woocommerce-compare/assets/js/woocompare.js”, I found a hint between lines 166 and 171.
In the end, I just inserted this attribute, class="yith-woocompare-open" into the HTML a tag, and it works. Yahoo! \(>_<)/