Best WooCommerce Code Snippets:
Sometimes you just need to let the user add a product in the cart by clicking on a link. In this example, 974 is the product id, and should be replaced by the id of the product you want to add to cart. If you’re selling digital goods, you don’t necessarily need to ask the buyer for his address. In order to remove the address fields from the checkout, insert the following code into your theme functions.php file: A simple but effective way to define how many products should be displayed per page. On this example, return 25 means that 25 products will be shown, update this value with the desired number of products and append this line you your theme’s functions.php file. Here’s a simple way to automatically add a custom message above the login/registration form.