Reserve In Store Developer Docs
  • Introduction
  • Visual Customization
    • HTML/Liquid Templates
    • Email Templates
    • Custom CSS
    • Custom Integration
      • Product Page Button
      • Cart/Global Button
      • Stock Indicator
  • Behavior Customization
    • Javascript API
      • Methods
      • Events
    • Webhooks
    • REST API
      • GET /locations.json
      • GET /inventory.json
      • GET /reservations.json
Powered by GitBook
On this page

Was this helpful?

  1. Behavior Customization

Javascript API

PreviousStock IndicatorNextMethods

Last updated 6 years ago

Was this helpful?

You can reference the reserve in store JS API with the code window.reserveInStore or ris for short.

console.log("Reserve In-store Version: ", ris.version);

This global variable will be available once the system is initialized.

If you're not sure if your code will get run before or after the Reserve In Store app gets initialized, you should use the "push" method of running your code. See the 'push' method.

Example: Alert preferred location upon initialization

window.ris = window.ris || [];
window.ris.push('on', {
  event: 'init',
  callback: function() {
    ris.getLocation(function(location) {
      if (location) {      
        alert("Preferred location is currently set to: "+ location.name);
      } else {
        alert("No preferred location is available.");
      }
    });
  }
});
Methods
Events