// Replace Add to Cart text and make it go directly to checkout
add_filter( 'woocommerce_loop_add_to_cart_link', 'mk_replace_add_to_cart_button', 10, 3 );
function mk_replace_add_to_cart_button( $button, $product, $args ) {
// āϝāĻĻāĻŋ āĻĒā§āϰā§āĻĄāĻžāĻā§āĻ āϏā§āĻāĻ āĻĨāĻžāĻā§ āĻāĻŦāĻ simple product āĻšāϝāĻŧ
if ( $product->is_purchasable() && $product->is_in_stock() && $product->is_type( 'simple' ) ) {
$checkout_url = wc_get_checkout_url();
// āύāϤā§āύ āĻŦāĻžāĻāύ āϤā§āϰāĻŋ
$button = sprintf(
'āĻ
āϰā§āĻĄāĻžāϰ āĻāϰā§āύ',
esc_url( $checkout_url ),
esc_attr( $product->get_id() )
);
}
return $button;
}