WooCommerce – Customizing Checkout Fields

Adding a new field to checkout and Order info on WooCommerce Admin

Working on my latest project I’ve needed to add a new field to WooCommerce checkout, a “NIF” (Portuguese equivalent of VAT number) field, that isn’t available by default in WooCommerce checkout.

After checking a couple of websites I’ve ended up creating the following snippet:

// Hook in WooCommerce checkout fields and add new field
add_filter( 'woocommerce_checkout_fields' , 'add_field_to_checkout' );

// Our hooked in function - $fields is passed via the filter!
function add_field_to_checkout( $fields ) {

$fields['billing']['billing_fieldname'] = array(
    'label' => __('Field Name', 'woocommerce'),
    'placeholder' => _x('Field Label as placeholder', 'placeholder', 'woocommerce'),
    'required' => false,
    'class' => array('form-row-wide'),
    'clear' => true
  );

return $fields;
}

//Add info on Admin
function add_field_to_admin($order){
  echo "<p><strong>Field Name:</strong> " . $order->order_custom_fields['_billing_fieldname'][0] . "</p>";
}

add_action( 'woocommerce_admin_order_data_after_billing_address', 'add_field_to_admin', 10, 1 );

With this little snippet you can add your new field to “billing” or “shipping” information.

Experimenting with WordPress Multisite

Managing multiple WordPress powered websites

The Problem

In my current position the web team is in charge of the day to day maintenance of more than 20 WordPress websites.

In order to facilitate this maintenance I’ve searched for a tool wich allow us to quickly update, install and uninstall plugins and WordPress core, this day to day task has being done by hand and sometimes left behind do to it’s time consuming nature.

 

WordPress Multisite

When I first heard about Multisite, I was thrilled, a free tool that allows me to manage multiple websites, and It’s totally embed with the usual WordPress install even greater, used also to power WordPress.com and all it’s websites, must be awesome! And it’s but not to manage multiple websites with different scopes and different types of information and built by different people, let’s see why…

 

The Pros of using WordPress Multisite

  • Ability to update plugins across all websites at once
  • Manage all themes, plugins and WordPress install from a single dashboard
  • Ability to map new domains with a few clicks
  • Ability to use child-themes to raise the repetition in theme building

The Cons of using WordPress Multisite

  •  All websites are in the same database
  • Difficult retro-activity (import all sites to the multisite installation is very time consuming due to the amount of manual changes needed in each one)
  • Possible plugin incompatibility in some older websites
  • Unable to provide our clients with a FTP access, as all the website share the same installation and folders (only upload folders are defined “per-site”

Conclusion

WordPress Multisite it’s great and awesome and I’ll be using it to build a Websites network (of similar websites), exactly it’s purpose, but I won’t be using it to manage a website network.

Why?

A Multisite install it’s harder to manage and more heavy to the server maintenance and it won’t excel in managing multiple and different websites, each one with different plugins, different approaches and different functionalities.

 

The Solution

After some research I’ve found one excellent alternative http://infinitewp.com/.

It’s tools allows me to perform almost every action I wished to achieve using WordPress Multisite from a single dashboard and it’s FREE (I love that, as will your employer/client).

Some of infiniteWP functionalities are paid “add-ons” but the free version takes care of almost every part of the routine maintenance of the network and some of the “add-ons” sound really great also.

One of the big “PROS” of this tool is that it’s self-hosted, awesome for someone who wishes to guarantee that everything he uses will be around when he needs it and wont be disappearing without any warning.

 

Note:

There are other tools that may be better looking or even with more functionalities like: ManageWP, WP Remote, Worpit, etc.

Our choice for infinite WP is based essentially in it’s FREE version capabilities and in being a self-hosted solution.

Hello World

As the first post in my blog, I’m going to do something completely “new” introduce myself.
A hello to you, probably one of the three people who’ll be reading this.

So hi, my name is Ricardo I’m from Portugal and I’m a professional webdesigner and developer since 2007, and after so many years building my own cms and managing tools I’ve (truly) discovered WordPress in July 2012 and I’m loving it!

I consider myself a fanatic and evangelist of WordPress, for me the CMS, blogging and even ecommerce  solution for everyone, from small to large projects and clients.

I’ve been pushed to start my blog by my team leader @vitorsilva and I’m now ready and eager to start sharing my experience and opinions on WordPress development, Webdesign, Front-end development, Branding and other stuff I might write about in the future.