New Landing How can we help? Themeforest Theme Support Uplift Change the Add to cart text on the hoover product

Viewing 10 posts - 1 through 10 (of 10 total)
  • Posted in: Uplift
  • #318826
    djbram1
    Member
    Post count: 49

    Hi!

    I’m using the child theme of Uplift. I had changed the name of the Add to cart button on the product page with:

    function sf_custom_cart_button_text() {
    return __( ‘Voeg toe aan winkelwagen’, ‘swiftframework’ );
    }
    add_filter( ‘woocommerce_product_single_add_to_cart_text’, ‘sf_custom_cart_button_text’ );

    But this only change the button on the productpage itself.

    I wan to change the text if you hoover over the product at the shop page (with all the products). It says: At to cart, and after that: Added. That text i want to change.

    How can i do that?

    #318888
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Can you also add this line of code.

    add_filter( 'woocommerce_product_add_to_cart_text', 'sf_custom_cart_button_text' );

    -Rui

    #318894
    djbram1
    Member
    Post count: 49

    Like this?

    function sf_custom_cart_button_text() {
    return __( ‘Voeg toe aan winkelwagen’, ‘swiftframework’ );
    }
    add_filter( ‘woocommerce_product_single_add_to_cart_text’, ‘sf_custom_cart_button_text’ );
    add_filter( ‘woocommerce_product_add_to_cart_text’, ‘sf_custom_cart_button_text’ );

    Because it is not working.

    Thanks

    #319067
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Do you mean change the button text on button hover or once a product has been added change the “Added” text?

    #319073
    djbram1
    Member
    Post count: 49

    This text, and the text if you click it, so Added..

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #319294
    David Martin – Support
    Moderator
    Post count: 20834

    1) Please install and activate the supplied child theme, inside the child theme folder create this new folder/file structure /woocommerce/loop/add-to-cart.php

    2) Inside the the new add-to-cart.php add this code: https://gist.github.com/webadelic/4e4d042e57c7a6b1ba81afb829c7b624.

    3) Search through that code and update your required strings, ex:

    		$loading_text = __( 'Adding...', 'uplift' );
    		$added_text = __( 'Item added', 'uplift' );
    		$added_text_short = __( 'Added', 'uplift' );
    		$added_tooltip_text = __( 'Added to cart', 'uplift' );
    #319827
    djbram1
    Member
    Post count: 49

    Yes this worked for the adding proces.

    $loading_text = __( ‘Adding…’, ‘uplift’ );
    $added_text = __( ‘Item added’, ‘uplift’ );
    $added_text_short = __( ‘Added’, ‘uplift’ );
    $added_tooltip_text = __( ‘Added to cart’, ‘uplift’ );

    The button itself, stays at ‘add to cart’ how can i change this? (like my last screenshot)

    #320102
    David Martin – Support
    Moderator
    Post count: 20834

    Can you add your FTP details?

    Thanks.

    #321089
    djbram1
    Member
    Post count: 49
    This reply has been marked as private.
    #321347
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    You need to change the text in the file: /woocommerce/loop/add-to-cart.php. Search for all instances of “Add to cart”. I added xx to illustrate this, I have now removed it.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register