Giter Club home page Giter Club logo

related-products's Introduction

Related Products

This is a Shopify Application running on Sinatra. At the moment it is without any real style. That will change once I fire up Compass and compile some SASS into the project. The purpose of this application is quite simple. When editing a Product in the Shopify admin, you can click a link to establish related products for the Product. The algorithm is simple. You enter some tags that will locate the products you want to be related to the one you’re working on. The system will find all the matching Products and save them as a set or collection. This set is then saved in a special Metafield namespaced as related_products. In Liquid, you can then look for the namespace related_products, and if it exists, you can save the value which represents the related products.

Why?

Most related product algorithms I have seen operate using tags in the same way. They iterate using Liquid forloops over huge collections like all products. This is terribly inefficient. The idea was to create a custom collection for related products. The problem with this is not only a potentially huge number of collections to manage due to the addition of these related product collections, but also, Shopify smart collections currently have no interaction with Tags. Therefore, managing any collection is a manual endeavor which limits the use of this technique.

My application is simple and solves these problems. If you want to relate a product to other products, simply provide any Tags you think are needed to tie them together. The application creates everything and you’re done. Of course, this algorithm is now ripe for further customizing. You could search only desired collections for products, perhaps provide a whitelist and blacklist of tags to search, many many options. Also, providing a limit on the number of products in the set is easily added.

Usage

Add the application to your Shopify Admin, and go to town. The source code is all here, assuming you have some skills with Sinatra and Ruby, it is open-source and easy to hack. I have not published the App on the App store, but maybe that will happen one day.

The original inspiration goes to Jesse Storimer for his Sinatra app made public last summer.

related-products's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.