WooCommerce: Get List of Users Who Purchased a Product ID

This time around we’ll take a look at some SQL. As you know, WooCommerce orders (same as WooCommerce products) are stored in the WordPress database.

Instead of using complex PHP loops and conditionals, sometimes knowing a bit of database “SQL SELECT” can help. I took some inspiration (because I don’t know everything by heart) from the wc_customer_bought_product()” WooCommerce function, which contains some SQL to check if a user has purchased a given product.

I’ve played a little with the same SQL SELECT call, and managed to return the list of user email addresses who have purchased a specific product ID. If you’re ever going to need this, enjoy!

Continue reading WooCommerce: Get List of Users Who Purchased a Product ID

WooCommerce: Get List of Downloadable Products

When you’re doing custom PHP work, this snippet will come handy. It’s a quick way to get a sublist of product IDs based on product meta criteria – in this case we’ll get a list of products that have “_downloadable” set to “yes” (which, translated in English, means they are “downloadable”).

Of course, you can edit this snippet to get any sublist of product IDs, for example in stock products, custom field value products, below/above sales number, and so on. Whatever is stored as a custom field can be used. Enjoy!

Continue reading WooCommerce: Get List of Downloadable Products

WooCommerce: Move Order Notes @ Checkout

We already saw how to hide Order Notes on the WooCommerce checkout page. This time around, however, our goal is to “move” them – and specifically remove them from their default position (under the shipping form) and add them back under the billing form.

As you can imagine, this is a combo snippet: (1) we remove them (and we’ll use the snippet as per the link above) and (2) we create a new billing field. Finally, (3) we also need to “save” this new field value into the original order notes custom field meta.

If this is difficult to understand don’t worry – just copy/paste the snippet into your functions.php and see magic happen. Enjoy!

Continue reading WooCommerce: Move Order Notes @ Checkout

How to Add Extra Product Options (Add-Ons) to WooCommerce

This is a guest post by Maarten Belmans of Studio Wombat – if you like the article, make sure to thank him in the comments!

If you use WooCommerce for your online business, you may have needed the ability to add extra options.

That functionality allows buyers to personalize their products exactly the way they want – whether they want to add their favorite pizza topping or buy a laptop with extra RAM.

When you provide those options, you optimize the customer experience on your website. But in order to provide those customization options, you’ll need a product add-on plugin.

That type of plugin makes it easy for you to create additional form fields, which in turn allows your visitors to customize the products they want to purchase.

Continue reading How to Add Extra Product Options (Add-Ons) to WooCommerce

WooCommerce: Additional Products Table Column @ Admin

The default WooCommerce Dashboard Products page (/wp-admin/edit.php?post_type=product page) shows the list of products in a table. Default fields are: Image, SKU, Stock, Price, Categories, Tags, Featured and Date.

Sometimes, these columns are not enough and you need more. For example, you might want to quickly take a look at a product custom field, such as “visibility” (whether the product is hidden or not).

So, here’s the snippet for that. Of course, you can adapt it to show your own custom field, an ACF field or whatever product-related information you require.

Continue reading WooCommerce: Additional Products Table Column @ Admin

6 Secrets to Running a Successful Ecommerce Business

Creating an ecommerce business can be a great way of making money, but it’s a competitive world. This is why you need to do all that you can to turn your ecommerce business into the success that you are looking for. 

There are several steps that you need to take. Here are some tips that you should find useful. 

Continue reading 6 Secrets to Running a Successful Ecommerce Business

WooCommerce: Custom Related Products

WooCommerce picks related products on the Single Product Page based on product categories and/or product tags. Related products are very important to the shopping experience, and sometimes this is not enough – what if you want to automatically show certain products based on different criteria?

So, here’s a quick snippet to e.g. get related products with the same product title of the current one. A very strange example, but you can use this as reference in case you want to get products based on different criteria.

The get_posts() function, in fact, can be customized to get products with a given stock, specific price range, same custom field value, search term, and so on.

Continue reading WooCommerce: Custom Related Products

6 Popular WooCommerce Payment Gateways

As you probably already know, WooCommerce offers the easiest way to build an online store with WordPress.

Depending on your individual needs, WooCommerce allows you to add digital products as well as subscriptions. One of the most important components of your store is the payment gateway you use.

This is what offers your shoppers a secure shopping experience by connecting your store to an online payment service where they can pay for their orders, safely and securely.

What is a WooCommerce Payment Gateway?

WooCommerce payment gateways work by verifying the billing information for every customer, approving requests and ensuring you get paid.

The type of WooCommerce payment gateway to choose depends on several factors which include how easy it is to integrate with WooCommerce, the target clients you serve, related costs and the level of security you need.

Continue reading 6 Popular WooCommerce Payment Gateways

How to Choose the Right WooCommerce Theme

WordPress truly powers the web. With over 75 million active websites currently using WordPress, it’s no wonder it’s such a natural choice for so many online businesses. When it comes to eCommerce, WordPress makes it exceptionally simple with WooCommerce.

