Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1195157

    Oscar
    Participant

    Hello, I am using X-theme for my client site you can see from this link: http://intercambioesportivo.com/

    I always find the answers in the forum before making a post, this is my first, I had found the answer to my question on another topic, but in my case is quite incomplete.

    You can see here (https://community.theme.co/forums/topic/remove-cart-icon-on-add-to-cart-button/)

    I added the CSS code to subscribe to the text:

    .woocommerce .button.product_type_simple:before, 
    .woocommerce .button.single_add_to_cart_button:before, 
    .woocommerce-page .button.product_type_simple:before, 
    .woocommerce-page .button.single_add_to_cart_button:before {
        content: "Inscrever-se" !important;
        margin-right: 5px;
    }

    but I still have the original text of the button. I would like to remove this text. I imagine it’s silly, I feel even a little silly to ask about it, but it would help a lot!

    My regards

    #1195169

    Lely
    Moderator

    Hi There,

    Please update above CSS to this:

    .woocommerce .button.product_type_simple:before, .woocommerce .button.single_add_to_cart_button:before, .woocommerce-page .button.product_type_simple:before, .woocommerce-page .button.single_add_to_cart_button:before {
        content: "Inscrever-se" !important;
        margin-right: 5px;
        font-size: 14px !important;
        padding: 1em 3em !important;
        color: #ffffff !important;
    }

    Then also add this:

    .woocommerce .button.product_type_simple, .woocommerce .button.single_add_to_cart_button, .woocommerce-page .button.product_type_simple, .woocommerce-page .button.single_add_to_cart_button {
        color: transparent;
    }

    Hope this helps.

    #1195866

    Oscar
    Participant

    Hi!

    Lely my friend, the original text still here, look:

    #1195949

    Darshana
    Moderator

    Hi there,

    To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    #1195956

    Oscar
    Participant

    Ok, no problem 🙂

    http://intercambioesportivo.com/

    #1196122

    Rupok
    Member

    Hi there,

    Sorry for the confusion. That’s you already provided earlier. Kindly provide the exact URL in question. Your site is not loading properly so can’t navigate the pages to find the page in question.

    Thanks!

    #1196257

    Oscar
    Participant
    #1196752

    Rue Nel
    Moderator

    Hello There,

    To resolve this issue, please add the following JS code in the customizer, Appearance > Customize > Custom > Javascript

    (function($){
      $('.single-product .single_add_to_cart_button').text('');
    })(jQuery);

    Hope this helps. Please let us know how it goes.

    #1197366

    Oscar
    Participant

    Sorry friend, but had no effect. Look: http://www.intercambioesportivo.com/inscricoes-seletivas/

    I’m really stuck on this problem, I hope you can help me.

    I think not change the name of any class, but I have added an extension of woocomence: Registrations for WooCommerce. (additional information)

    #1197549

    Oscar
    Participant
    This reply has been marked as private.
    #1197791

    Jade
    Moderator

    Hi there,

    Yes, kindly provide us with the admin details. You can use any temporary email for the test user then provide us with the credentials.

    Thank you.

    #1198037

    Oscar
    Participant
    This reply has been marked as private.
    #1198224

    Rad
    Moderator

    Hi there,

    How about just changing the text through Woocommerce filter? Example add this code to your child theme’s functions.php

    function custom_woocommerce_product_add_to_cart_text() {
    	global $product;
    	
    	$product_type = $product->product_type;
    	
    	switch ( $product_type ) {
    		case 'external':
    			return __( 'Buy product', 'woocommerce' );
    		break;
    		case 'grouped':
    			return __( 'View products', 'woocommerce' );
    		break;
    		case 'simple':
    			return __( 'Inscrever-se', 'woocommerce' );
    		break;
    		case 'variable':
    			return __( 'Select options', 'woocommerce' );
    		break;
    		default:
    			return __( 'Read more', 'woocommerce' );
    	}
    	
    }
    add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
    

    Then hide the icon like

    .woocommerce .button.product_type_simple:before, 
    .woocommerce .button.single_add_to_cart_button:before, 
    .woocommerce-page .button.product_type_simple:before, 
    .woocommerce-page .button.single_add_to_cart_button:before {
        display: none;
    }

    Hope this helps.

    #1199575

    Oscar
    Participant

    Hello!

    Thanks, worked perfectly for the product list. In the single product continues the original text of woocommerce (in Portuguese).

    #1199877

    Paul R
    Moderator

    Hi,

    You can add this in your child theme’s functions.php file.

    
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' );    // 2.1 +
     
    function woo_custom_cart_button_text() {
     if( x_is_product() ){
            return __( 'My Button Text', 'woocommerce' );
     }
    }
    

    Change My Button Text with your test.

    Hope that helps