Adding data to an attribute #
Using the feed builder, you have the ability to include all the data from your WooCommerce products, which is stored in the database, into the corresponding attribute. When utilizing one of the channel templates, you will observe that certain attributes are already prepopulated with the accurate WooCommerce source field.
The Woocommerce Source field #
In the Feed builder, you can access all the WooCommerce product data in the Source dropdown located next to the attribute name. If the attribute is not prepopulated, the dropdown will display “– Select a source field –“. By clicking on the dropdown, you will see a list of all the WooCommerce source fields available in your webshop. Choose the appropriate source field that contains the desired data for the attribute you wish to include in the product feed. Once you generate the product feed, you will find the data stored within the attribute.
Changing prepopulated Attributes #
If, for any reason, you wish to modify the data of a prepopulated attribute, simply click on the “edit” link adjacent to the WooCommerce source. This action will open the source dropdown, enabling you to choose an alternative source field. However, in most cases, this step is unnecessary as we have already chosen the appropriate and recommended data for the channel.
Function source fields #
A range of function source fields exists, each serving a specific purpose to augment the system’s capabilities and offer greater flexibility in managing data. These fields include:
- “Use Advised source”: This will populate the attribute with the advised source. It can be used when you have changed a prepopulated attribute to a different source and want to revert to the advised source.
- “Fill with a static value”: This will open a text field where you can enter any static value. Remember that the data you enter in this field will be the same for all products. Most of the time, this field is used in conjunction with a condition.
- “Combine source fields”: This function field can be valuable, as it allows you to combine multiple source fields.
- “Remove from feed”: This function field can be used in conditions to ensure that if a condition is not met, the attribute is removed from the feed for that specific product. This can be useful if a source field is returning data that is not correct.
Finding the correct data #
The source dropdown can contain an extensive list of data, and it is not always evident which source corresponds to what data. In certain instances, there may be similar-looking source fields. Therefore, it is essential to verify the actual value contained within the source field by creating a test feed or generating the feed using different source fields. The Google channel offers the convenient “Custom_label_x” attribute, which can be used to test various source fields.
Testing for accurate data is particularly beneficial when applying conditions to assign data to the source field or when utilizing the filter function.
Support for Third-party Plugins #
By default, the source field includes data from WordPress, WooCommerce, and various supported plugins. However, it is not feasible for us to offer support for all available third-party plugins. That’s why we have included the “third-party attributes” option on the settings page.
This option allows you to integrate data from any third-party plugin that stores information in the database. Once you identify the meta_key associated with the attributes in the database, you can add it to the Third-party attributes field.
To find the correct (meta)key:
- Create a new product and enter a value in the custom field.
- Access your database, and navigate to the wp_postmeta table (using PhpMyAdmin, for example).
- Sort the table by meta_id in descending order.
- The top meta_key will correspond to the meta_key of your custom product field.
Once you have identified the meta_key, you can create a filter string using the prefix of the key (%meta_key%) and add it to the “third-party attributes” field found in our plugin’s settings page. Additionally, you should search for how the attribute is displayed in the source list, as this can vary depending on the plugin used.