How to fetch products only with images in Woocommerce ?

In this tutorial we’ll learn how to fetch only those products that have images. By default Woocommerce displays all the products whether or not they have images. If a product doesn’t have any image Woocommerce will display an image placeholder instead. So, now we want to display products whose images are set. Here is my …

How to fetch products only with images in Woocommerce ? Read More »

How to display custom field value on archive product page in Woocommerce?

In this tutorial we’ll learn how to display checkout page payment options as dropdown. By default woocommerce display payment options as radio buttons. Now, let’s say we want to replace these radio buttons with a dropdown. To do this go to ROOT/wp-content/plugins/woocommerce/templates/checkout and find file review-order.php. Open this file. Now find the following lines of …

How to display custom field value on archive product page in Woocommerce? Read More »

How to display checkout page payment options as dropdown in Woocommerce?

In this tutorial we’ll learn how to display checkout page payment options as dropdown. By default woocommerce display payment options as radio buttons. Now, let’s say we want to replace these radio buttons with a dropdown. To do this go to ROOT/wp-content/plugins/woocommerce/templates/checkout and find file review-order.php. Open this file. Now find the following lines of …

How to display checkout page payment options as dropdown in Woocommerce? Read More »

How to display a specific payment method for logged in users only in Woocommerce?

In this tutorial we’ll learn how to display a specific payment option for logged in users only. First of all let’s have a look at our checkout page, what payment methods are being displayed initially. To do this add some items in cart and go to cart then proceed to checkout. Here is the default …

How to display a specific payment method for logged in users only in Woocommerce? Read More »

How to open external/affiliate product links to a new tab in WooCommerce?

One of the few deficiencies in WooCommerce are regarding external / affiliate product links. We use external products when we want to display products on our site that are being sold on another site. This is a great functionality, however there is a little glitch i.e. external product links open in the same tab which …

How to open external/affiliate product links to a new tab in WooCommerce? Read More »

How to restrict users to order product in multiples of an quantity Woocommerce?

We often come up with a store or scenario where we need to sell products in multiples. For example a dozen of eggs which will be multiple of 12, pack of candles which could be 3,6,12. In this tutorial we’ll learn how to restrict users to order products in multiple of n quantity, where n …

How to restrict users to order product in multiples of an quantity Woocommerce? Read More »

How to remove product images from archive page in Woocommerce?

In this tutorial we’ll learn how to remove product images from product archive page. Fortunatley, we can achieve this by using one of woocommerce’s default hooks. Here is our default product archive page: Now we need to remove these product images from this page. To do this, add the following lines of code at the …

How to remove product images from archive page in Woocommerce? Read More »

How to redirect customer to custom thank you page in Woocommerce?

Depending on the success or failure of an order one needs to redirect their customers. In case of success, redirecting your customers to a Thank You page is a good practice. It also gives confirmation to the customer about the order being placed. WooCommerce has a default Success Page and customers are redirected to it …

How to redirect customer to custom thank you page in Woocommerce? Read More »

How to execute a javascript function just before saving a Woocommerce post or a product?

In this tutorial we’ll learn how to execute a javascript function just before creating/saving a woocommerce product. To do this add the following lines of code at the end of your functions.php file. functionadmin_queue( $hook ) { global $post; if ( $hook == ‘post-new.php’ || $hook == ‘post.php’ ) { if ( ‘product’ === $post->post_type …

How to execute a javascript function just before saving a Woocommerce post or a product? Read More »