Change the WooCommerce Price Display

Posted by Prem Tiwari | Updated on | WooCommerce


Change the WooCommerce Price Display. Let’s say you want to add a label to the end of all of your product prices, such as “per package” (helpful if your products are bundles of something or …

WooCommerce assign an author to a product

Posted by Prem Tiwari | Updated on | WooCommerce


WooCommerce assign an author to a product. Simply use add_post_type_support:

How to display custom field in WooCommerce orders in admin panel?

Posted by Prem Tiwari | Updated on | WooCommerce


The code you have provided is incomplete. Not sure if that is the only code you are using to achieve what you want. So, besides first code block which you have provided, bellow I am …

How to edit the get_price_html in WooCommerce

Posted by Prem Tiwari | Updated on | WooCommerce


How to edit the get_price_html in WooCommerce? Core and plugin files should never be edited directly, as any updates could overwrite your changes. If you look in WooCommerce source at the get_price_html method, there are …

How to reorder billing fields in WooCommerce Checkout template?

Posted by Prem Tiwari | Updated on | WooCommerce


How to reorder billing fields in WooCommerce Checkout template. Same can be done through functions.php in your (child) theme:

WooCommerce change display order of product short description and price

Posted by Prem Tiwari | Updated on | WooCommerce


WooCommerce change display order of product short description and price. If you look at woocommerce/templates/content-single-product.php you’ll see that the product summary is constructed using hooks with different priorities. Here’s the relevant section: The price has …

Hide prices and checkout functionality in WooCommerce

Posted by Prem Tiwari | Updated on | WooCommerce


Luckily WooCommerce has many hooks, this removes prices and buttons. you can dig into content-product.php and content-single-product.php if you need to remove more stuff.

Display featured products through custom loop in woocommerce on template page

Posted by Prem Tiwari | Updated on | WooCommerce


Change your args to be like this: This has changed in WooCommerce 3.0. It’s not simply a meta_query, but now includes a tax_query. The arguments are now:

How to get the user belonging to an order in WooCommerce?

Posted by Prem Tiwari | Updated on | WooCommerce


From the __get() method in the WC_Order class you can see that the user_id property is taken from/stored as _customer_user post meta for the order in question. So in your code you can grab the …

How to check if the product is in a certain category on a single-product.php in WooCommerce?

Posted by Prem Tiwari | Updated on | WooCommerce


Use the below code to check if the product is in a certain category on a single-product.php in WooCommerce.

Filter WooCommerce Orders query with user meta data

Posted by Prem Tiwari | Updated on | WooCommerce


You can do it by using your WP_User_Query in a WC_Order_Query with the customer_id argument this way:

WooCommerce – results per page not working after page reload

Posted by Prem Tiwari | Updated on | WooCommerce


In this answer, You will learn how to get the results per page not working after page reload in your WooCommerce store. Let’s imagine you got a dropdown like the following Then we need a …

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 …