Ticket price input does not respect WooCommerce decimal separator

Home Forums Ticket Products Event Tickets Plus Ticket price input does not respect WooCommerce decimal separator

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1462702
    kaisv
    Participant

    I set the decimal separator to “,” but Event Tickets Plus requires the use of “.”. Also there is no setting for this in events tickets plus.
    The displayed price in the ticket overview uses “,” (though I don’t know if that is because I set it in WooCommerce or if that is different in your plugin as well.)

    #1463553
    Jennifer
    Keymaster

    Hello,

    I just tested this out in my local environment and was getting the same thing. However, you should be able to fix this by adding this snippet to the functions.php file of your child theme. Can you give this a try and let me know if it works for you?

    Thanks,

    Jennifer

    #1463586
    kaisv
    Participant

    No that snippet is not needed for me, as the DISPLAY of the prices is correct only the INPUT is not respecting the decimal separator.

    I found the corresponding code.

    It is in the javascript file event-tickets/src/resources/tickets.min.js in the following part (as it is minimized I don’t see your used variable names but searching for “#ticket_price” as the id for the ticket price input leads to the correct part I guess):

    r.on("keyup","#ticket_price",function(e){
    e.preventDefault();
    var i=price_format.decimal,
    n=new RegExp("[^-0-9%\\"+i+"]+","gi"),
    a=t(this).val(),
    r=a.replace(n,"");
    a!==r&&t(this).val(r)
    }
    )

    here i is the set via price_format.decimal which I can see in the debugger (Firefox) that it is set to “.” which therefore allows that symbol as input (du to not replacing it as it is added in the regex). I don’t konw where price_format.decimal is set though…

    #1477695
    Jennifer
    Keymaster

    Hello,

    Thanks for clarifying, and I’m sorry for the delayed response here – just to make sure I understand correctly, the issue is that you are not able to enter a comma as the separator in the price field on the back end, is that right? I’m checking with our developers to see if there is anything that they can provide a recommendation on this…please note that we are limited in the amount of support that we can provide for customizations, but it does seem like the backend input field should use the same separator as is being displayed on the front end.

    I will let you know as soon as I hear back!

    #1496478
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Ticket price input does not respect WooCommerce decimal separator’ is closed to new replies.