Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1364457

    Dear Team,
    I am trying without success to modify the field of the form “Informations complémentaires”, where clients can write a personal message in a way to make the reference to the shipping disappear from the suggestions (since I’m selling guided tours, not physical items to ship): “Commentaires concernant votre commande: ex. CONSIGNES DE LIVRAISON” (livraison = shipping). At that place I would rather add something like “Commentaires concernant votre commande: ex. informations ou demandes spéciales concernant votre visite guidée”.
    Is there a way to do that ?
    I copy below the url of the form.
    Thanks a lot for checking out and kind regards,
    Natacha

    #1364497

    Hey HulaSlim,

    Please try this in your functions.php file:

    function natacha_change_woo_textarea_placeholder(){
    	?>
    	<script>
    	jQuery(document).ready(function(){
              $('textarea#order_comments').attr('placeholder','Commentaires concernant votre commande: ex. informations ou demandes spéciales concernant votre visite guidée');
    	});
    	</script>
    <?php
    }
    add_action('wp_footer', 'natacha_change_woo_textarea_placeholder', 999);

    Best regards,
    Rikard

    #1364532

    Hi Rikard,
    Thank you for this code. Can you please jsut specify where to find “function php file” ? Is it Appearence/…/…/ or Enfold Child/…/…
    Thanks and regards,
    Natacha

    #1364535

    Wait, I got it: it’s in Appearence, Editor…
    I did it, but “Consignes de livraison” is still there.

    #1364633

    Hi,

    Please try using a plugin like this instead: https://wordpress.org/plugins/loco-translate/

    Best regards,
    Rikard

    #1364653

    Hi Rikart,
    I downloaded the extension, even though this is a translation tool. Plus, now, where am I to find this form ? My problem is that I don’t know where it is, this is why I don’t know how to modify it. Do you have an idea ?
    Thank you,
    Regards,
    Natacha

    #1364671

    Hi,

    Thank you for the update.

    You can use this filter to change the placeholder and label values of the order comments field.

    function avf_custom_woocommerce_checkout_fields( $fields ) 
    {
        $fields['order']['order_comments']['placeholder'] = 'Commentaires concernant votre commande: ex. informations ou demandes spéciales concernant votre visite guidées';
        $fields['order']['order_comments']['label'] = 'Notes de commande (facultatif)';
    
        return $fields;
    }
    add_filter( 'woocommerce_checkout_fields', 'avf_custom_woocommerce_checkout_fields' );
    

    Place the code or filter in the functions.php file.

    Best regards,
    Ismael

    #1364785

    Wauuuu !
    Your code is pure magic ! Problem solved in a second.
    Thannnnx Ismael.
    Best regards,
    Natacha

    #1364793

    Hi Natacha,

    Glad Ismael could help!
    Let us know if you have any other questions and enjoy the rest of your day :)

    Best regards,
    Yigit

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Modify woocommerce form’ is closed to new replies.