Timm Beckmann

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Hide stock count till it's under a certain value #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.

    in reply to: Hide stock count till it's under a certain value #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, 8 months ago by Timm Beckmann.
Viewing 2 posts - 1 through 2 (of 2 total)