Parabola
HomeFeaturesExamplesPricingLearn

Create a top-selling items page in your Shopify store

If you don't have a top-selling items page on your Shopify store you absolutely should.

In the early 2000s, Amazon hadn't yet got around to building a top-sellers page of their own. A site called JungleScan popped up, offering users an easy way to browse the daily top sellers. Do you want to know how much that site made every month in referral fees? You probably don't. It's safe to say: users like knowing what products are top sellers; there's some wisdom left in the crowd.

This example shows how you can build a top sellers page for your Shopify store in Parabola without writing a single line of code. If you don't use Shopify, don't despair! Parabola is pretty flexible and we can help you set up a top sellers page no matter which platform you use: Webflow, Weebly, Squarespace, Wix, whatever - just drop us a line on Intercom!

Get Started With This Template >
1
Pulling Shopify orders into Parabola

Parabola's generic API Import step makes it easy to pull in data from practically any web service. Connecting to Shopify is no different.

You'll want to drag out a new API Import step. Select 'Username & Password' from the authentication menu and supply your account id and password. Next, configure the url like so:

https://YOUR_STORE.myshopify.com/admin/api/2019-04/orders.json

2
Finding the best selling items

Next, we utilize a series of Parabola transforms to trim the (hopefully long!) list of matching orders to only the top ten best sellers. We filter for only complete orders, then use a JSON flattener to expand the order details.

We group the items to count how many of each were sold, and sort by the number sold - now the items are stack ranked by sales volume! Finally we use row numbers combined with another row filter to select only the top ten most sold items.

3
Creating and updating the page

For this next bit (the fun part), you'll want to go ahead and create a collection in Shopify and make a note of its id.

Back in Parabola we'll use another API Import to fetch your Shopify collections, and then use a row filter to grab the collection you just created. We use an API Export to delete existing products from the collection, then do something a bit funky to cross join the collection id to the list of best selling items we create earlier. If you don't know what a cross join is, don't worry; it's just a fancy way of saying we want to make sure the collection id is present in every row of data from step two.

4
Syncing the updated collection to Shopify

Now we have a list of top selling product ids, and a collection id that needs to be updated. In order to have Shopify understand the message we plan to send, we need to merge the product ids & collection ids and wrap them in a bit of JSON.

We can do this using Parabola's text merge step. This step lets you create a new column in your data based on the values of existing columns. We use a special curly-brace notation to let Parabola know when we want it to substitute a value from our data. The step configuration winds up looking like this:

{"product_id": {line_items.product_id},"collection_id": {collection_id}}

After that, we use an API Export step to push the data back to Shopify! The URL we need to fill in is a bit different this time, but you'll use the same username & password configuration from earlier:

https://YOUR_STORE.myshopify.com/admin/api/2019-04/collects.json

That's it - we're done! If any of this was confusing or you have questions about extending this example to support a more specific use case, please drop us a line on Intercom (the chat thingy on our site).

Get Started With This Template >
Start automating with Parabola
Parabola is free to use for teams of any size. We also offer paid plans with additional features and support.