Issue with Tickets & WooCommerce shortcode : Ticket not added to cart

Home Forums Ticket Products Event Tickets Plus Issue with Tickets & WooCommerce shortcode : Ticket not added to cart

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #914431
    gilcatt
    Participant

    I might as well post this bug here also, if that can be of any help to other WC Tickets users

    => tried both versions of the WooCommerce shortcode for Product page

    [product_page id=”99″]
    [product_page sku=”FOO”]

    to embed it in an Event description

    (Using WooCommerce as a catalogue : no price shown by default, events sold via Tickets, hence the peculiar WC shortcode use case.)

    1. added the WC shortcode to the Event description text area.

    * the Ticket is not added to the cart

    2. deleted it from the Event description text area

    * the Ticket is added to the cart

    In both case everything looks good from the Single Event page.
    But the ticket seems to dislike the WooCommerce shortcode when embedded in the Event page ‘s description.

    It did work with TEC 3.8, without TEC PRO : I would need to roll back the the 3.8 version for the time being. Is there a link somewhere to get TEC 3.8 ? I did keep WC Tickets 3.8 and TEC Filter bar 3.8
    In advance, many thanks …

    #914894
    Josh
    Participant

    Hello gilcatt,

    Thanks for reaching out to us!

    To start off with the answer to your question at the end. You can download the previous version of PRO from within your dashboard account on http://tri.be. To download the 3.8 version of the core plugin, you can do that from the WordPress.org repository here.

    I’m not sure I’m following the nature of your initial issue though. Are the products that you’re adding via shortcode different products not associated with the Tickets for the events? By that I mean, are those products being added to the content area of the event via shortcode different from tickets created for the event within the “Tickets” section of that same event?

    If I could get a little clarification on what you’re trying to accomplish, hopefully I could recreate the issue and help to find a solution. I apologize for the inconvenience as well as my own lack of understanding of the issue.

    Thanks!

    #915353
    gilcatt
    Participant

    Hi Josh, thanks for your kind reply. Le me give you some more details.

    I am selling training sessions for businesses. These are sold “date based”.
    I need a catalogue => WooCommerce shop used as such
    And I need to sell them as events => Right now, using TEC PRO and WC Tickets.

    FYI, I did try to come up with a solution within WooCommerce first, using the variable product option, adding dates as variations. Then adding the reference of the product page in a calendar. But the workflow was tedious – filling dates twice in different environments – and the user experience was not optimal.

    Technically speaking, as you rightly assumed, the products page I am adding via shortcode are different products not associated with the tickets for the events.

    I am using woocommerce as a catalogue of events only, using the standard WooCommerce product page for the event’s description ( without price and thus without the “add to cart button” showing) , and WooCommerce Tickets to sell them.
    Basically I am thus embedding what I consider to be the event description – done with a WooCommerce product page – putting a WooComerce product page shortcode in the event description field of an Event created with The Event Calendar. Selling the Event with Tickets. Getting the best of both worlds. This a bit of a hack.
    It did work with 3.8, it doesn’t work with 3.9.
    Any clue to make it work with 3.9?
    I did the whole debugging process following Tribe’s Guidelines: it all boils down to some incompatibility between WooCommerce and WooCommerce Tickets in this specific use case.

    Some additional remarks:

    If tickets offered the same standard options as a standard WooCommerce product, on top of its own, all would be fine.
    I need the variable product options ( to add options like a lunch package, discount based on # of attendees, etc …)
    I need the description tabs.
    And I would need tickets to appear in the shop itself.
    That would be the best and most elegant solution.

    My guess is :

    1. I would have to tweak the Tickets template to bring back the standard WooCommerce product fields to view. That shouldn’t be too difficult. (If I create the equivalent of a ticket in WooCommerce, it looks like a standard product page. Everything already exists.)
    2. Make the ticket visible as a product in the WooCommerce shop page, and show standard product page when in WooCommerce shop. Should not be difficult either. (Right now some rule in a Ticket make it non visible in the WooCommerce shop pages. Deleting that rule would do.)

    And now the trickiest part:

    4. Allow for the creation of a ticket as a standard product from the WooCommerce New Product interface.
    3.Find a way to associate an event created in TEC with an existing ticket created . Or a ticket to an event. I have no preference here. (Using the ticket category as a conditional : IF product A is in Ticket category THEN allow association with Event A, B, …N). That is the trickiest part, where I would need some help.

    What would be beautiful : once the process is complete show the dates/venues associated with the product in the product description (in a separate tab, for instance) and as a product’s variations (as they are needed for checkout).

    Being able to create a date as a product variable from within WooCommerce (already possible, not user friendly as it is now (no date picker) but does the trick) AND show that date into a calendar like TEC would be the ultimate solution. Quite a different product indeed.

    TEC’s scenario is to create events as dates in a calendar, the products sold being the tickets to the event.

    My scenario is to create events as products, being able to associate them with dates in a calendar. Yet selling sessions: dates are product variations. This is the standard business scenario for selling training sessions. You first pick a training program from a catalogue, then see if a session is scheduled, book a date if it is. Also choose the venue: most business training sessions are scheduled in various cities. The choice is always a date/venue combination.
    A valuable market for Tribe’s products, think about it ;).

    There is the WooCommerce Bookings plugin, but it does not offer a calendar nor the possibility to choose from existing dates set by the admin. Oh well …

    #918860
    Josh
    Participant

    Hello gilcatt,

    Thanks for following up with us and providing with detailed information about what you’re trying to accomplish! This definitely helpful.

    As a start, I’ll address the concern about the shortcodes being used within the event descriptions. I tested this out within my local install with a fresh version of WooCommerce and WooCommerce Tickets plugin and was able to get the ticket to display ( using this shortcode https://cloudup.com/cRHtFlCv5HN, I was able to display https://cloudup.com/cNV01woBRH1). When you’re adding the shortcode, are you using the main product ID or are you using the ID for a specific variation? Also, there could be some other settings associated with the product that may be causing it not to display. When you use the shortcode, is the area showing blank or is it outputting the raw shortcode?

    To address the general issue of what you’re trying to accomplish, it sounds like you may not need the WooCommerce tickets plugin. I may be mistaken, but it sounds like a good approach from a usability perspective would be creating the sessions as products in WooCommerce and then setting the different dates as product variations or attributes (I’m not as familiar with the implications between these two options within WooCommerce) for that product. Then, when a new product is created with date variations, you can have a function run which automatically creates new events within the “tribe_events” CPT using “wp_insert_post“.

    With this approach, you could have all the details for the event (date, time, title, and even the appropriate shortcode to output the product onto the event content area) automatically added when the new “session” product is created.

    Unfortunately I’m unable to dig too deep into this particular aspect here within the support forums but hopefully this would be enough to get you pointed in the right direction if this sounds like something that may be useful to you.

    Thanks!

    #918897
    gilcatt
    Participant

    Hi Josh,
    That is a really interesting approach, indeed. Yes it would be perfect. I was about to ask for a refund 🙁 , but this opens up a great possibility, probably also quite useful for other TEC users.

    Now I am scratching my head : what kind of function would I need to create ? That is , for starters, what would be the array to pass the necessary elements that make up a post, regarding the “tribe_events” CPT ?

    $post = array(
    ‘ID’ => [ <post id> ] // left blank
    ‘post_content’ => [ <string> ] // The product page shortcode
    ‘post_name’ => [ <string> ] // The name (slug) for the post
    ‘post_title’ => [ <string> ] // The title of the post.
    ‘post_status’ => [ ‘published’ |
    ‘post_type’ => [ ‘custom post type’ ]
    ‘post_author’ => [ <user ID> ]
    ‘post_parent’ => [ <post ID> ] Default 0.
    ‘post_excerpt’ => [ <string> ] // For all your post excerpt needs.
    ‘post_date’ => [ Y-m-d H:i:s ] // The time post was made.
    ‘post_date_gmt’ => [ Y-m-d H:i:s ] // The time post was made, in GMT.
    ‘post_category’ => [ array(<category id>, …) ]
    ‘tax_input’ => [ array( <taxonomy> => <array | string> ) ] // For custom taxonomies.
    ‘page_template’ => [ <string> ] // Requires name of template file : single.event.php.
    );

    And using “something” in here to get product variations to show in the loop of a tribe-events CPT …
    http://docs.woothemes.com/wc-apidocs/class-WC_Product_Variation.html
    Unfortunately I am not such a great coder, as you may have guessed … but definitely interested in getting this right.

    Regarding your questions:
    1. I am using the main product ID.
    2. When using the shortcode, the dexcription area is showing fine. The only thing that doesn’t work is that when using tickets with an event containing the WooCommerce product page shortcode, clicking on add to cart on the ticket’s button does nothing.

    However I do agree that I very much prefer what you suggest : do without WC Tickets and use the “add to cart” button within the standard product page. It would indeed make for a much better user experience in my use case.

    #919789
    Josh
    Participant

    Hello gilcatt,

    Thanks for following up! I’m glad the suggestion seems like it could be a good solution.

    Unfortunately I’m not able to go into exact detail here in support because that would actually require several hours of custom development and testing to get a good solutions and provide those details.

    However, to be more specific as to where I would start looking at development, I would:

    1. Look at creating a function that fires when a product is created.
    2. I would first check to see if the product had variations for dates.
    3. If so, I would run wp_insert_post for each date variation.
    4. The two variables you’ll definitely need for each ‘wp_insert_post’ are ‘post_title’ (I would make this a string that combines the product name and date) and ‘post_type’ (tribe_events).
    5. You would then need to grab the dates and assign those with the new event (great resource)

    Hopefully this helps to get you pointed in the right direction.

    To address the shortcode issue again, I just tested purchasing a product via the shortcode I placed on an event and was able to complete the transaction. It sounds like this still may be a plugin conflict or possibly a different setting within WooCommerce that may be causing the issue. Have you tried your existing configuration with default WooCommerce settings, no other plugins, and a default theme? If that works, you can start to reconfigure as needed to find where the conflict is occurring.

    I’m sorry I wasn’t able to give you a direct response however I hope this was able to point you in the right direction.

    Thanks!

    #983651
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Issue with Tickets & WooCommerce shortcode : Ticket not added to cart’ is closed to new replies.