How to get category listing of most popular products in WooCommerce?

Posted by Prem Tiwari | Updated on | WooCommerce


Want to get category listing of most popular products in WooCommerce? Popular might be in many cases like most viewing, top selling. So i listed products by top selling. This way you can get top …

WooCommerce get custom product attribute

Posted by Prem Tiwari | Updated on | WooCommerce


WooCommerce get custom product attribute. As attributes are always prepend with pa_ in DB, for getting them with wc_get_product_terms() function, you will need to use pa_pdfs instead of pdfs, this way:

WooCommerce custom jQuery event after added to cart

Posted by Prem Tiwari | Updated on | WooCommerce


WooCommerce custom jQuery event after added to cart. You need first to use jQuery instead of the alias $ and you should need to specify the “ready” state to allow the DOM to be completely …

How to Hide Payment Method in WooCommerce based on Postal Code?

Posted by Prem Tiwari | Updated on | WooCommerce


Want to Hide Payment Method in WooCommerce based on Postal Code? To disable/hidden “Cash on Delivery”, Place the below code in your theme’s function.php file.

Auto add or remove a freebie product from cart in WooCommerce

Posted by Editorial Staff | Updated on | WooCommerce


If you want to auto add or remove a freebie product from cart in your WooCommerce based online store. The following code will add a freebie product on first add to cart just once. If …

How to add a promotional product when a certain cart amount is reached

Posted by Prem Tiwari | Updated on | WooCommerce


If you want to add a promotional product when a certain cart amount is reached? As you are targeting a certain cart amount to add a promotional product in the cart, you could use woocommerce_before_calculate_totals …

How to update all variations prices of a variable product in WooCommerce?

Posted by Jennifer | Updated on | WooCommerce


If you want to update all variations prices of a variable product in WooCommerce? Depending on where and how you are using this code, you should try to include global $post; first to be able …

How to add custom field data to WooCommerce order?

Posted by Pinki | Updated on | WooCommerce


Want to add custom field data to WooCommerce order? You have missing the function to display this custom field value on the order edit page:

How are partial refunds stored in the WooCommerce Database?

Posted by Editorial Staff | Updated on | WooCommerce


In this example, We have shared how are partial refunds stored in the WooCommerce Database? Partial refund orders are stored in database like normal ones: In wp_posts table with a ‘post_type’ = ‘shop_order_refund’ and a ‘post_parent’ = order_ID (number), where the order_ID is …

How to get particular product quantity from the cart page in the WooCommerce?

Posted by Jessica Taylor | Updated on | WooCommerce


Want to get particular product quantity from the cart page in the WooCommerce? Use the below code in your theme’s php file to get the particular product quantity from the cart page.

Woocommerce rating not showing in new custom theme

Posted by Editorial Staff | Updated on | WooCommerce


Woocommerce rating not showing in new custom theme. You might need to declare WooCommerce support if you are using custom theme in order to make it compatible with WooCommerce. Default WordPress themes would be normally …

How to get minimum order amount for free shipping in WooCommerce?

Posted by Prem Tiwari | Updated on | WooCommerce


Want to get minimum order amount for free shipping in WooCommerce? This value is stored in an option under the key woocommerce_free_shipping_settings. It is an array that is loaded by the WC_Settings_API->init_settings(). If you want …

How to add a fee to WooCommerce per product based on category?

Posted by Andre Scott | Updated on | WooCommerce


Want to add a fee to WooCommerce per product, based on category? Add the below snippets in your activated theme’s functions.php file.

How to rename WooCommerce Order Status in WooCommerce?

Posted by Prem Tiwari | Updated on | WooCommerce


Want to rename WooCommerce Order Status in WooCommerce? Just renaming order status “Completed” to “Order Received”, it’s easy and can be accomplished this way with wc_order_statuses hook you will paste this snippet in your active …

How to reorder WooCommerce checkout fields?

Posted by Prem Tiwari | Updated on | WooCommerce


Want to reorder WooCommerce checkout fields? To fix this, you simply need to adjust the priority of each of the fields to fit the order that you want.