Add a comma in the price field

Home Forums Ticket Products Event Tickets Plus Add a comma in the price field

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #999632
    Heather Wood
    Participant

    How do I add a comma in the price field? When I do it manually, it does not show up.

    Is there a way to change the code to make this do this automatically?
    http://ittrainingsolutions.net/class/vmware-vsphere-install-configure-manage-6-0-2/

    I’m suprised I didn’t find this in the forums. I tried looking. So thought I would just ask.

    #999692
    Brian
    Keymaster

    Hi,

    Sorry for the issues you are having. I can help out.

    I have this snippet to add to your theme’s functions.php:

    https://gist.github.com/jesseeproductions/914b68ce570cca31c075

    That should enable the comma to show in the field again.

    Let me know if that works for you.

    Thanks

    #999700
    Heather Wood
    Participant

    Thank you. I added the code you gave me to the top of functions.php .

    all it seemed to do was remove my dollar symbol (which I do not want) and I still don’t see a comma?

    #999906
    Brian
    Keymaster

    Oh my bad I did not put together this was WooCommerce Prices. So I do not think that snippet would work and I would recommend removing it.

    I tested on my site and added a $100 ticket and a $64 ticket and it displays like this for me: $64 – $100

    So do you have any other snippets that modify the cost somehow or any changes to the Single Events Template?

    Let me know and we can figure it out from here.

    Thanks

    #999936
    Heather Wood
    Participant

    No I don’t. I’m trying to add a comma. So a comma would only occur in prices such as for example: $3,500.

    In my link, you can see almost all our course packages are in the “thousands”. How can I add a comma? I can’t do it manually as the system removes it. So is there a code snipped that would add it?

    Thanks so much for your help.

    #1000036
    Brian
    Keymaster

    Oh I am sorry I thought you were trying to separate two numbers, not add a comma like that.

    My Bad.

    I came up with this filter and it worked for me on the single price and also the range.

    https://gist.github.com/jesseeproductions/b14f815d967f4851f641

    Please remove that other snippet I gave and try this instead.

    Let me know how it works out.

    Thanks

    #1000047
    Heather Wood
    Participant

    Thank you so much. Next time I’ll try to be more specific. Sorry about that. Thank you again!! 🙂

    It works great!

    • This reply was modified 8 years, 8 months ago by Heather Wood.
    #1000061
    Brian
    Keymaster

    Great glad it helps now!

    I did update the coding after I first posted a link to it to add a check for a value and if it is a number otherwise it was giving me some errors on some pages.

    So please use that new coding.

    I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic on the forum and we can help you out.

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add a comma in the price field’ is closed to new replies.