New Landing How can we help? Atelier Change Added to Cart Tooltip Text

Viewing 15 posts - 1 through 15 (of 16 total)
  • Posted in: Atelier
  • #317229
    jutescycle
    Member
    Post count: 51

    Anyone know how to change these?

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

    Hi,

    Do you want to translate or simply change the text?

    Thanks.

    #317233
    jutescycle
    Member
    Post count: 51

    I want to change the text to something like ‘Add to Bag’

    Thanks

    #317239
    David Martin – Support
    Moderator
    Post count: 20834

    1) Please install and activate the supplied child theme, inside the child theme folder create a new directory /woocommerce/loop.

    2) Within the new directory folder /loop/ create a new file called add-to-cart.php.

    3) Within the new file add-to-cart.php paste this code: https://gist.github.com/webadelic/1b33cb2a4c5ff7e5531683ebf7214ac7

    4) Search for your text “Add to cart” and replace with your new text.

    #317240
    jutescycle
    Member
    Post count: 51

    Perfect! Thank you!

    #317241
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    No problem. Thanks David.

    -Rui

    #318298
    jutescycle
    Member
    Post count: 51

    Hi Again! 🙂

    Follow up question.

    Will it be possible to change the cart texts on the cart page? Also on the View Cart button when you hover on the cart icon?

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

    yes, this would require you to edit multiple templates/functions.

    The templates are within: atelier/woocommerce/. To override those you would move them to the child theme.

    The cart function is called: sf_get_cart() and is located within: /atelier/swift-framework/core/sf-header.php

    #318726
    jutescycle
    Member
    Post count: 51

    Hi David,

    I tried changing the texts on sf-header.php but is not updating front-end.

    Also can i move this to the child theme?

    Thanks.

    #318752
    David Martin – Support
    Moderator
    Post count: 20834

    You move the PHP function sf_get_cart() to the child theme functions.php file.

    Once you have made edits you will need to add/remove update items in the cart to refresh the Woo AJAX cart fragment.

    #318769
    jutescycle
    Member
    Post count: 51

    Ok so i pasted this code in the functions.php child theme, and did the refresh AJAX cart fragment. i did see the tooltip change for like half second then back to original text.

    Is this correct?

    Thank you.

    Edit: Code removed, please use a code sharing service such as Github gist.

    #318773
    David Martin – Support
    Moderator
    Post count: 20834

    Can you add your FTP details?

    Thanks.

    #318786
    jutescycle
    Member
    Post count: 51
    This reply has been marked as private.
    #318959
    David Martin – Support
    Moderator
    Post count: 20834

    Thanks, you also need to add this function sf_woo_header_add_to_cart_fragment() to your child theme functions.php.

    Replace the strings in that function, and then add/remove update items in the cart to refresh the Woo AJAX cart fragment.

    #319057
    jutescycle
    Member
    Post count: 51

    Thanks David. All sorted out.

Viewing 15 posts - 1 through 15 (of 16 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