• Resolved auludag

    (@auludag)


    hello,

    Woocommerce currently displaying phone numbers like 03125001234. However, I need the number to be formatted in a more human-readable form, for example: 0-312-500-12-34.

    I found a jQuery code in SO similar to my need

    $('.phone').text(function(i, text) {
        return text.replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3');
    });

    But how can i customize it? So it would put 0(Zero) prewritten and customer would be starting with his number after zero and which class should i call this jQuery for WooCommerce Cart section

    https://stackoverflow.com/questions/8760070/how-to-format-a-phone-number-with-jquery

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    I’m not sure how to modify WooCommerce’s output, but this plugin might help you out:
    https://www.ads-software.com/plugins/international-phone-number-display/

    Thread Starter auludag

    (@auludag)

    hi @fernashes, thanks for reaching out. I have understood I explained not fully. When User fills billing fields in WooCommerce, he/she writes 03125001234. But i want to reformatted while he/she writes 03125001234, automatically converted to 0-312-500-12-34

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Thanks for explaining!

    The plugin that I mentioned will format the number based on the country. If you want to change the format yourself, you may need to work with a developer to make it happen. In that case, I recommend contacting one of the services on our customizations page: https://woocommerce.com/customizations/

    Thread Starter auludag

    (@auludag)

    ok thank you for reply. I’d leave this topic as unresolved so someone who solved this problem, may see this topic and could reply with the answer solving the question.

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Hey there!

    I understand where you’re coming from, but leaving threads open hurts the WooCommerce plugin over time, as people look to see how many threads are resolved. Our experience is that if a thread isn’t answered/picked up in the first few days, nobody will be able to get back to it. Given that it’s been a week, this thread will now only be visible in search results.

    I recommend reaching out to a developer yourself for more help on this.

    Thread Starter auludag

    (@auludag)

    @fernashes thanks for taking your time explaining your concern. I appreciate it.:)

    As you can guess, I opened this thread to find the correct answer to my question.And I don’t have any bad intention regarding to a plugin that I use.

    And I use this forum not asking question but as knowledge base to find correct answers to my question as well.

    In my logic, thread should be opened until correct answer would be found.

    I do understand your opened topic number concern, but if a reply was not exact answer to a question, marking as ‘resolved’ would be misleading for future searches, + would affect the perception of this forum in terms of qualitative means, in a bad way. If a forum would be more filled with correct answers, this could increase the usage the forum as knowledge base as well, and this leads less question overall, imho.

    Let me end with this: I definitely appreciate the hard work of whole Automattic team. ??

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Let me end with this: I definitely appreciate the hard work of whole Automattic team. ??

    Please do include all of the volunteers in this! ?? WooCommerce is an open source plugin, so anyone can contribute.

    I do understand your opened topic number concern, but if a reply was not exact answer to a question, marking as ‘resolved’ would be misleading for future searches, + would affect the perception of this forum in terms of qualitative means, in a bad way

    We’re getting quite deeply into “what’s the end goal of this forum?” and that’s a bit of a discussion. Are we here to help those with settings issues? Or how about development questions? What about when there just aren’t any community developers around who can/want to help? Those threads will never be answered or resolved – and that’s unfair to the community in that the forum then isn’t as well cared for. I do understand where you’re coming from, in wanting an answer, and not wanting the thread resolved until you do have an answer – but there may never be an answer to it.

    There isn’t a good conclusion right now, but I’ll leave this thread open for at least a few more weeks and follow up then.

    Thanks for sharing your thoughts!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘reformat phone number while written’ is closed to new replies.