This article and the associated feature development is currently a work in progress and although it can be enabled in Woosage it is not currently supported.
WooCommerce has a variable product concept that allows similar products (e.g. different sizes or colour) to be grouped under a single product. Each product within the group is referred to as a variation and each has attributes that are used to differentiate them. For example, T-shirts of different colours might have a COLOUR attribute and each product variation has the attribute with a specific value (e.g. Green).
Sage, on the other hand doesn't have any such grouping concept and this has meant Woosage was only able to create simple products - until now.
Creating Variable Products From Sage
Woosage now has the capability to add several products to a parent group to create a variable product with several variations, based on attributes defined within each Sage product. To use this facility you must enable the following option.
Woosage50>Settings>Products>Enable variable product creation
Defining Variations in Sage
Variations can be entered directly into the Sage Web>Web Defaults>Details of any product that you want to add as a variation. To assist in formatting the data we have added a facility to generate the definitions in the Woosage50 plugin at Woosage50>Settings>Tools. We also provide a Windows application that will create bulk variations in Sage from a spreadsheet.
Variations are defined in Sage using a mark-up format called YAML, which has a series of key-value pairs that describe the variations and it's link to the parent. The parent doesn't exist in Sage and will be created in the website by Woosage during the product creation/update process. The YAML format has a sensitive syntax, so we recommend using the tool or application to generate the data.
Downloading the Windows Application
If you want to define lots of variations in Sage, we
recommend using the Windows application that can be downloaded from
here and installing it as follows.
- After following the above link, open the Useful Tools folder.
- Select the VarProdImportApp_vx-x-x.zip file, where
x-x-x is the version number.
- Click the Download button at the top of the page.
- Save the file to your a local drive with access to
the Sage ACCDATA folder data path (this is the Sage Data Directory in Sage>Help>About).
- Open the zip file in the download location and click Extract
all
- Select the location to extract the application files to, preferably
in a separate folder, and tick the Show extracted files when complete checkbox.
- Click Extract
- When the extracted files are displayed right-click the file StartVarProdImportApp.bat and select Open. We recommend
adding a desktop shortcut to this file so you can easily locate it going forward.
Using the Windows Application
Locate the previously extracted file StartVarProdImportApp.bat or use the shortcut, if you created one, to open the Variable Product
Import application, which will display the following window.
Before using this application we recommend taking a backup of your Sage data.
Complete the following application inputs:
- Select CSV file - Click to open a file browse dialog, locate the CSV file to import and click Open
- Sage User - Enter the username of the Sage account being used to import the data. This user must not be logged in to Sage when using this application. The username will be retained between each use of the application
- Sage Pwd - Enter the password of the Sage account being used to import the data. The password will be retained between each use of the application
- Sage Data - Enter the full Sage data path (or data directory from the Sage>Help>About) with the ACCDATA folder appended
- Sage Ver - select the Sage version being used
Click the Import into Sage button to convert the CSV to YAML and import to Sage.
During processing the application will echo the CSV Data in the top window, the YAML output in the middle window and Sage output status in the bottom window, where the following message will be displayed for each Sage product (identified by SKU) that is successfully updated.
Successfully update SKU: ABC123
Importing the example file referenced in the following section will produce the following output in the application.
Considerations when using the Variable Product Import application
- The application will overwrite any existing data in the Sage Web>Web Defaults>Details section of the product records it updates.
- Once created by the application you can manually amend the data in Web>Web Defaults>Details and it will be updated on the website.
- The application remains open after the import is completed to allow you to select and import further CSV data files.
The CSV file can be created using a spreadsheet application, such as Excel, or a text editor, such as Notepad. The column headings are used as an aide memoir, as the data fields are positional, but they must be included. If using a spreadsheet application saving as a CSV will format the file with comma delimiters, but if using a text editor, you will need to insert commas between data items and enclose text in quotes (" ").
Column | Description |
1 | This is the SKU of the variation and is required for all variations. |
| 2 | This is the SKU code of the parent variable product, which is required for all variations. Woosage will create this product to hold the variations, if it doesn't exist. |
| 3 | This is the name of the parent product, which must be provided for at least one variation in a group, if it doesn't exist. |
4 | This is the short description of the parent product, which must be provided for one variation in a group, if it doesn't exist. |
5 | This is the optional description of the variation. If omitted, the empty column must be included. |
6 | This is the first attribute name (e.g. Colour). Variations must have at least one attribute and value. |
7 | This is the first attribute value (e.g. Red). Variations must have at least one attribute and value. |
8 | This is the second attribute name (e.g. Size) |
| 9 | This is the second attribute value (e.g. XL) |
| The attribute name and value columns can be repeated for each additional attribute |
An example file,
Sage variation creation example.csv, can be downloaded using this
link and opening the
Useful Tools folder, as described in the
Downloading the Windows Application section above.
Understanding the Variation Definitions
Whether you create the variations in Sage manually or use one of the generation tools, understanding the form of the YAML definitions will help with troubleshooting. Defining the variation and their link to a parent takes the following form, where information in square brackets, including the brackets, should be replaced by the value to be assigned.
| Defining Term | Description of term
|
| Parent: [Parent SKU] | This is the SKU code of the parent variable product, which must be specified for all variations. Woosage will create this product to hold the variations, if it doesn't exist. |
| Parent Name: [Label] | This is the name of the parent product, which must be provided for at least one variation in a group. |
| Parent Description: [Parent description] | This is the short description of the parent product, which should be provided for one variation in a group. |
| SKU: [Variation SKU] | This is the SKU of the variation and is required for all variations. |
| Description: [Variable description] | This is the optional description of the variation. |
| Variation Attributes: | This is the start of the section defining the attributes where the subsequent indented lines define the names and values of each attribute. The Name key is indented by 2 spaces. |
Name: Value1
Name: Value2
...... Name: ValueN | Where:
Name is the attribute name, such as colour or size, followed by a colon, and
Value1,2, etc is the value for this attribute, such as Red or XL
Example:
Colour: Red
Size: XL
|
Woosage has been tested for up to 3 attributes per variation.
It is only necessary to provide the parent Name and Parent Description in one variation and providing them in more than one variation will result in the last one being used.
Any other text in the Web>Web Defaults>Details will be ignored by Woosage.
Using the Woosage50 plugin YAML generator
For occasionally creating variations data there is a tool provided in the plugin at WooCommerce>Woosage50>Settings>Tools:
- Complete the sections as shown above (ticking the Use short keys will use abbreviated keys that Woosage can recognise when importing the data)
- Click Generate YAML button.
Note: Parent Name and Parent Description are optional, but must be provided for at least one variation in a group.
The output is displayed as follows, which can be copied and pasted in to the Sage product Web>Web Defaults>Detail
Note: this tool can only generate the YAML for products with a single variation attribute