How do I do simple data storage/retrieval?

Solved

How do I do simple data storage/retrieval?

Breisoft
Excursionist
19 1 3

Hello, I've been searching for hours for information in the docs on how to do this, but cannot seem to find it. This doesn't necessarily need to be in the context of an app, but either is fine. I'm a complete noob when it comes to this obviously, so bare with me if this is a dumb question.

Basically what I want to do is store strings of data long-term (i.e. not in temporary local storage in JavaScript) on-site about an order. I have a plugin which allows multiple vendors on one site, and I want to store the name of the vendor corresponding with the order number. I also want to store/retrieve what payment methods each vendor accepts.

What I have to do is, using custom JavaScript on the "Thank You" page after checkout, I want to make an API call via JavaScript using the name of the vendor to retrieve what payment methods they accept, and then output it in an HTML table. I also want to store the vendor's name corresponding with the order number the same way so that when the order is viewed later it will show the same information, in case the customer accidentally exits the page. 

So this is pretty simple, but I have not been able to find any information on how to store/retrieve data. It doesn't matter where or how the data is stored, it just needs to be stored on the server (rather than client) and be long term. 

Thank you!

Accepted Solution (1)

PaulNewton
Shopify Partner
6722 610 1433

This is an accepted solution.

Metafields for storing/retrieving

https://help.shopify.com/en/api/guides/metafields

 

cart attributes and or line item properties for message passing

https://help.shopify.com/en/themes/liquid/objects/cart#cart-attributes

https://help.shopify.com/en/themes/customization/products/features/get-customization-information-for...

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


View solution in original post

Replies 2 (2)

PaulNewton
Shopify Partner
6722 610 1433

This is an accepted solution.

Metafields for storing/retrieving

https://help.shopify.com/en/api/guides/metafields

 

cart attributes and or line item properties for message passing

https://help.shopify.com/en/themes/liquid/objects/cart#cart-attributes

https://help.shopify.com/en/themes/customization/products/features/get-customization-information-for...

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


Breisoft
Excursionist
19 1 3

Thank you, this is exactly what I needed.