Redirect to Cart Page

Events+, and MarketPress integration is enabled. Looking for any quick workaround on how to redirect the users to the respective cart page once the "I'm attending" button is clicked.

At the moment, it'll show the cart link once the button is clicked, would like to know if there is any quick workaround.

  • Adam Czajczyk
    • Support Gorilla

    Hello noa

    I hope you're well today and thank you for your question!

    Fortunately, the selected product is added to the cart automatically, the MarketPress plugin provides a function to read cart URL (so it will work regardless of cart page selected, no need to "hardcode" anything) and Events+ has a useful action hook triggered when "I'm attending" button is clicked.

    So, we can do it with a piece of code:

    function wpmu_redirect_rsvp_yes_to_cart() {
    	wp_redirect( mp_store_page_url( 'cart', false ) );
    add_action( 'incsub_event_booking_yes', 'wpmu_redirect_rsvp_yes_to_cart' );

    To apply it to your site:

    1. create an empty file with a .php extension (e.g. "event-redirect-to-cart.php")
    2. copy and paste the code into that file (using "clean text" editor such as e.g. Notepad++, Sublime, cPanel File Manager's editor or similar)
    3. upload the file to the "/wp-content/mu-plugins/" folder of your site's WP install; if there's no "mu-plugins" folder inside "wp-content" folder, just create it.

    I hope that helps :slight_smile:

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.