Setting Shop base page to events URL

Home Forums Ticket Products Event Tickets Plus Setting Shop base page to events URL

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #57724
    simplicityltd
    Participant

    Hi,
    When the cart is empty and you get the ‘return to shop’ button, that takes you back to the Woocommerce styled shop but would rather redirect it back to the events list. You can change the shop base page in Woocomerce of course but only to pages, and the events list isn’t a page. Any ideas how I can do this?

    #57844
    Barry
    Member

    How about overriding the WooCommerce cart/cart-empty.php template? You could then link to whatever you like.

    #57864
    simplicityltd
    Participant

    Ahh, I was hoping for something a little less hacky, ah well, no worries. Thank you

    #57871
    Barry
    Member

    Well, what you are trying to do here directly relates to that template and safely overriding it is one recommended way of making changes to it.

    I’m not quite sure why that would be considered hacky – nor can I think of too many alternatives unless you do something like filter post_link once only after woocommerce_cart_is_empty fires, however I’d tend to see that as the hackier of the two approaches.

    Definitely take the time to check in with WooThemes support, however, especially if you don’t feel comfortable with template overrides – since this really relates to their product (WooCommerce) and they will be best placed to advise you about customizations to their product.

    #57878
    simplicityltd
    Participant

    Sorry, didn’t mean to be rude, by hacky I meant I was hoping to not edit code that might later get overwritten in an update, I’ve edited that file as you suggested and all is well, thanks.
    I had to use a direct URL for the link though as my feeble attempts to to code it failed. Can you tell me what I might use to correctly reference the main events list? I tried to copy code from your tribe-options-general.php using the tribe-events::getlink() but failed.

    Thank you

    #57952
    Barry
    Member

    Sorry, didn’t mean to be rude, by hacky I meant I was hoping to not edit code that might later get overwritten in an update

    No problem at all – I figured you meant something like that 🙂

    So long as you follow the correct template override procedures, which for WooCommerce are pretty similar to our own, they should not be overwritten in a future update – since the overrides will live outside of the plugin directory. If in addition to this you use a child theme (or whatever procedure your theme vendor recommends for theme customizations) then this should be perfectly safe.

    Re a non-hardcoded approach to linking to the events page, can you try switching out some code in your template override as detailed here? That seems to work for me.

    #58442
    simplicityltd
    Participant

    worked a treat, thank you

    #58472
    Barry
    Member

    No problem, happy to help 🙂

    #640496
    Emiliano Pasini
    Participant

    Hi, I have the same problem.
    When the cart is empty and you get the ‘return to shop’ button, that takes you back to the Woocommerce styled shop but would rather redirect it back to the Ticket list.
    Not sure where I can find —> cart/cart-empty.php to make it work, I’m using WordPress 3.9.1, maybe the php file has changed??
    Thanks!

    #640754
    Barry
    Member

    Hi!

    It’s a WooCommerce template so you’d need to look in that plugin’s directory for the original version of the template.

    As this is actually a pretty old topic though (it was created about 1 year ago) and we generally prefer people create new threads of their own I’ll go ahead and close out this one. Please do feel free to create a new thread if you need further assistance, though, and if we can help or point you in the right direction we’ll be happy to do so 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Setting Shop base page to events URL’ is closed to new replies.