Linking A Course Based on Variable Product Data

In WooCommerce, a product variation allows for different product versions to be sold as a single product.

So for example, a course could have different industry vertical versions like "My Course - Home Edition" or "My Course - Work Edition".

In this document, we show how to configure Bright to build course registrations for a customer based on a product variation.

First off, you need to set up your product variations. The documentation in WooCommerce describes how to do this:

Variable Product Tutorial

Once you've set up your variations, you will need to setup the variation data in the product to associate the SCORMCloud course ID:

Defining Bright Metadata For A Product

That document shows how to set up bright metadata using a custom field. Your metadata document should follow something like this:

{
  "schemaVersion": "0.3",
  "bright-courses": [],
  "variations": [
    {
      "variationName": "Small Variation",
      "courseGuids": [
        "SmallCourseGuid",
        "ASecondCourseGuidForTheSmallVarition"
      ]
    },
    {
      "variationName": "Medium Variation",
      "courseGuids": [
        "MediumCourseGuid"
      ]
    },
    {
      "variationName": "Large Variation",
      "courseGuids": [
        "LargeCourseGuid"
      ]
    }
  ]
}

You may want to use our JSON document creation helper to create your metadata block, shown in the section below:

0.3 Bright Metadata JSON Editor

Start by creating a variation:

variationdata1

Add the variation name and some GUIDS:

variationdata2

Grab the JSON output out of the Editor:

variationdata3

Now for the important part, follow the instructions in Defining Bright Metadata to associate this JSON document with the 'bright_metadata' custom field of your product.

Now before you leave the JSON editor, we recommend you grab the direct link and save it in your product metadata! That will save you time later!

variationdata4

We recommend that you keep that URL for future reference:

variabledata5

When using variable product linking, Standard Product Linking is ignored.