[ad_1]
Hi guys, I added below code to skip cart in Woo.
// Skip cart - straight to checkout
add_filter('add_to_cart_redirect', 'obs_skip_cart_page');
function obs_skip_cart_page () {
global $woocommerce;
$redirect_checkout = $woocommerce->cart->get_checkout_url();
return $redirect_checkout;
}
It works fine. But I get this message from Query Monitor plugin.
Hook add_to_cart_redirect is deprecated since version 3.0.0! Use woocommerce_add_to_cart_redirect instead.
Function WC_Cart::get_checkout_url is deprecated since version 2.5! Use wc_get_checkout_url instead.+
Can you guys help me updating this code to the latest Woo version.