Handling EU VAT on WPJobManager.com with WooCommerce

eu

Ah the EU. Always with their bright ideas. If you haven’t heard about the upcoming changes surrounding EU VAT, first off, where have you been hiding?

To put it simply, essentially they require everyone selling digital products to customers in the EU to charge EU Tax based on the customer location, regardless of where your business is based. You can read more about the changes in the blog post I wrote on WooThemes.com here.

Being based in the UK, and selling plugins on WPJobManager.com, I am affected by these changes and so I’ve been doing a lot of research, speaking to accountants, and preparing my site for the changes.

In this post I’ll explain what I’m doing and hopefully this may give you some ideas/resources if you’re struggling with compliance.

Continue reading “Handling EU VAT on WPJobManager.com with WooCommerce”

The WooCommerce 2.1 notice API

If you’ve built a plugin for WooCommerce before you may have come across the ‘message’ functionality which let you add messages (or errors) to the frontend using:

$woocommerce->add_message( 'Hi there' )
$woocommerce->add_error( 'You bafoon' );

Part of the development of WooCommerce 2.1 was refactoring the main WooCommerce class which involved moving out unrelated methods (such as the messages) and moving them into their own classes.

We’ve replaced this particular functionality with some new functions and a new notices API which is much more flexible. The old methods are deprecated.

Continue reading “The WooCommerce 2.1 notice API”

Problems with cart sessions and WooCommerce

I was asked about WooCommerce’s session handling at WCEU (where I seized up; darn social phobia) so I thought it would be good to give a brief history of our handling of sessions, and how things are changing in 2.1.

2811214043_12666b9efd_z

Cart sessions have been a long standing source of frustration in WooCommerce. To clarify, the session is the part which tracks a particular user’s cart object – without this the user wouldn’t be able to use the cart nor checkout.

The most obvious solution would be to use PHP’s built in sessions and session_start(). This was the first thing we used (obviously) and you’d expect this to work perfectly fine…but it doesn’t for the following reasons.

Continue reading “Problems with cart sessions and WooCommerce”

What I learnt whilst tackling the box packing problem for WooCommerce Shipping

Back in January we had several shipping methods for WooCommerce for getting quotes from APIs such as UPS, USPS and FedEx. Because these APIs expected ‘packages’ to quote on, it was necessary for items to be ‘packed’ into packages with a weight and dimensions.

The original extensions attempted to pack items by attempting to stack items to see how many items would fit into a box. This was not well received, and had several flaws:

  1. Stacked items left ‘gaps’ in the box
  2. Only one box size was supported – the box just grew to envelop all items..
  3. ..or was pre-defined which lacked flexibility (any sized item would be shipped in that box)

Both the developer and I looked into solutions and this lead us to read about the BIN packing problem.

Continue reading “What I learnt whilst tackling the box packing problem for WooCommerce Shipping”

Two zero zero zero zero zero zero

Wow, what a milestone. WooCommerce has today hit 2 million downloads, just 6 months after hitting a million.

Downloads per day
Downloads per day are still growing!

How did we get here? Team WooCommerce has grown from 2 to 11 employees over the past 2 years, we’ve made 63 releases, closed 3735 Github issues (out of 3779), and solved over 30k support tickets.

Since the creation of the WooCommerce repository on Github, there have been a massive **6,284 commits*. Personally I’ve made 3,134 commits of those, with 1,187,191 line additions and 887,313 lines removed.

My contributions

WooCommerce is by far the biggest and most successful thing I’ve worked on and I’m so happy to see it flourishing, especially this quickly into it’s existence.

Platform growth

Google trends shows the increasing interest in searches related to WooCommerce which really demonstrates its popularity:

Interest from Google

This dwarfs other WordPress eCommerce plugins. Other platforms such as Magento do still have more interest average, but WooCommerce is catching up fast (given it’s age, and that its not a dedicated eCommerce solution this is pretty impressive).

BuiltWith has even more promising stats, suggesting WooCommerce powers 9% of eCommerce sites (thats 154 463 stores!). the below chart shows it’s popularity amongst the top 100k, 10k and 1 million sites. and suggests at present it is more popular with smaller sites, but that popularity is growing.

WooCommerce usage

BuiltWith also has stats about platform usage showing just what the stores they track are using. WooCommerce takes a large chunk of that pie. Interestingly many use custom carts. I would expect custom carts to be a lot more work over time for the companies involved, so perhaps those will start moving to other solutions (including WC) in the near future?

Platform usage

It’s good to see WooCommerce beating other WordPress eCommerce plugins, and even many dedicated eCommerce platforms, by a substantial margin.

What’s next?

We’ll continue to improve core (2.1 is coming out soon) build and evolve surrounding plugins, and hopefully continue with the impressive growth we’ve seen so far. As the platform evolves I imagine WooCommerce will appeal more and more to users of WordPress, and WordPress + WooCommerce will become a more serious alternative to dedicated eCommmerce platforms like Magento.

Bring on 3 million!

Deprecating plugin functions and hooks (and what we did in WooCommmerce)

Sometimes code needs to change; without doing so you can end up with a non-consistent, bloated mess. When changing things such as functions and hooks however, you do have to consider backwards compatibility so that code which relies on the old things doesn’t just stop breaking without explanation.

In WooCommerce major releases we often have to deal with this problem – in this post I’ll explain how to deprecate code, and how we dealt with it whilst developing 2.1.

Continue reading “Deprecating plugin functions and hooks (and what we did in WooCommmerce)”