eCommerce-powered 3D printing

This post talks about using WooCommerce, a free and open-source ecommerce plugin for WordPress, but the same principles could be applied to any ecommerce software.

A couple short weeks ago, you allowed me to take a risk and show you several WooCommerce API powered demos live on stage at WooConf 2016.

It went well for the most part, with attendees (both in the audience and online) getting to see a variety of integrations, like sales appearing on a LaMetric display:

To an autonomous drone that took flight when a WooCommerce sale was made:

Side note: How good are David’s GIF skills?!

And while I’m relieved, to be honest, that I don’t have to prepare and perfect that talk any longer, I made a promise on stage. One of my final slides teased at the idea of WooCommerce-powered 3D printing.

screen-shot-2016-04-18-at-9-39-26-am

I mentioned on stage that this was completely possible and that the only reason I didn’t do a live demo is that a 3D printer doesn’t really fit in carry-on.

Continue reading

Building a Freemium Plugin

Over the past few years, the concept of Freemium Software seems to have been given a lot more attention than it has in the past. Sure, the phrase was only coined 8 years ago (yeah, I looked it up), but it has existed for decades.

However, with the emergence of free web software and libraries like WordPress & jQuery, freemium software has recently found a place in developers’ hearts.

Especially in the world of gaming, both online (Facebook) and mobile (iPhone / Android), freemium software has started to become the norm, with content producers finding that it’s more profitable to give a little bit for free and charge a lot for the extras.

Continue reading

Adding a Section to a Settings Tab in WooCommerce

I published this over in the WooCommerce Developer Docs the other day. Please keep it in mind if you’re developing an extension for WooCommerce – along with the Create a WooCommerce Plugin guide.

When you’re adding building an extension for WooCommerce that requires settings of some kind, it’s important to ask yourself: Where do they belong?

If your extension just has a couple of simple settings, do you really need to create a new tab specifically for it? Most likely the answer is no.

Continue reading

Open ‘Calculate Shipping’ Box on WooCommerce Cart Page Load

I’ve seen this request a couple times while helping out WooCommerce customers so I thought I’d share a quick CSS snippet that will do just that.

Add the following to your custom.css file or with a plugin like Simple Custom CSS:

.shipping-calculator-form {
    display: block !important;
}

This will make the Calculate Shipping box automatically open when the Cart page is loaded.

Add PDF to WooCommerce Order Email

Quick little snippet that will let you add a static PDF file (or in fact, any kind of file) to the WooCommerce Order Emails.

Just add the following code to the ‘custom functions’ area of your functions.php file:

Delete the php first line if you are having errors come up after saving the file.

Now simply edit the $your_pdf_path variable to be wherever your PDF (or other file) is located!

Too easy, right?

Reference: http://wordpress.org/support/topic/pdf-attach-terms-and-conditions-to-email

Order Products by ‘On Sale’ in WooCommerce

Have you ever wanted to place your on sale items at the top of your product listings? You can pretty easily do it in a couple of ways.

Screen Shot 2014-07-14 at 3.51.59 pm

If you would like to add a ‘On Sale’ option to the ‘orderby’ menu, so users can choose to order it themselves, add the following code to the ‘custom functions’ area of your functions.php file:

However, if you would like to make it the default order, add this:

I hope that helps you out!

Change the WooCommerce Auto Generated Password

In WooCommerce, there’s a setting under WooCommerce > Settings > Accounts to automatically generate a customer’s password. This way user’s only have to enter an email when they register (with the password generated and sent to their email address), similar to how WordPress handles registration by default.

WooCommerce uses WordPress’ core wp_generate_password() function to generate the password, but you may want to change this.

You can do this by filtering woocommerce_new_customer_data, declared around line 102 of woocommerce/includes/wc-customer-functions.php:

So, if for example you wanted to make the password generate as the user’s email, you could use the following:

Or perhaps you want to use the wp_generate_password() function but customise it a little bit, so that it’s only 6 characters and uses all special characters. Something like this would work:

If it helps you out or you were able to customise and make something even more awesome, let me know!

How to Fix the WooCommerce Quantity Field in Firefox

As I’ve been settling into my new position as a WooCommerce Support Ninja at WooThemes, I’ve been seeing the following issue appear for some users in Firefox.

It’s important to note, that this is not actually an issue with WooCommerce, but often caused by Javascript conflicts/errors on one’s site.

You may notice an issue with the quantity field on a product’s page, where a user can’t use the jQuery number input form. It seems to be just another set of up/down arrows inside of the text box, with no ability to actually write a quantity number.

If you’re having trouble solving the Javascript problem (you should solve it), and you’re too lazy to get help and fix it (really, you should fix it), you can add the following to your custom.css / style.css file or with a plugin like Simple Custom CSS:

https://gist.github.com/bryceadams/d7d53ff7f831ba87d612.js

I hope that helps you out!