• Resolved teoalt97jf

    (@teoalt97jf)


    Hi, I’m trying to automatically fill in the checkout fields with customer data using parameters that I set in the WC session and which come from a URL.

    So far so good, but I’ve found that even if I urlencode the special characters, when the checkout fields are filled in, if there are any ‘ (%27) or ” (%22) characters inside the field I find a backslash preceding the \’ or \” character.

    Screenshot

    I need your help to solve this problem. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter teoalt97jf

    (@teoalt97jf)

    Hi, can you help me with this support request?

    Saif

    (@babylon1999)

    Hello @teoalt97jf,

    Thank you for reaching out!

    I did some digging and seems like these values are stored with a backslash in the WC_Session_Handler. Kindly review the problem analysis in this report: https://github.com/woocommerce/woocommerce/issues/17570

    As suggested in the report, one potential solution is to use the stripslashes() , however, according to PHP’s documentation, it’s not advised to use this method if you’re saving data to the database.

    Since this is a complex topic, I suggest posting your questions in the WooCommerce Community Slack or hiring a WooExpert as we are not able to provide support for custom solutions per our support policy.

    Cheers!

    Thread Starter teoalt97jf

    (@teoalt97jf)

    Hi @babylon1999,
    Thanks for your reply.

    I did some research and have already implemented stripslashes().

    Thanks anyway.

    Hi @teoalt97jf

    I did some research and have already implemented stripslashes().

    Thanks for reaching out and updating us on your progress. It’s great to know you’ve successfully implemented the stripslashes() function. I trust it’s performing as you anticipated.

    I’ll go ahead and mark this thread as resolved. However, if you ever have more questions or issues in the future, don’t hesitate to kick off a new topic.

    Hope you have a fantastic day!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Backslash on special characters ‘ () ” () on checkout fields’ is closed to new replies.