How to redirect WooCommerce "add to cart" button to the checkout page without plugin?

How to redirect WooCommerce “add to cart” button to the checkout page without plugin?

These are the simple in to skip the cart after Adding a product to the basket:

1 – From admin dashboard go to WooCommerce > Settings > > General >next to “Add to cart behavior” make sure the option “Redirect to the cart page after successful addition” is checked.

2 – Moving to WooCommerce > Settings > Advanced > remove the ID from the field and add the checkout page ID into the add to cart field

3 – To rename the button add this code snippet somewhere in the functions of your

add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_cart_btn_text' );

add_filter( 'woocommerce_product_add_to_cart_text', 'custom_cart_btn_text' );

function custom_cart_btn_text() {
	
	return __( 'Buy Now!', 'woocommerce' );
}

Comments

Leave a Reply

About Rafasashi

Currently managing RECUWEB an IT Company providing cloud hosting and SaaS delivery model.

Related posts