Update to WooCommerce 3.5.1+

Absolute Antibody Case Study: Syncing Products via the WooCommerce API

Written by Ellie Martin on September 13, 2018 Blog, Customer stories, Technical WordPress.

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.

11 Responses

  1. Lora
    September 14, 2018 at 6:49 am #

    Yeah, I love woocomerce api

    • Marina Pape
      September 24, 2018 at 3:35 pm #

      Woo!

  2. Brenda Loew
    September 14, 2018 at 7:43 am #

    We are also think to build my own store on the woocomerce.

    • Gareth Allison
      September 18, 2018 at 11:37 am #

      We’re excited that you’re considering Woo, Brenda!

      I see that you already sell your books on Amazon – you may be interested to know that we have an Amazon Pay integration that enables customers to purchase on your site using the payment and shipping information in their Amazon accounts:

      https://woocommerce.com/products/pay-with-amazon/

      Thanks for reading the blog, and all the best with your eCommerce journey. 😊

  3. Flyttfirma Malmö
    September 15, 2018 at 11:45 am #

    We love it and thanks for this your valueable case study.

  4. Diabetes
    September 18, 2018 at 12:17 pm #

    Thanks for sharing amazing info and keep posting

  5. James
    September 18, 2018 at 7:07 pm #

    Thanks for sharing this interesting case study. I’m trying myself to work with Woo API.

    • Marina Pape
      September 21, 2018 at 7:17 am #

      Exciting! You should join the #developers channel in the WooCommerce Slack, lots of friendly people in there who would lend a hand > https://woocommerceslack.herokuapp.com/

  6. frpbypassapkpro
    September 19, 2018 at 2:51 am #

    Absolute Antibody Case Study: Syncing Products via the WooCommerce API Nice post

  7. Lewis Pearson
    September 20, 2018 at 11:09 am #

    I love the speedup process to the API when sync. Hopefully This will Help lots of Woocommerce user around the world.

  8. Wp hound
    September 25, 2018 at 3:06 pm #

    i really like the speedup process to the API when sync. hopefully this can assist lots of Woocommerce consumer around the world.

WooCommerce - the most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment
%d bloggers like this: