Adding Custom Product Information with Metafields (Custom Fields)
Product metafields let you store additional product information that isn't covered by standard fields such as name, price, and description. For example, you can use metafields to store material details, care instructions, or custom attributes specific to your products.
This guide explains how product metafields work, how to create them, and how to assign metafield values to individual products.
Understanding How Product Metafields Work
A metafield is a custom field that you define for a specific type of content in SHOPLINE. When you create a metafield for products, the field becomes available for products in your store, allowing you to store additional information in a consistent format.
Each metafield includes:
- Field name: Identifies the metafield in your Admin.
- Namespace and key: Uniquely identify the metafield.
- Description: Provides optional guidance about what information should be entered.
- Data type: Determines the type of value the metafield can store, such as text, numbers, URLs, or true/false values.
Once created, the metafield appears in the Product metafields section of the product edit page.
You can then set a value for each product individually. For example, you can use product metafields to:
- Add care or washing instructions.
- Record material composition or ingredients.
- Store custom attributes used to organize or filter products.
- Store references to additional resources, such as size charts or user manuals.
| Note: Metafields can also be created for other types of content, including product categories, product variants, pages, customers, blogs, blog categories, and orders. This article focuses on metafields created for the Product module. |
Creating Product Metafields
Before you can assign a metafield value to a product, create the metafield in Settings > Customize data.
-
From your SHOPLINE Admin, go to Settings > Customize data.
-
In the Metafield section, select the Product module.
-
Click Add fields.
-
Configure the metafield, including its Field name, Namespace, Key, optional Description, Data type, and Access options.
Note: For more information about creating metafields, configuring data types and validation rules, and using metaobjects, refer to "Customizing Your Store Content with Metafields." - Click Add to create the metafield.
Assigning Metafield Values to a Product
After creating a product metafield, you can assign a value to individual products.
- From your SHOPLINE Admin, go to Products. Click Create product to create a new product, or select an existing product to edit.
- Scroll down to the Product metafields section.
-
Locate the metafield and enter the appropriate value. The type of value you can enter depends on the metafield's Data type.
- Click Save or Update to save your changes.
| Note: Some metafields, including those related to Google Merchant Center (GMC) product data, may already exist in your store without a definition. You can find them under Metafields without a definition in Settings > Customize data > the relevant module. To use one as a regular metafield, click the pencil icon and add a field name. The metafield will then appear in the Product metafields section on the product edit page. See "Setting Up Google Merchant Center (GMC) Product Metafields" for detailed information. |
Setting Up Google Merchant Center (GMC) Product Metafields
If you use Google Merchant Center (GMC), your product export file includes GMC-related fields for storing additional product data required by Google. Unlike product metafields you create manually, these metafields are generated when you import product data containing values for the corresponding GMC fields.
How GMC Product Metafields Are Created
GMC-related metafields aren't created automatically when your store is initialized. Instead, they are created through the product export and import process:
- Export your products. When you export your product list, the exported file includes columns for supported GMC fields, even if you haven't used them before. For detailed instructions on exporting products, refer to "Creating and Updating Products in Bulk with CSV Files."
-
Enter GMC product data. In the exported file, enter values in the applicable GMC field columns.
- Import the updated file. Import the product file back into SHOPLINE. When GMC field values are included, SHOPLINE creates the corresponding metafields.
-
Add definitions to the metafields. The newly generated GMC metafields don't have field names yet. Follow the steps below to add names to these metafields:
- Go to Settings > Customize data > Product, then click the Metafields without a definition tab.
-
Locate the corresponding metafield, then click the pencil icon next to it to edit it.
-
Enter a name for the metafield in the Field name field, then click Update to save the settings.
Once saved, the undefined metafield becomes a defined metafield and is moved to the Definitions tab.
-
Use the metafields on products. After you add a definition, the metafield appears in the Product metafields section of the product edit page, where you can view and manage it like other product metafields.
|
Notes:
|