• Resolved rvd1993

    (@rvd1993)


    Hi there,

    For my page, I want to customize the Products element of WooCommerce. Below you see the current version. I want to know where I can change, for instance, ‘Aanbieding!’ (English: Sale!) to something else. As well with the text “Toevoegen aan winkelwagen” only into “Toevoegen”. See: BRASSLAB – Getest in het lab, gespeeld op straat.

    I am using Elementor, and if I am correct Elementor does not have this feature since this part of the Products element is hardcoded by WooCommerce. They told me that I should have a look in a functions.php file. Although I have some coding experience with php, I can not find the relevant file to work on it.

    Could you please help me out?

    Thx, Roel

    • This topic was modified 9 months, 3 weeks ago by rvd1993.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @rvd1993,

    Thank you for reaching out and for clearly explaining what you need help with.

    To change the text you mentioned, you can either use custom code or a plugin like Loco Translate. Please note that providing custom code is outside the scope of support offered in this forum. For advanced customization, it’s best to consult an expert from platforms like Codeable.io, who can assist you with the necessary code adjustments.

    If you’d prefer not to use code, you can use Loco Translate to modify text on your website. However, this method is less flexible and may not be as clean or reliable as using custom code.

    If you’re comfortable working with code, here’s an example of how you can make the changes:

    Change “Aanbieding!” (Sale!)

    add_filter( 'woocommerce_sale_flash', 'custom_woocommerce_sale_flash' );
    function custom_woocommerce_sale_flash( $text ) {
        return '<span class="onsale">Promo!</span>'; // Replace "Promo!" with your desired word
    }
    

    Change “Toevoegen aan winkelwagen” (Add to cart)

    add_filter( 'woocommerce_product_add_to_cart_text', 'custom_add_to_cart_text' );
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_add_to_cart_text' );
    
    function custom_add_to_cart_text( $text ) {
        return 'Toevoegen'; // Your preferred text
    }
    

    You’ll need to add this code to your functions.php file or use a code snippet plugin. If the code doesn’t work as expected, you may need to adjust it slightly to fit your theme or setup.

    If you’re not comfortable editing code, please use the Loco Translate option or consult an expert, as further customization requests are beyond the scope of forum support.

    If you found this response helpful, I’d really appreciate it if you could leave a quick review here:
    👉 https://wordpress.org/support/plugin/woocommerce/reviews/#new-post

    Thread Starter rvd1993

    (@rvd1993)

    Hi Moses,

    Thank you for your reply! It is working related to the button, please see my website. I changed the Add to cart into “Bekijken”. In case of multiple options, the button shows now everywhere the same text. Is it possible to make an adjustment on the previous code for more diversity?

    In case of the Sale Flash, it is not corresponding anymore with (in my case) Elementor. Please also see my website. Is there any way to change it?

    Thx, Roel

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi Roel,

    Thanks for the update — I’m glad to hear the button text adjustment is working on your site!

    Regarding further customization, such as using different button labels in different situations or modifying how the Sale Flash appears with Elementor, that would require custom development. Since custom code falls outside our usual scope of support, we’re unfortunately not able to provide support for custom code changes.

    If you need more in-depth support or want to consider professional assistance for customization,
    I can recommend WooExperts and Codeable.io as options for getting professional help.

    Alternatively, you can also ask your development questions in the  WooCommerce Community Slack 

    Thank you for your cooperation and understanding.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Customize Product element’ is closed to new replies.