My friend Ewout just answered this question a couple months ago on stackoverflow. Add the following to your theme’s functions.php file:
add_filter ('add_to_cart_redirect', 'redirect_to_checkout');
function redirect_to_checkout() {
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}
Here’s a link to his answer: https://stackoverflow.com/a/15597933/1543310
Related Posts:
- Get a list of all registered actions
- How can I force a file download in the WordPress backend?
- How to implement a customizable free OpenID authentication?
- What’s a reliable way to depend on another plugin?
- Woocommerce get cart total price in a number format [closed]
- Woocommerce – Hide “add to cart” on free products
- Is it good practice to remove redundant plugins and themes?
- Add image to post from external URL
- User profiles and object associations
- Generate Advanced Custom Fields box in custom admin menu page
- Share buttons on article footer
- How to prepend to the_title for admin-side plugin’s use
- Custom data-id wp_enqueue_script
- Whats the difference between Page Builder Plugins and Theme Builder Softwares? [closed]
- Settings API – input always updates over validation
- Creating search filter through plugin
- Should I host support forum on wordpress.org or my own website?
- How to setup a Network Plugin across the network with only my settings?
- jQuery Plugin to use WordPress functions in AJAX request
- Can a plugin deactivate itself?
- “Members only” section of a WordPress site – self signup and no backend access
- Display content from custom post type if match to main post category
- How to embed HTML code from WP Coder plugin (or other) into Main Index Template of the theme
- Which escape function to use when escaping an email or plain text?
- Wp List Table – wpdb results are not displaying
- Adding widgets to header and footer from plugin
- SEO smart plugin not working for words ending with ä, ö, å
- resetting permalinks after changing page names
- Edit Yoast SEO breadcrumbs output [closed]
- WordPress WPforms customization
- Admin accounts unable to see plugins from external IP
- WP ALL Import plugin – import data from certain ids
- Hide Elementor Templates Menu from Admin [closed]
- How to remove plugin metaboxes from edit.php
- creating a custom shop page display on archive woocommerce
- How to delete all trashed item in one-go
- Why does my file_exist check fail?
- How do I get the user ID of the user that was updated in WordPress?
- How to handle WordPress Plugin Front-end AJAX Call [duplicate]
- how to insert a HTML form into a javascript popup?
- What are admin hooks
- Fatal error on some pages after cancelling WPSTAGING cloning process
- get specific value of a array | PHP
- Programatically upload a file to be stored inside blob field in database, NOT on filesystem
- Updating WordPress plugin admin panel footer text
- Custom Login page with custom redirects for each user?
- Gravity Forms returns to odd position
- sending different email notification while registration based on user role
- How to save comment name email url fields?
- Custom Template for wordpress cpt plugin
- Give access of horizontal scroling plugin to user role editor
- Best practices for user registration with WordPress from an MVC background
- How to get a notification when the plugin is installed?
- What option do I check to enable a user role to be able to see all plugins?
- How to remove automatic generated tag in Home page
- Change the Simple Facebook Connect popup position
- WordPress Post HTML after Posting
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- After enable multisite enviroment in wordpress site creation wizard not working
- More than one WordPress site using the same database – how to disable plugin for one site?
- WordPress plugin isn’t loading completely
- Custom Meta box change size
- How to display category list with category featured image
- The Build menu theme is frozen with the wordpress theme
- WPML – Stop language redirection in initial load
- How to get a post views count using ‘WordPress popular posts’ plugin
- WordPress PWA with Form
- Page not found after creating the add new post slider using custom post type
- Allow a page to be edited by a specific custom role
- How achive serving multiple concurrent Ajax / Rest calls in plugin?
- How do you remove question mark in URL in get method?
- Get all user meta_keys and then group users by matching values
- Any method to make specific widget for every post and page?
- How to add php plugin code in theme
- AddThis Plugin adding html comments in P tags
- Embed Javascript code to registered users only
- Need help for creating custom table on wordpress
- get_option returning old value for non-admin users
- ound this in Where to edit Custom Content fields to optional if there is no plug in?
- How to add a meaningful link in plugin admin panel?
- Setup SMTP setting in wordpress
- Insert data in custom table during new post creation
- Widget redirecting to home page
- Advanced Custom Fields Plugin – not displaying images
- Notification When Post Approved
- Meta Box plugin image_advanced not showing up on frontend
- Creating Features List in WordPress Post
- why i cannot see some plugins while they are enabled on network admin page?
- I am using multi image metabox plugin but I did get how to display the images in templete?
- WooCommerce Email Customization
- SSL not working for checkout
- Change page content based on dropdown selection
- How can I properly sanitize the update_option in WordPress?
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- Why is my menu page not being displayed?
- how to update WordPress plugins from external website with nodejs?
- this code is fiven by chat-gtp but nothing match even I key in the value of a cell. help!
- How do i fix this error?
- How do i display the number of images on the “post screen”
- Set the Social Icon Size in footer