Understanding Shopify Metaobjects - Robert Mullineux

Understanding Shopify Metaobjects

Extend Your Online Store With Shopify Metaobjects

Facebook
Twitter
Reddit

Shopify is one of the world’s most popular eCommerce platforms. In recent years, Shopify has made significant strides in enhancing its customisation options, making it a competitive solution that can hold its own against other eCommerce platforms such as WooCommerce and Magento.

One of the recent additions to Shopify is the ability to add custom fields to its objects using Metaobjects. In this blog post, we will explain what Shopify Metaobjects are, the benefits of using them, how they can be applied, and the steps to create them.

What are Shopify Metaobjects?

Shopify Metaobjects are custom fields that store additional data for Shopify objects. Default metaobjects include things like products, customers, orders, and collections. Metaobjects allow Shopify store owners to extend their online stores and add new data types (called Metaobjects) that include custom fields to store data that is relevant to their business. If  we were to compare Shopify’s metaobjects  to that of WordPress, it would be the same as a custom post type which includes custom fields.

What are the benefits of using Shopify Metaobjects?

Using Shopify Metaobjects can benefit your online store in several ways. By adding custom fields to your objects, you can improve the user experience by providing more relevant information to your customers. For example, you can add custom fields to your product pages that display additional product features, colors, or sizes. Additionally, Metaobjects can help you automate your business processes by storing additional data about your customers, products, and orders. This can save you time and effort when it comes to managing your store.

Using Shopify Metaobjects

Shopify Metaobjects can be used in various ways. Here are some examples:

Adding Metaobjects to Products

Adding Metaobjects to your products can help you store additional information about your products that is relevant to your business. For example, you can add custom fields to your product pages that display additional product features, colors, or sizes. This can help customers find the right product for their needs and improve their shopping experience.

Adding Metaobjects to Customers

Adding Metaobjects to your customers can help you store additional information about them that is relevant to your business. For example, you can store customer data such as preferences, demographics, and purchase history. This can help you personalise your marketing efforts and improve customer loyalty.

Adding Metaobjects to Orders

Adding Metaobjects to your orders can help you store additional information about them that is relevant to your business. For example, you can store order data such as shipping address, payment method, and order status. This can help you manage your orders more efficiently and provide better customer service.

Steps for creating Shopify Metaobjects

Here are the steps to create Shopify Metaobjects:

  1. From your Shopify admin, go to Content > Metaobjects or Settings > Custom data.
  2. Click Add definition.
  3. In the Name field, enter a name for your defintion. A type for your metaobject is automatically generated, and can be edited prior to saving the metaobject.
  4. Click Add field and select the content type you want to contain in this metaobject. For example, single line text. Each field has its own set of options and validation rules.
  5. Configure the field and its validation information:
    1. Optional: In the Description field, enter a description for your metaobject.
    2. Choose whether the field will be the entry’s display name by selecting Use this field as display name. The display name is the field that’s used to generate a searchable name in the index view. The display name is automatically set to the first text-based field in your metaobject definition or generated automatically if there is no text field.
    3. Configure the validation rules for the field, and then click Add.
  6. Optional: To allow storefront visibility, select Accessible from the Storefront visibility drop-down menu.
  7. Add additional fields to your metaobject as needed.
  8. Click Save.

Applying the Metaobject

Let’s imagine that you run an online store that sells unique designer products from all around the world. You want to enhance your customer’s shopping experience by displaying the name of the product designer, their country of origin, and an image of the designer on each product page. Here’s how you can create a new Metaobject called Product Designer, which is applied to Products:

  1. Follow the steps above – in this example, the Metaobject would be called Designer
  2. Add the required fields – in this example, you would add a text line for Name, a text line for Country and a file upload for the designer headshot.
  3. Once the fields are saved, head back to the Metaobjects page and click Add New.
  4. Enter the designer name, country and upload an image; then click Save.
  5. Next, when viewing the Add/Edit product page, select the Designer of the product (very bottom of the page) from the Metafield dropdown; then hit Save.
  6. Open the theme customiser and open the Product template.
  7. For this example, we will add a new section (Image and Text) and replace the values of the text by selecting the element and choosing dynamic value, followed  by the Designer Name.
  8. Repeat the process for the Country and Designer Image.
  9. Save the product template and view the page.
Adding a new Metaobject - Designer in Shopify
Adding a new Metaobject – Designer in Shopify

 

Shopify Metaobjects Explained - Robert Mullineux
Displaying a new Metafield: Product Designer in Shopify Product Template

Shopify Metaobjects are a powerful feature that allows Shopify store owners to customise their online store and store additional data about their objects. By adding Metaobjects to your products, customers, and orders, you can improve the user experience, automate your business processes, and provide better customer service. If you need help setting up Shopify Metaobjects for your online store or any other eCommerce development services, feel free to contact me. We are an experienced freelance web developer and would be happy to assist you.

Facebook
Twitter
Reddit

Get In Touch