WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Remove "Read More" button for Products (11 posts)

  1. asmukar
    Member
    Posted 1 year ago #

    Hi,

    i am trying to remove "Read More" button from the products. is there a setting change that i need to make? or do i have to change something in the file? PLEASE HELP!!

    http://wordpress.org/extend/plugins/woocommerce/

  2. jameskoster
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. asmukar
    Member
    Posted 1 year ago #

    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 :/

  4. jameskoster
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  5. asmukar
    Member
    Posted 1 year ago #

    yes, that is highly possible.

    here is the URL to my site. thanks :)

    http://www.rajmineralsinc.com

  6. Lehi
    Member
    Posted 1 year ago #

    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!!

  7. asmukar
    Member
    Posted 1 year ago #

    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 :)

  8. malikawais
    Member
    Posted 11 months ago #

    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

  9. sp326
    Member
    Posted 11 months ago #

    - 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"

  10. simasvelez
    Member
    Posted 5 months ago #

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

  11. elsebito
    Member
    Posted 3 months ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.