• How to remove Wishlist button from the Compare view? Can’t seem to find the lines in the code to do this. Removing it because Premium Wishlist and Compare don’t work together.

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,
    which theme are you using? I suppose that the wishlist button is near add to cart button. So I think that the issue is here. Compare prints add to cart button using this WooCommerce function woocommerce_template_loop_add_to_cart that use template loop/add-to-cart.php.
    You can solve this issue in three different way:
    1. Hide wishlist button using css
    2. Customize the template loop/add-to-cart.php and remove wishlist button
    3. Overwrite compare.php template (wp-content/plugins/yith-woocommerce-compare/templates ) on your theme (wp-content/themes/theme-name/woocommerce) and change function woocommerce_template_loop_add_to_cart() to this:

    
    $class = implode( ' ', array_filter( array(
        'button',
        'product_type_' . $product->product_type,
         $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
        $product->supports( 'ajax_add_to_cart' ) ? 'ajax_add_to_cart' : ''
    )));
    
    echo sprintf( '<a rel="nofollow" href="%s" data-quantity="1" data-product_id="%s" data-product_sku="%s" class="%s">%s</a>',
    		esc_url( $product->add_to_cart_url() ),
    		esc_attr( $product->id ),
    		esc_attr( $product->get_sku() ),
    		esc_attr( $class ),
    		esc_html( $product->add_to_cart_text() )
    	);
    

    Let me know, regards. ??

Viewing 1 replies (of 1 total)
  • The topic ‘Remove wishlist buttons’ is closed to new replies.