New Landing How can we help? Themeforest Theme Support Dante Change all 'Add to Shopping Bag' text site wide

Viewing 6 posts - 1 through 6 (of 6 total)
  • Posted in: Dante
  • #110993
    mhote
    Member
    Post count: 394

    Hi, similar to this post: http://support.swiftideas.net/forums/topic/change-shop-descriptions/ I’m trying to change the site wide ‘Add to Shopping Bag’ text for Dante. Looking in similar files, I can’t see the needed button text code to change. Any ideas? Thanks

    #111029
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please add this php snippet at functions.php of child theme.

    function sf_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
    case 'Add to Shopping Bag' :
    $translated_text = __( 'Your text', 'woocommerce' );
    break;
    }
    return $translated_text;
    }
    add_filter( 'gettext', 'sf_text_strings', 20, 3 );

    Thanks ๐Ÿ™‚
    With Best Regards
    Mohammad

    Thanks ๐Ÿ™‚
    With Best Regards
    Mohammad

    #111050
    mhote
    Member
    Post count: 394

    Thanks Mohammad!

    #111061
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You most welcome. I’m glad that issue resolved.
    Thanks ๐Ÿ™‚
    With Best Regards
    Mohammad

    #123142
    Pothe
    Member
    Post count: 336

    Hi Mohammad,
    I’ve just tried this on dante 2.67 and woocommerce version 2.1.12. But cannot seem to get it to work. Is it still valid on these versions?

    #123283
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this code:

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

    Hope that should work and let me know your feedback.
    Thanks
    Mohammad

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

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

License required for one of the following items
Login and Registration Log in · Register