• Resolved aboriginalsun

    (@aboriginalsun)


    Hi,

    The placeholder on my coupon code field in the cart page is really long and is not visible.
    I am not an expert and can only do basic changes. Can you please guide me on how to change the Placeholder to “Codice Promo”?

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Sandip Mondal – a11n

    (@sandipmondal)

    Hi @aboriginalsun,

    To change the placeholder of the coupon code, you can try the below snippet:

    
    function my_text_strings( $translated_text, $text, $domain ) {
        switch ( $translated_text ) {
            case 'Codice promozionale' :
                $translated_text = __( 'Codice Promo', 'woocommerce' );
                break;
        }
        return $translated_text;
    }
    add_filter( 'gettext', 'my_text_strings', 20, 3 );

    `

    You can use a plugin like Code Snippets to add this to your site.

    Let us know how it goes!

    Thread Starter aboriginalsun

    (@aboriginalsun)

    I added this using HFCM Plugin which I use for other snippets in header and footer.
    Didnt work

    Thread Starter aboriginalsun

    (@aboriginalsun)

    Installed “Code Snippets”

    This is the error I am facing –

    https://snipboard.io/t7lQoA.jpg

    Plugin Support Prin a11n

    (@prin_settasatian)

    Hello there,

    I think you may need to delete the snippet in the HFCM plugin first. Then, you can add the snippet in the Code Snippets plugin.

    Also, please check in the Code Snippets plugin to see if you have already declared a function called my_text_strings in another snippet. In this case, you only need to change the function name to something else.

    Let me know if this works for you.

    • This reply was modified 3 years, 9 months ago by Prin a11n. Reason: Added the second paragraph
    Thread Starter aboriginalsun

    (@aboriginalsun)

    I deleted from there. I resolved the issue. But it is not working. It only changes for split second while loading and goes back to normal

    Plugin Support Prin a11n

    (@prin_settasatian)

    Hi @aboriginalsun,

    In this case, may I suggest you use the Say what? plugin (https://wordpress.org/plugins/say-what/) instead.

    After installing and activating the plugin:
    1. Go to your site’s dashboard.
    2. On the left sidebar, click on Tools -> Text changes.
    3. Click on the Add New button.
    4. Type Coupon code for Original string.
    5. Type woocommerce for Text domain.
    6. Type the text you would like to display in the box under Replacement string
    .
    7. Click on the Add button.

    Don’t forget to deactivate the snippet in the Code Snippets plugin.

    Hope this helps.

    Thread Starter aboriginalsun

    (@aboriginalsun)

    Resolved. Thank you @prin_settasatian

    Hi @aboriginalsun

    Glad it is resolved! πŸ™‚

    Thanks for using WooCommerce! If you have a few minutes, we’d love if you could leave a review for the WooCommerce plugin: https://wordpress.org/support/plugin/woocommerce/reviews/

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

The topic ‘Change Coupon Code Placeholder’ is closed to new replies.