Hide stock count till it's under a certain value

Home Forums Ticket Products Event Tickets Plus Hide stock count till it's under a certain value

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1342277
    Timm Beckmann
    Participant

    Hi,

    Currently the stock count for the tickets is diplayed for each ticket under the event. In German “100 verfügbar”.
    I would like to hide the numbers, at least until they reach a certain value, for example 10.
    In woocommerce I can set a value and a setting, where it doesn’t show the stock count, until the value is reached.

    It seems, that this setting, doesn’t have an influence on the Event Tickets Plus number. It’s still shown.

    I couldn’t find a specific setting for that. So it seems that feature is missing.

    The simplest way would be for Even Tickets Plus to take over the same settings from Woocommerce.
    A little bitt better, would be if there is a similar setting for Event Tickets Plus, so that I can set this apart from the Woocommerce setting.
    And the best way, would be to be able to have that setting for each Ticket.

    I don’t know if you plan that feature or when it would be available. Until then I could try to program it myself. Maybe you could guide me through a little, as to where I would have to implement the function in the fastest and simplest way. (I think just removing the remaining stock number from the page, would be enough for now)

    Greetings
    Timm Beckmann

    #1342307
    Timm Beckmann
    Participant

    Ok, I have found the src/views/eddtickets/tickets.php and It seems I just have to change it there.
    EDIT: Ok no. Had to change it in src/views/wootickets/tickets.php

    Still would like that feature included in Event Tickets Plus long term.

    • This reply was modified 6 years, 7 months ago by Timm Beckmann.
    #1342674
    Shelby
    Participant

    Hi Timm,

    Thank you so much for reaching out!

    If you’d like to make that suggestion, feel free to put it up on our user suggestion forum here. 🙂

    Please feel free to reach out in the future with any questions or concerns you have about our plugins!

    Cheers,

    Shelby 🙂

    #1350341
    Adam
    Participant

    Hi there Timm,

    Can I please ask what code you added/edited to get this to work?

    Thanks for your help!

    Adam

    #1350400
    Timm Beckmann
    Participant

    Hi Adam,

    sure.

    Tribe allows to overwrite certain files in views folder by placing them in your theme in a folder called “tribe-events”.
    So updates don’t delete your changes. If you have a child-theme that would be the best way, because then theme updates don’t change anything too.

    Therefore copy the file from wp-content/plugins/event-tickets-plus/src/views/wootickets/tickets.php to your theme folder
    themes/your_theme/tribe-events/wootickets/tickets.php.
    Then change the line 131 “if ( $remaining) {”
    to ” if ( $remaining && $remaining < 10)” or any other number than 10.

    Basically what it does is, it looks if your remaining tickets is less than 10 and only displays the stuff that comes afterwards, if it is. The span with the class “tribe-tickets-remaining”.
    If you set it to 0, it will never show up.

    I found, that the list view for events still shows the amount of tickets for all tickets together.
    If you also want to hide that the same way, you can’t do it in your theme folder unfortunately as the file isn’t in a views folder and can’t be overwritten.
    Specifically you need to change the file “wp-content/plugins/event-tickets/src/template-tags/tickets.php” in line 214. It should say “if ( $stock ) {” and should be changed to “if ( $stock && $stock < 100” or any other number than 100.

    You need to change that after every update of the Event Tickets plugin.

    I hope it helps you. It’s not the elaborate solution, I would like, where you can set the number for every ticket individually, since it’s hardcoded. However It solved my problem for now.

    #1351421
    Barry
    Member

    Thanks for sharing those notes!

    #1362137
    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 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Hide stock count till it's under a certain value’ is closed to new replies.