Last active
August 17, 2016 15:52
-
-
Save mattkelley/39f36b43d0dd1ec41949ac6996758201 to your computer and use it in GitHub Desktop.
Sail.js demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @NOTE this demo assumes price is a Sail.js instance | |
// var price = Sail({data}); | |
// find pricing for all sitelock products | |
var sitelock = price.find.product('sitelock'); | |
// set all sitelock products to be 100 dollars | |
price.set(100, sitelock.matches); | |
// or you can operate on the return value stored on sitelock | |
sitelock.price(100); | |
// find pricing for vps product at level 1 for 12 month term and set the price to 4.25 | |
price.find.product('vps').level('l1').term('12').price(4.25); | |
// omit a level filter to set all vps levels at 12 months to be 3.25 | |
price.find.product('vps').term('24').price(3.25); | |
// If you want to restore all pricing to original state | |
price.restore(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment