WooCommerce is a free and open-source e-commerce plugin for WordPress websites, and many people use it to build their own online malls. However, some users want to make the checkout process a little smoother as a way to improve the user experience of their website. Skipping the shopping cart page in WooCommerce not only makes the user experience better, but also improves the sales conversion rate and speeds up the checkout process. So how do we do skip cart page?
![Image [1] - Ways to directly skip the shopping cart page in WooCommerce - Photon Fluctuation Network | Professional WordPress repair service, global reach, quick response](http://gqxi.cn/wp-content/uploads/2024/03/image-336-1024x579.png)
I. WooCommerce Default Settings Skip Cart Page
1. Open WooCommerce Settings > Products, and under the "Add to Cart Behavior" section, check the "Redirect to cart page after successful add" option.
![Image [2] - Ways to directly skip the shopping cart page in WooCommerce - Photon Fluctuation Network | Professional WordPress repair service, global reach, quick response](http://gqxi.cn/wp-content/uploads/2024/03/image-332-1024x505.png)
2. Set and select the shopping cart page as the checkout page in "Advanced".
![Image [3] - Ways to directly skip the shopping cart page in WooCommerce - Photon Fluctuation Network | Professional WordPress repair service, worldwide, fast response](http://gqxi.cn/wp-content/uploads/2024/03/image-333-1024x607.png)
Second, use the plugin to skip the shopping cart page in WooCommerce
1, open the WordPress website background, download the "Direct checkout for WooCommerce" plugin and click to enable;
![Image [4] - Ways to directly skip the shopping cart page in WooCommerce - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Quick Response](http://gqxi.cn/wp-content/uploads/2024/03/image-334-1024x491.png)
2. ToWooCommerceSettings > Products and uncheck the Add to Cart Behavior section;
![Image [5] - Ways to directly skip the shopping cart page in WooCommerce - Photon Flux | Professional WordPress Repair Service, Global Reach, Quick Response](http://gqxi.cn/wp-content/uploads/2024/03/image-335-1024x502.png)
3. Save the changes and go to the "Direct Checkout" tab, then select "Yes" from the "Add to Cart Redirection" option, a new option will appear A new option will appear "Added to cart redirection to", from there select "Checkout" page.
4. After saving your changes, click the button on any product in the Add to Cart store. It should be redirected to the checkout page, not the shopping cart page.
Third, skip the shopping cart page in WooCommerce by code
1, open the WordPress dashboard, click WooCommerce > Settings, click "Products" > "General", in the "Add to cart behavior" section. section, uncheck both options.
2, next, open the theme folder and find the functions.php file; add the following code snippet to the end of the functions.php file.
add_filter('add_to_cart_redirect', 'cw_redirect_add_to_cart');
function cw_redirect_add_to_cart() {
global $woocommerce.
$cw_redirect_url_checkout = $woocommerce->cart->get_checkout_url(); return $cw_redirect_url_checkout; function cw_redirect_add_to_cart()
return $cw_redirect_url_checkout;
}
3. After adding the code, clicking on the action will redirect to the checkout page. As a result of button labeling in WooCommerce, the product should be added from "Add to Cart" to the recipient "Buy for Me". To do this, add the following filter to the functions.php file.
add_filter( 'woocommerce_product_single_add_to_cart_text', 'cw_btntext_cart' );
add_filter( 'woocommerce_product_add_to_cart_text', 'cw_btntext_cart' );
function cw_btntext_cart() {
return __( 'Buy Me', 'woocommerce' );
}
Link to this article:http://gqxi.cn/en/6677The article is copyrighted and must be reproduced with attribution.
No comments