Creating a Custom Table to Store Data

Paleo_To_Me
Tourist
4 0 1

Hey, everyone!

I was wondering if it's possible to create a custom database table somewhere within Shopify to store data. We're basically looking to store pickup location information, and rather than hard coding it into the theme, it'd be great if we can dynamically load it from a centralized source.

If anyone knows of a way to do this within Shopify and can help point me in the right direction, that'd be great.

Thanks!

-Eric

0 Likes
Brenton3
New Member
1 0 0

Bump -- I would also like to know this.

0 Likes
Ryan___Add_to_C
Tourist
46 0 3

The only place you can store data is on metafields. If it is for use through out the store you can put it directly on the store. Meta data is accessible through the liquid template so it is a good way to store information.

It's a little different than a database and more like a key store but once you play around with it a bit you can do some useful stuff with it.

http://docs.shopify.com/api/metafield#create

0 Likes
Jason
Shopify Expert
10041 119 1876

Lots of possible ways to stash data. The method really depends on your end use:

  • metafields (nice and hidden)
  • pages (easy to edit html data)
  • blog posts (can dedicate a whole blog to custom data articles, also easy to edit html)
  • link lists (good for short chunks of data that should appear in order.)
  • tags (less common for general data)

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Ryan___Add_to_C
Tourist
46 0 3

Jason has a good point like most other systems you can leverage pages to be static blocks that you can insert throughout your site and use blog posts for any repeatable data such as testimonials, sliders, staff profiles. If your a template or theme designer this allows you to have dynamic content your client can update later without the need to edit theme files. With that said it's always good to use custom theme settings where you can. Being an app developer we generally use metafields as Jason said they are nice and hidden and great for extending the base models such as products. 

0 Likes
Apoorva
Shopify Partner
15 0 0

Have You Found the solution?

0 Likes