<?php add_filter( 'woocommerce_add_to_cart_redirect', function() { return wc_get_checkout_url(); }); add_filter( 'wc_add_to_cart_message_html' , function() { return ''; }); add_filter( 'woocommerce_add_to_cart_validation', function( $passed, $product_id, $quantity ) { if( ! WC()->cart->is_empty() ) { WC()->cart->empty_cart(); } return $passed; } , 20, 3 ); remove_action( 'woocommerce_order_details_after_order_table', 'woocommerce_order_again_button' );
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter