mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-30 11:42:22 +08:00
https://wordpress.org/support/topic/adding-proceed-to-checkout-button-after-item-is-added-to-cart/
5 lines
387 B
Text
5 lines
387 B
Text
function wc_add_to_cart_message_html_custom_fun( $message, $products, $show_qty ) {
|
|
$button = '<a href="' . esc_url( wc_get_checkout_url() ) . '" tabindex="1" class="button wc-forward">' . esc_html__( 'Proceed to checkout', 'woocommerce' ) . '</a>';
|
|
return $message . ' ' . $button;
|
|
}
|
|
add_filter( 'wc_add_to_cart_message_html', 'wc_add_to_cart_message_html_custom_fun', 10, 3 );
|