• The plugin looks really promising.

    We’re using a custom product archive listing template (archive-product.php). And would like to add the compare button on each item of the grid/list. Enabled the option “Manually set Compare button position” in the admin and then copied the code <?php if ( function_exists(‘woo_add_compare_button’ ) ) echo woo_add_compare_button(); ?> on the listing template.

    However, the button/link for compare did not show up.

    Help solicited…

    https://wordpress.org/plugins/woocommerce-compare-products/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I found a solution to add the Compare hyperlink under each product listed on the Product Category page (archive page). I hope it will help you:

    In my child-theme, in the functions.php file I added this:
    function vald_add_compare_button() {
    if ( function_exists(‘woo_add_compare_button’ ) ) echo woo_add_compare_button();
    }
    add_action( ‘woocommerce_after_shop_loop_item_title’, ‘vald_add_compare_button’ );

    The problem is that both the Compare link and the Compare button are displayed, so I added this style in my child-theme CSS:
    .woo_grid_compare_button_container {
    display:none;
    }

    I hope this is a correct solution. Probably not the best, but it works for me.

    Thread Starter vagu71

    (@vagu71)

    I’m afraid I moved away from archive-product.php for this particular project where I faced this issue. But your solution looks promising. I will try and add this code to the next woocommerce gig and try and use archive-product.php. Will let you know how it goes.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compare Button on Product Archive’ is closed to new replies.