New Landing How can we help? Themeforest Theme Support Neighborhood WooCommerce native text hook for "add to cart" or "configure" text

Viewing 15 posts - 1 through 15 (of 37 total)
  • #267663
    guentherportfolio
    Member
    Post count: 266

    Hi,

    I have figured out that the theme doesn’t use the native Woocommerce text hooks for i.e. the “add to cart” text.

    I have products with variations, but the variations were added through an extra plugin. If I now see my shop overview, normally the “add to cart” text will change to “choose” or “configure”, if a product has variations. At the moment, it doesn’t. Is there a way to use the native Woocommerce text option for that? What do I have to change to get that result? Thanks in advance

    Best
    Martin

    #267704
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this plugin https://wordpress.org/plugins/real-time-find-and-replace/ to change the text as you want.
    Thanks
    Mohammad

    #267718
    guentherportfolio
    Member
    Post count: 266

    Hi Mohammad,

    thanks for trying to help. Actually I am looking for the thing I have to change in the theme, to get my desired result. The plugin you have posted is surely the right one to find the different segments, but I don´t have the coding knowledge, to find the thing which I have to change in the theme. That´s why I asked what do I have to change to get that result? Thanks in advance.

    warm regards
    Martin

    #267885
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    If our translations are overriding the Woocommerce ones in specific places you just need to translate those strings in the theme translations files.

    Check this general documentation about translation
    http://neighborhood.swiftideas.com/documentation/#translation

    -Rui

    #267891
    guentherportfolio
    Member
    Post count: 266

    Hi Rui,

    Thanks for your response. It’s not a translation issue. For that cases I use WPML, which guides me through the different strings.

    I have the problem that the “add to cart” text won’t change, if I have variable instead of regular products. Actually it shall change to anything like “configure” or so. In that case, the client knows that he has to choose different options before he can add the product to the cart.

    At the moment the “add to cart” text will stay the same, even if I have a variable product.

    This is a problem which I can solve via an extra options plugin, but in that case, I need the native woo commerce rules. I figured out, that the theme uses other hooks. I hope I could explain the problem a bit better. It is hard for me to describe such a complex issue in English. Thanks for your help.

    Warm regards
    Martin

    #268484
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    ok. thanks for the explanation.

    In that case it should say “Select options” like in our demo
    https://www.dropbox.com/s/wusbz37pcwo1w7u/Screenshot%202016-05-18%2018.00.45.png?dl=0

    But in the product page will say Add to cart but the button is inactive while you don’t select the product attributes in the dropdown.

    https://www.dropbox.com/s/pbsiyhwig62dtbf/Screenshot%202016-05-18%2018.01.35.png?dl=0

    Can you provide me a link to a variable product and will also need admin credentials to look at that product settings.
    Use the private reply.

    -Rui

    #268495
    guentherportfolio
    Member
    Post count: 266
    This reply has been marked as private.
    #269087
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    These are the strings ready for translate in that add to cart section.
    https://www.dropbox.com/s/hdosqgmumtrsar2/Screenshot%202016-05-20%2015.50.26.png?dl=0

    I didn’t understood exactly what appears with the Twenty 16 and not with Neighborhood, if you can provide an image to compare the difference to the current product page that would be great.

    -Rui

    #269202
    guentherportfolio
    Member
    Post count: 266

    Hi Rui,

    thanks for your response. I have deinstalled the Twentysixteen theme, so I can´t show you some examples via screenshot. What I am trying to explain is, that the theme does use other strings than the current version of WooCommerce.

    Here is the answer of the developer.

    ——————————————–

    The screenshot is correct. This is what the theme is using. The problem is that those filters you see are not being used by WooCommerce.

    WooCommerce on its last version 2.5x uses the following (which you can see by looking at its files):

    \woocommerce\includes\abstracts\abstract-wc-product.php:

    ` /**
    * Get the add to cart button text.
    *
    * @return string
    */
    public function add_to_cart_text() {
    return apply_filters( ‘woocommerce_product_add_to_cart_text’, __( ‘Read more’, ‘woocommerce’ ), $this );
    }`

    \woocommerce\includes\class-wc-product-grouped.php:

    /**
    * Get the add to cart button text.
    *
    * @access public
    * @return string
    */
    public function add_to_cart_text() {
    return apply_filters( ‘woocommerce_product_add_to_cart_text’, __( ‘View products’, ‘woocommerce’ ), $this );
    }

    \woocommerce\includes\class-wc-product-simple.php:

    /**
    * Get the add to cart button text.
    *
    * @return string
    */
    public function add_to_cart_text() {
    $text = $this->is_purchasable() && $this->is_in_stock() ? __( ‘Add to cart’, ‘woocommerce’ ) : __( ‘Read More’, ‘woocommerce’ );

    return apply_filters( ‘woocommerce_product_add_to_cart_text’, $text, $this );
    }

    \woocommerce\includes\class-wc-product-variable.php:

    /**
    * Get the add to cart button text.
    *
    * @access public
    * @return string
    */
    public function add_to_cart_text() {
    return apply_filters( ‘woocommerce_product_add_to_cart_text’, __( ‘Select options’, ‘woocommerce’ ), $this );
    }

    \woocommerce\includes\class-wc-product-variation.php:

    ` /**
    * Get the add to cart button text.
    *
    * @return string
    */
    public function add_to_cart_text() {
    $text = $this->is_purchasable() && $this->is_in_stock() ? __( ‘Add to cart’, ‘woocommerce’ ) : __( ‘Read More’, ‘woocommerce’ );

    return apply_filters( ‘woocommerce_product_add_to_cart_text’, $text, $this );

    }`

    You can also see the WooCommerce documentation at https://docs.woothemes.com/document/change-add-to-cart-button-text/#section-2 (Change the add to cart text on product archives)

    Note that the filter I’m talking about woocommerce_product_add_to_cart_text is what it should be use on WooCommere 2.1+ as indicated at the official WooCommerce documentation.

    ——————————————–

    Thanks in advance for your help.

    Best regards
    Martin

    #269434
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    In that case will forward to our head developer.
    Let’s wait for the reply.

    -Rui

    #269559
    guentherportfolio
    Member
    Post count: 266

    Ok…Thank you Rui…
    Looking forward to hear from you…

    #269670
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    no problem. Let’s wait for the reply.

    -Rui

    #269857
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Thanks for the heads up on this – I’m gonna get this resolved for the next update.

    – Ed

    #270014
    guentherportfolio
    Member
    Post count: 266

    Hi Ed,

    that sounds great. I am really happy that you will solve this with an update.

    Also a big thanks to Rui, which was very patient regarding my bad English and explanation.

    I am looking forward to the update.

    Best regards
    Martin

    #270017
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    No problem with that,we are here to help. Thanks for the kind words.
    Thanks Ed.

    -Rui

Viewing 15 posts - 1 through 15 (of 37 total)

You must be logged in to reply to this topic.