Adding a buy now button in WooCommerce without a plugin is actually quite simple. All you need to do is edit the code for your product page template.
The product page template is located in the WooCommerce folder of your theme. If you’re not sure which file is the product page template, you can always look for the folder named “single-product” and open the file named “single-product.php”.
Once you have located the product page template, you will need to edit the code in two places. The first place is at the very top of the file. You will see a line of code that says:
You will need to replace that line of code with the following:
The second place you will need to edit the code is near the bottom of the file. There is a line of code that says:
is_type( ‘simple’ ) && $product->get_sku() ) : ?>
get_sku() ) ? $sku : esc_html__( ‘N/A’, ‘woocommerce’ ); ?>.
‘; ?>.
:.
get weight() ); ?>.