Reading Time: Minutes

Absolute Antibody Case Study: Syncing Products via the WooCommerce API

Founded in 2012 in Oxford, UK, Absolute Antibody Ltd are experts in antibody sequencing, engineering and recombinant manufacture. Their mission is to bring therapeutic grade antibodies to the research and diagnostics market. This quest has lead to an extremely complex product catalog.

Over the last year, we at Electric Studio have partnered with Absolute Antibody to rework their website. The primary aims were to improve the customer experience and reduce the amount of repeated information on the site. This meant that we had to understand their product catalog, which without a related degree was no walk in the park! Each antibody product is based on a specific clone, and each is sold in a variety of sizes and conjugations with different price points.

The Absolute Antibody site features an extensive catalog of reagents for research and diagnostic use, including antibodies against viral antigens

Based on our previous experiences we chose to implement a solution using WooCommerce. We used a combination of WooCommerce’s native grouped and variable products to represent the catalog in a way that matched the Absolute Antibody product structure.

We integrated the site with ElasticSearch to improve the speed of the search and category pages. We did this using a hosted solution with Elastic Cloud and utilizing ElasticPress to index the product data, with some additional customizations to mostly limit responses to grouped products. This improves the navigation of the product catalogue, helping people to find the antibody they need more quickly.

The product page on the site was designed to allow all of the relevant information to be shown at the right time without repetition. It is based on the grouped product, and using Ajax calls to pull in different levels of product information users can easily switch between antibody products based on a given clone. Buyers can quickly see and select the appropriate size and required conjugation.

An antibody product page using Ajax calls to pull in different levels of product information

The Sync Tool: From 8 hours to as little as 20 minutes

Of course, the product catalog already featured over 4,500 antibody products, grouped under 800+ clones and each having up to fifteen variations – altogether around 50,000 different products. There was no way that an editor was going to add each of these products into the new website manually! A sync tool was required.

Absolute Antibody already had a sync tool for their previous site. However, it had been built before the WooCommerce REST API had been available and was built for a substantially different site structure. It was decided to rewrite the tool from scratch to take advantage of the latest improvements in the WooCommerce API. The product data is currently stored in a Microsoft SQL Azure database, for which Absolute Antibody already had a Dreamfactory installation to enable an interface with Salesforce.

We decided to use Laravel to write the new sync tool with a WooCommerce API library, and to utilize the current Dreamfactory installation to access the data securely. We pulled the data into a local database, which enabled us to add web-specific details at this point – e.g. to store the product IDs and compute the product categories. We then pushed this data into the website via the WooCommerce API – creating the variable products first before adding the variations, and then creating the grouped products once we have product IDs for all of their children.

We also built a small additional API to allow us to sync the image data (including captions) for the products through to the website. This API piggy-backs onto the WooCommerce Rest API authentication, making the calls more secure. The images can be uploaded to the media library on the website as usual, and the API only adds the data once the images are present.

Users are able to select a custom conjugation for their selected antibody on demans

Obviously with 50,000 products the speed of the sync was of great importance: the faster the sync, the more frequently it can be run and the better the site stays up to date. The previous sync took between eight and twelve hours to run a complete product sync, which obviously is not something that can run regularly.

The faster the sync, the more frequently it can be run and the better the site stays up to date.

We put a lot of work into the efficiency of the code, looking at everything from the structure of Dreamfactory API queries, where best to manipulate the product data, and even optimizing the batch size to push to WooCommerce. The new tool can complete a full product sync in four to six hours – around half the time of the old sync! That was a big improvement but still quite a chunk of time…

By pulling the data into an intermediate database we were able to mark which products have changed since the previous sync. This means that we can do an incremental synchronization which can take as little as twenty minutes – depending on how much has changed. This is a sync that can be run multiple times a day, keeping the products up to date.

The future

Absolute Antibody are continuing to grow, with both new offices and more products. Using WordPress and WooCommerce they now have a clean site that will be able to grow with them. We look forward to continuing to work with them as they do.

—————–

Dr Ellie Martin is a senior backend developer at Electric Studio, a WordPress agency based in Oxford, UK.

Have Work For Us?

Let's Discuss Your Project

At Hostyler Group, We Craft Visually Stunning & Functional Websites

CONTACT US

Support@Hostyler.com
6 AM to 8 PM (GMT)
© Copyright 2024 Hostyler Group
Sitemap Privacy Policy Terms of Service