Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor James Koster

    (@jameskoster)

    You can remove the Read More button on product archives with the following snippet;

    add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );

    Keep in mind that will remove all add to cart buttons on these pages too.

    Thread Starter asmukar

    (@asmukar)

    thank you for posting this snippet, Although it did not work for me. i added it to the function.php file and even tried using the code snippet plugin. no luck :/

    Plugin Contributor James Koster

    (@jameskoster)

    Hmm, maybe the read more link is coming from you theme rather than WooCommerce. (Both potentially insert ‘Read More’ links).

    Could you share a URL to your site?

    Thread Starter asmukar

    (@asmukar)

    yes, that is highly possible.

    here is the URL to my site. thanks 🙂

    http://www.rajmineralsinc.com

    Hi Asmukar!
    You can hide those buttons into add-to-cart.php.

    It works fine with me…

    <?php /*?><a href="<?php echo apply_filters( 'out_of_stock_add_to_cart_url', get_permalink( $product->id ) ); ?>" class="button"><?php echo apply_filters( 'out_of_stock_add_to_cart_text', __( 'Read More', 'woocommerce' ) ); ?></a>
    
    <?php else : ?>
    
    	<?php
    		$link = array(
    			'url'   => '',
    			'label' => '',
    			'class' => ''
    		);
    
    		$handler = apply_filters( 'woocommerce_add_to_cart_handler', $product->product_type, $product );
    
    		switch ( $handler ) {
    			case "variable" :
    				$link['url'] 	= apply_filters( 'variable_add_to_cart_url', get_permalink( $product->id ) );
    				$link['label'] 	= apply_filters( 'variable_add_to_cart_text', __( 'Select options', 'woocommerce' ) );
    			break;
    			case "grouped" :
    				$link['url'] 	= apply_filters( 'grouped_add_to_cart_url', get_permalink( $product->id ) );
    				$link['label'] 	= apply_filters( 'grouped_add_to_cart_text', __( 'View options', 'woocommerce' ) );
    			break;
    			case "external" :
    				$link['url'] 	= apply_filters( 'external_add_to_cart_url', get_permalink( $product->id ) );
    				$link['label'] 	= apply_filters( 'external_add_to_cart_text', __( 'Read More', 'woocommerce' ) );
    			break;
    			default :
    				if ( $product->is_purchasable() ) {
    					$link['url'] 	= apply_filters( 'add_to_cart_url', esc_url( $product->add_to_cart_url() ) );
    					$link['label'] 	= apply_filters( 'add_to_cart_text', __( 'Add to cart', 'woocommerce' ) );
    					$link['class']  = apply_filters( 'add_to_cart_class', 'add_to_cart_button' );
    				} else {
    					$link['url'] 	= apply_filters( 'not_purchasable_url', get_permalink( $product->id ) );
    					$link['label'] 	= apply_filters( 'not_purchasable_text', __( 'Read More', 'woocommerce' ) );
    				}
    			break;
    		}
    <?php */?>

    I hope will be useful!!

    Thread Starter asmukar

    (@asmukar)

    Hi Lehi,

    thank you soo Much!!!!! this worked for me 🙂

    i removed the following line from add-to-cart.php.

    echo apply_filters( ‘woocommerce_loop_add_to_cart_link’, sprintf(‘%s‘, esc_url( $link[‘url’] ), esc_attr( $product->id ), esc_attr( $product->get_sku() ), esc_attr( $link[‘class’] ), esc_attr( $product->product_type ), esc_html( $link[‘label’] ) ), $product, $link );

    thanks again 🙂

    Hi Everyone.
    I Want To Remove My “Readmore” Option who display in every post
    But He Didn’t Removed
    It’s My Site
    http://www.hafiz786.com
    Plz Anybody Send Me Reply To Remove Ream More
    Thanks

    – Go to folder: plugins/woocommerce/assets/css/woocommerce.css
    – Search for this:
    “.woocommerce a.button,.woocommerce button.button,.woocommerce input.button,.woocommerce #respond input#submit,.woocommerce #content input.button,.woocommerce-page a.button,.woocommerce-page button.button,.woocommerce-page input.button,.woocommerce-page #respond input#submit,.woocommerce-page #content input.button”

    – Change “display:in-line block” into “display:none”

    Shouldn’t it be remove_action and not add_action ? It worked for me.

    Hi!
    In my add-to-cart.php file or woocommerce.css file none of the sentence you write are there.
    What am I doing wrong?
    Please, be detailed. Im a graphic designer fighting for the first time with WP!
    Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Remove "Read More" button for Products’ is closed to new replies.