Using woocommerce [add_to_cart_url id="xx"] shortcode

Home Forums Ticket Products Event Tickets Plus Using woocommerce [add_to_cart_url id="xx"] shortcode

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #55341
    byronclinic
    Participant

    I’m needing to use the woocommerce shortcode that allows me to add a ticket to the cart via a url, [add_to_cart_url id=”xx”]

    This works fine but bypasses tickets.php

    I’m hoping to skip the cart as we only have one event and only want to jump straight to checkout after adding a ticket to the cart using the http://www.mysite.com/?add-to-cart=xx url method of adding products.

    I was trying to use to use add_to_cart_redirect but apparently this isn’t used by WooTickets and I also can’t make the customisation in tickets.php

    Any clues on how I might be able to bypass the cart after adding a product using [add_to_cart_url id=”xx”] would be appreciated.

    #55420
    Barry
    Member

    Hi byronclinic – can you take a look at the following thread which covers pretty much the same thing?

    woocommerce "add_to_cart_redirect" filter useless with wootickets…

    Let me know if you need any further help after reviewing that. Thanks!

    #55588
    byronclinic
    Participant

    Thanks Barry, looks like I need to filter wocommerce_get_cart_url

    #55589
    Barry
    Member

    Great, sounds like you’re on track 🙂

    #55593
    byronclinic
    Participant

    And the correct location to do this in my child theme’s functions.php?

    Or in wp-content/my-child-theme/woocommerce/woocommerce-functions.php?

    #55623
    Barry
    Member

    That’s something I would have to leave to your discretion.

    We typically suggest people add snippets to their theme’s functions.php file simply because that is least confusing for those who are unfamiliar with the workings of WordPress and indeed PHP.

    However, adding it in a child theme, whether directly in the child theme’s functions.php file or some more compartmentalized location – or even housing your work in a plugin of its own – could arguably be better.

    #61028
    Barry
    Member

    Closing this out since it’s been a while.

    #979503
    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 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Using woocommerce [add_to_cart_url id="xx"] shortcode’ is closed to new replies.