WooCommerce is the go-to eCommerce solution for WordPress. It’s easy to install, free to use, and full of customization options that make it easy to design your own eCommerce store quickly. With thousands of easy-to-use themes, how do you know where to begin?

It’s worth being strategic when you choose your WooCommerce theme. The right theme is easy to use, enticing to your audience and helps build your brand.

Before you invest your time and money in a theme, make sure you know exactly what to look for. In this guide, we’ll cover everything you need to know to choose the right WooCommerce theme for your site. 

Continue reading How to Choose the Right WooCommerce Theme

WooCommerce: Show Checkout Even If Cart Is Empty

By default, the WooCommerce Checkout page redirects you back to the (empty) Cart page in case there are no products in the Cart.

Now, there are times when you still need users to see the Checkout page and avoid this redirect. And thankfully, WooCommerce provides us with two filters that we can use to immediately disable this default behavior. Enjoy!

Continue reading WooCommerce: Show Checkout Even If Cart Is Empty

WooCommerce: Why & How to Disable Ajax Cart Fragments

If you’re here it’s because your WooCommerce website is slow and you’re wondering why the “/?wc-ajax=get_refreshed_fragments” URL generates delays and server loads (spikes).

Besides, there is too much online literature about WooCommerce Ajax Cart Fragments (including specific plugins and performance plugin options), and you want to learn quickly what they are before understanding if and how you should disable them.

Performance optimization tools like Pingdom and GTMetrix often put the blame on this little WooCommerce functionality. And disabling it carefully can give you a boost in speed, page load and ultimately sales conversion rate.

So here’s all you need to know.

Continue reading WooCommerce: Why & How to Disable Ajax Cart Fragments

10 Travel WordPress Themes to Turn Your Hobby Into a Business

Do you like to travel and share your photos and articles? Writing a travel blog is so in trend nowadays.

The tourism business is growing fast. Many people look for how and where to go to relax. Many want to visit new places. Others want to learn more about exciting and interesting places to visit.

In this article, I included the most impressive travel themes for WordPress that are distinguished by their appearance and functionality. Of course, you will not need any supernatural code knowledge.

Themes from this selection will suit for:

  • travel blogs
  • travel magazines
  • travel agencies
  • hotel reservation

Feel free to take a look at their demos, read their descriptions and the features of those that are worth your attention.

Continue reading 10 Travel WordPress Themes to Turn Your Hobby Into a Business

WooCommerce: Add Shipping Phone @ Checkout

I’m surprised WooCommerce doesn’t offer this field out of the box. Most ecommerce websites actually require a shipping phone to organize delivery and communicate with the end customer in case there are problems.

Thankfully, there is a hook (filter) for that. It’s called “woocommerce_checkout_fields” and can be used to remove, move or add checkout fields quickly. And here’s how to add, for example, a new shipping field called “shipping_phone”. Enjoy!

Continue reading WooCommerce: Add Shipping Phone @ Checkout

WooCommerce: Count Product Recent Sales

We already talked about displaying the total number of sales for a given product ID, however what if you just want to calculate sales in the last week?

This is a much better option when you have a busy WooCommerce shop and want to increase your sales conversion rate.

So, here’s the snippet – paste to your functions.php and enjoy!

Continue reading WooCommerce: Count Product Recent Sales

WooCommerce: Save & Display Order Total Weight

For tracking purposes, or maybe because your shop manager needs to be aware of this, saving the total weight of each order and displaying it on the single order admin page is quite simple.

That’s right – WooCommerce does not save this value by default. You either need to save it yourself into the “order meta” or recalculate the weight based on the order items and their quantities. Here, we’ll cover option one (saving is better than calculating in regard to performance).

Enjoy 🙂

Continue reading WooCommerce: Save & Display Order Total Weight

7 Easy Ways to Increase Your WooCommerce Sales

WooCommerce is an awesome WordPress plugin that allows you to create a custom shop no matter what you sell. Because of its endless customization options, your shop won’t look like any other website out there.

However, when it’s time to increase your website sales and optimize your conversion rate, options, snippets and plugins can leave you feeling confused and overwhelmed.

Instead of getting stressed out and giving up, here’s a curated list of strategies and plugins that can give your WooCommerce shop a higher conversion rate.

Continue reading 7 Easy Ways to Increase Your WooCommerce Sales

WooCommerce: Calculate Sales by Product ID (Shortcode)

Let’s say you’re developing a custom sales page or a landing page. A great way to increase your conversion rate is by showing the number of purchases close to the “add to cart” button.

We’ve already seen how to do this on the single product page, but what if you need to show this on a custom page, and therefore you need a shortcode?

Well, this is super easy and I’m currently using the snippet below on my own website, and specifically in the pricing table of my #CustomizeWoo online course sales page. So, here you go – enjoy!

Continue reading WooCommerce: Calculate Sales by Product ID (Shortcode)