Woocommerce Name Your Price extension and Events Tickets Plus

Home Forums Ticket Products Event Tickets Plus Woocommerce Name Your Price extension and Events Tickets Plus

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1327217
    Dave
    Participant

    Hi. I’ve looked through many threads on this subject in these support forums, so can tell it’s one that many people are interested in. However, I can’t see if anyone ever came to an answer.

    What I would like to do is use the Name Your Price official Woocommerce extension with The Events Calendar Pro and Event Tickets Plus to make tickets that can have a suggested price, a minimum price and a field to enter your price (this is for a nonprofit client who will be offering sliding-scale priced classes).

    I installed the Name Your Price plugin, and it seems like it’s close to working. You can see an example of a ticket with Name Your Price enabled on this test event: http://peoplescolloquium.org/event/test-class/ You’ll see that the price is set to $1, which is what I entered for minimum price. It lists the suggested price, too, correctly. However, it does not explicitly list the minimum price, and, more importantly, it doesn’t give a place to enter the chosen price. So, when you add a ticket and click “Add to Cart” it returns the error “‘Variable ticket test’ could not be added to the cart: Please enter a valid, positive number.” This seems to me likely because no number was entered for the chosen price, because there wasn’t a field for it.

    I’m not very good with PHP, or I’d try to do it myself – do you have any advice on integrating the two? It seems to me that the Event Calendar single-event template needs to call some fields that the Name Your Price plugin creates and inserts automatically into the Woocommerce product templates.

    Thanks.

    #1328380
    Victor
    Member

    Hello Dave!

    Thanks for getting in touch with us! Let me try to help you with that.

    First, let me note that we’re fairly limited in how much we can support custom development questions like this.

    That said, I’d like to help you out with this and at least point you in the right direction. We also have a list of customizers we’d like to refer too.

    I’m not really familiar with the Name Your Price plugin, but it seems it adds a price input field to the single product template, which our own plugin does not use, so this is why it throws and error when adding it to cart.

    I could not completely test the error in the link you provided as I am required to log in to purchase the ticket.

    If you want, you could send us a copy of the plugin in a private reply, so I can make a few tests with it and see if I can come up with a possible approach to accomplish what you’re looking for. Let me know about it.

    Best,
    Victor

    #1328390
    Dave
    Participant

    This reply is private.

    #1328763
    Victor
    Member

    This reply is private.

    #1330564
    Victor
    Member

    This reply is private.

    #1335196
    Dave
    Participant

    This reply is private.

    #1335450
    Victor
    Member

    Hi Dave!

    I’m sorry for the delay in getting back to you. We’ve been having a higher demand in our forums and could not get back to this as I expected.

    I did make some draft tests on my end with the plugin and it seems it can be used with our plugins but would require some custom coding to make it all work.

    It seems that the missing piece is the price input, so one approach would be to include the price input from the Name your price plugin into the tickets.php template file from our templates. Perhaps using the ‘wootickets_tickets_after_quantity_input’ action inside that template.

    The following is just a draft way to achieve that:

    add_action( 'wootickets_tickets_after_quantity_input', 'add_nyp_price_input', 10, 1 );
    function add_nyp_price_input( $ticket ) {
    $ticket_id = $ticket->ID;
    echo WC_Name_Your_Price_Helpers::get_price_input( $ticket_id );
    }

    I made a few tests and it seems to work, but further customization might be needed.

    I hope that helps as a starting point. Let me know about it.

    Best,
    Victor

    #1335784
    Dave
    Participant

    That’s a great start – thanks for your help. I moved it around with CSS and added a description, and it’s working pretty well: http://peoplescolloquium.org/event/test-class/. There are a few other things that could work better – for example, under the title and date it shows a price, which is the minimum price – it would be nice to show the suggested price there, and the minimum price down where it shows the suggested price. But, what you’ve provided is good for now – I wouldn’t expect you to go too deep down customizing this unless you wanted to officially support the plugin. So, I can see if I can get those working on my own.

    This is very much appreciated.

    Dave

    #1335862
    Victor
    Member

    Hi Dave!

    Great to know you managed to work that out! Certainly, there are a few things that can be improved in the code I sent. But I’m glad you are finding ways to make it work/look better 🙂

    Thanks for following up with this to let us know about it.

    As you marked this resolved, I’ll go ahead and close it. But feel free to open a new topic if anything comes up and we’d be happy to help as much possible.

    Cheers,
    Victor

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Woocommerce Name Your Price extension and Events Tickets Plus’ is closed to new replies.