WooCommerce
December 18, 2020

How to disable all payment methods in WooCommerce

You will have the need to disable all payment gateways on the site, but just disabling them in WooCommerce > Settings > Payments will not work because then the customers will get an error message since there are no payment methods available.

We’re going to be using a different method here. The way to go is to add just a single line code to the functions.php file within your theme folder.

Here’s the code:

The checkout page will now display only a Place Order button.

Related Post


Add a select field that will change price in Woocommerce simple products

To add a select field in simple products (like in variable products) that will update base price depending on the dopdown selected value, try this: Code goes in function.php file of your active child theme (or active theme).

Only Allow 1 Product in the Cart WooCommerce

We can set add to cart limit on WooCommerce cart using woocommerce_add_to_cart_validation filter. Add below code on functions.php file to limit your WooCommerce Cart to just 1 product.

Editing product data tabs on WooCommerce Product Page

You need to add the code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. Removing Tabs Use […]

Set cart item price from a hidden input field custom price in Woocommerce

First for testing purpose we add a price in the hidden input field as you don’t give the code that calculate the price: Then you will use the following to change the cart item price (WC_Session is not needed): Code goes in function.php file of your active child theme (or active theme). Tested and works.

WooCommerce Remove the Additional Information and Order Notes fields

We can remove the Additional Information and Order Notes fields in WooCommerce checkout page with 2 filters that you add to functions.php file.

Get Currency symbol WooCommerce

You can get current currency in woocommerce using get_woocommerce_currency_symbol(); function.


Leave a Reply

Your email address will not be published. Required fields are marked *