Coder Social home page Coder Social logo

dharmeshshah09 / recently-viewed Goto Github PK

View Code? Open in Web Editor NEW

This project forked from carolineschnapp/recently-viewed

0.0 0.0 0.0 185 KB

To use in Shopify to show recently viewed products. Requires jQuery.

Home Page: http://wiki.shopify.com/Recently_Viewed_Products

JavaScript 87.54% CSS 12.46%

recently-viewed's Introduction

To use in Shopify to display recently viewed products.

Dependencies

jQuery > 1.3
jQuery template plugin (http://api.jquery.com/category/plugins/templates)

Installation

http://wiki.shopify.com/Recently_Viewed_Products

Configuration

Configuration parameters are all optional.

You pass an object to Shopify.Products.showRecentlyViewed().

Example:

Shopify.Products.showRecentlyViewed( { howManyToShow:4 } );
  • howManyToShow – how many recently viewed products to show / list. Default value: 3. A number. Optional.
  • howManyToStoreInMemory – how many recently viewed products to store in memory (the handle of the product is stored in a cookie that lives for 3 months). Default value: 10. A number. Optional.
  • wrapperId – the id of the element in which to render the recently viewed product template. If none is specified, the script will look for a div or ul (or whatever element) with id ‘recently-viewed-products’ in the document. A string. Optional. Careful: don’t use ‘#’, just put here the value of the id attribute.
  • templateId – the id of the ‘text/x-jquery-tmpl’ template to use to render a recently viewed product. That’s your presentational layer. The HTML generated will be appended to the insides of the ‘wrapperId’ element. Optional. If no template is specified, the script will look for one with id ‘recently-viewed-product-template’. A string. Careful once more: don’t use ‘#’‚ just put here the value of the id attribute. What’s a template? See here: http://api.jquery.com/category/plugins/templates.
  • onComplete – A function to run when all recently viewed products have been rendered on the page. Totally optional. Use this if you need to do anything special when all is said and done. (You need a callback function here because Ajax calls are used to fetch information about the recently viewed products, to show a thumbnail, their price, etc.)

recently-viewed's People

Contributors

carolineschnapp 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.