Harvest: WooCommerce

This plugin is intended for use by capable WordPress users, but there are a couple of more advanced techniques in here too. If you’ve been able to set up WooCommerce yourself then you should be able to follow most of this document. If you’d like help then please get in touch with us at support@vialibri.net.

Our aim with this plugin is to take all the hard work out of connecting WooCommerce to viaLibri so that your books can appear in our search results.

This a beta version of the plugin and we are eager to hear any feedback you have about it. Please do contact us if there’s a missing feature that would stop you using the plugin, or if you find something that looks like a bug.

Installing the plugins

There are actually two plugins to download: the first is our generic WordPress Harvest plugin, the second is the add-on for this that interfaces with WooCommerce.

Neither are available in the WordPress repository and they must be downloaded directly from us using the URLs below. Add these to your WordPress installation in the normal way. If you’re not familiar with this then follow these instructions, ignoring the section about WordPress Plugin Search. Don’t forget to activate the plugins too!

A note about author names

By default WooCommerce has no standard way of storing author names. We support three different ways of solving this problem. Which one is most appropriate will depend on how your data is formatted and how your theme displays this data.

The different approaches you can choose from are:

  1. Put the author name in the short description field.
  2. Add a product attribute for the author and store the author name in there.
  3. Include the author name in the product title.

If you’re taking the last option then our plugin offers a way of separating out the two different values when sending them to our database. For optimum searching of your book data on viaLibri we want these two bits of data separately.

We recommend that you approach this by using a standard layout for your product titles in WooCommerce. For example, you could use one of the following:

  • Title by Author” e.g. “Dracula by Bram Stoker”
  • AuthorTitle” e.g. “Bram Stoker – Dracula”
  • TitleAuthor” e.g. “Dracula – Bram Stoker”

Or any other format of your devising. It’s not important which format you use, just that you pick one and use it consistently for as many books on your site as you can.

Note that this isn’t 100% vital. It’s not a big deal if some books don’t fit this pattern. If the plugin doesn’t know which bit of the product title is the author then it will just assume that the whole product title is the title of the book and will not send an author to our database. If someone enters a name in the author search field on viaLibri we automatically exclude all books that have no author in our database.

What if I’m not just listing books on my site?

We only want you to send us data for books, ephemera and other similar items, so you’ll need a way of filtering out all other types of products in WooCommerce.

The best way to do this is using a tag or category. Make sure that there’s one category and/or tag that all books on your site are listed under. If you’re using a category or tag heirarchy then that’s fine – the plugin will pick up all products in child categories/tags too.

Configuring the plugin

Once you’ve got your data in order it’s time to set the plugin up. You can find the settings page in your WordPress admin area under Settings -> viaLibri Harvest. There are two tabs there: one for configuring the plugin, and a second for checking that the data is coming through properly.

The first thing you’ll need to do is tell the plugin which fields you’re storing the book’s title and author in.

If there is other text in the these fields then you’ll need to give a regular expression that will be used to extract the author or title from the field. If you’re not familiar with regular expressions then it’s best to reach out to us for support here. Email us at support@vialibri.net and ask for help. On the other hand, if you’re happy with all books in your database coming to us without an author then just leave the regular expression fields blank.

If you’re using a category and/or tag to filter the products that are sent to viaLibri then pick the right values from the dropdown lists at the bottom of the page and click “Save Changes”.

Once you’ve done that it’s a good idea to switch over to the “Books” tab to see whether the book data is being processed OK. If all looks well then send us an email at support@vialibri.net to tell us you’re all set up.