Custom liquid on store page to display order metafield

Custom liquid on store page to display order metafield

RiddleOfSteel
Shopify Partner
2 0 0

I am interested in adding a custom liquid block somewhere on my store that takes a customers order and displays a metafield. Eg say there is a latitude and longitude in the metafield, I would embed a Google map with a marker using the coordinates. The metafield is added between the order creation and order fulfillment. I looked at apps like checkout blocks to add blocks to the order status page but as far as I can tell it doesn't support custom liquid blocks like you get in theme customisation. 

Is there another way to do this? Like adding a page to my store, that could take a logged in customers order id as input and have custom liquid blocks display the data? How could I do this? Or another way?

 

Thanks a lot

Replies 2 (2)

abdulmoeed37
Shopify Partner
120 12 13

Hi @RiddleOfSteel , what you can do is take the data from the order and store it in order metafield and the modify your theme to show the data in that metafield.

 

If you can let me know of the complete process and what you are trying to achieve, maybe I can guide you better and provide a solution for your problem.

 

Thanks

Helping shopify store owners.
Schedule free meeting for shopify store related problems:
If you need assistance with your store, feel free to contact me at abdulmoeed37@gmail.com
If my assistance was helpful, please consider liking and accepting the solution. Thank you!
RiddleOfSteel
Shopify Partner
2 0 0

Hi, thanks very much for your response.

 

I am new to buidling Shopify stores. I would like to sell a personalised digital product. The customer enters data on the product page which is added to the properties. When the order is complete, I send a webhook to AWS where I do some business logic and generate information that is part of their digital product. Using AWS, I use the admin API to add some of this data to the order metafields, and fulfill the order. This automatically triggers the fulfillment email, and I have edited the email template so the order metafield is formatted in the fulfillment email. However, I am limited in what I can display in an email. I would like to have a page somewhere on the store that they can access which shows their order, but where I can also insert custom liquid blocks, so I can display markers on a map (part of the product is a set of coordinates), or display data in a table, etc.

 

But as a beginner I do not know how to do this or if it is possible.

 

  • Can I add a page to my store that is dedicated to displaying order metafields from already fulfilled order (only logged in customer should be able to view their own)
  • Can the URL take an argument (like the order ID) so I can link this page in the fulfillment email
  • If this makes sense, can you show me the basic steps, and a simple example like printing the order metafield

My order metafiled in an array of JSON objects (each element is a line item), e.g. :

[
{
"Latitude": "55.86167039999999",
"Longitude": "-4.2583345",
}
]