Back to Blog
eCommerce Jul 15, 2013

WooCommerce Drop Shipping

Eran Shor

Eran Shor

We develop smart plugins, apps, solutions and integrations for WooCommerce and Shopify.

If you run a WooCommerce store you probably work with suppliers that provide a drop ship service? if yes, you probably spend a lot of time directing the order emails to your suppliers, this makes managing orders a frustrating process. Basically, when you receive the order email, you need to forward the email to the supplier while deleting from the email  body information that you prefer they will not see (prices, customer payment info, etc’).

In addition, there is  a scenario where one order contains items from different supplier, in this case, you will need to forward the email to each supplier while deleting the non relevant order info.

So, you probably want to automate the process, right?

There is a WooCommerce extension that claims to Setup order and stock notifications for multiple users and third parties – Advanced Notifications extension. this sounds exactly what you need! well, not entirely (but I got a solution for that!)

I purchased the extension, installed it and did some testing to see how it works before I go live and automate the new order emails.

Within the plugin you can create a recipient, giving them a name, email address and other details. This new recipient can then be assigned notifications for events: Low stock, out of stock, Backorders and New orders (in this post I will focus on the new orders option)

So, I set up a new order rule to send every new order to the suppliers by the category/shipping class and this works well, it should save me a lot of time of email forwarding and deleting info from the order emails.. but there are a few issues, the main one is that you probably want to have a different layout then the regular emails, the advanced notification options allow you to choose if to include prices and order totals in the emails but I needed a few more options: that I think are critical for the notification emails in order to really be automatic:

  1. the billing address – the drop shipper only needs the shipping address.
  2. remove the customer info – email and Tel information – also information that I do not want my drop shipper to see.
  3. add  the order shipping method so the supplier will know in which method they should use to ship the order.
  4. force the display of the country in the shipping address even if it’s the same as the WooCommerce store base country – if you have suppliers that are located in a different country then the base country of your store and the shipping address is to the base country, you want them to have a country in the address.
  5. Change the subject line of the notification email

in order to do these changes, I needed to edit some of the plugin files. while trying to do the I found an issue, the information on the extension documentation is wrong and there is no reference how to update the notifications email,template, in fact, they provide false information and point you to change the regular WooCommerce system emails..

I needed to edit 3 files in the Advanced Notifications plugin core files – (this is something that you will need to remember before you update the extension in the future):

email template file – find it under templates –> emails –> new_order.php –  in this file I added the shipping method and I called a different order address template that I created where I removed the billing address and I only show the shipping address. I also removed from this template the customer payment details and customer email address.

the subject can be set in this file – class-wc-advanced-notifications.php –  I changed it to fit my needs.

And the last thing that i needed to do was to force the display of the country in the shipping address, this is tricky since WooCommerce removes the country from the address in case the address is the same as the base country of the store in WooCommerce. After a frustrating process of contacting woothemes support many times, I finally got a respond that made sense..

First, I commented this code


// Country is not needed if the same as base
// if ( $country == $this->get_base_country() )
// $format = str_replace( '{country}', '', $format );

in woocommerce core file: woocommerce –> classes –> class-wc-countries.php

This is a temporary fix since when I update to the next version of woocommerce it will override it but this is ok since Patrick from wooThemes said they will add a filter in the next version for that so I also placed this code in functions.php:


// Force Address to always show the country

add_filter('woocommerce_formatted_address_force_country_display', 'custom_wc_force_country_display_filter');

function custom_wc_force_country_display_filter () {
return true;
}

Now, you are set to go and have an automated drop ship process!

As a last comment, I have to say that WooCommerce needs to think about how to change the settings of this extension to include these options. I find many of the extensions that they develop to have good intentions but have business issues when you use them and one should not have to do so many changes in the files to make it fit the business scenario.

I hope that the developer of the  Advanced Notifications extension will read this post and improve the extension and the documentation for the extension..