• Resolved marie999

    (@marie999)


    Hi,

    Without using a translation plugin, I’d like to change the texts : ” You will like too ” and ” You may be interested by ” for related products and cross-sells.

    Could you please give me the code to do that ?

    Thank you very much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi, marie999, I’m another WooCommerce user.

    The relevant filters for your case would be woocommerce_product_upsells_products_heading in ‘woocommerce/templates/single-product/up-sells.php’

    And

    woocommerce_product_cross_sells_products_heading in ‘woocommerce/templates/cart/cross-sells.php’

    To hook into those filters, you can use code like this:

    add_filter( 'woocommerce_product_upsells_products_heading', 'woocommerce_may_also_like' );
      
    function woocommerce_may_also_like() {
       return __( 'You could also like…');
    }

    (You don’t need to specify a parameter for the hooked function unless you care about preserving/manipulating the value that is passed to it.)

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @marie999!

    In addition to the information @plantprogrammer gave you, here is how to add custom code to your site the correct way:

    https://rynaldo.com/how-to-add-custom-code-to-your-woocommerce-wordpress-site-the-right-way/

    Cheers!

    Hi @marie999

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Related products and cross-sells’ is closed to new replies.