evoShop.find( [ params ] )

arguments:

  • params (optional): object of parameters for searching items or a single id. If it is not provided, this returns all items
  • You can get an item simply by sending an ID:

      evoShop.find( "SCI-11" ); // returns the item with id of SCI-11, if it is in the cart
    

    You can search for items in the cart by matching one or more fields in the object, or by using inequality searches:

    var bob = evoShop.add({name: "bob" , price: 2 , color:'blue' , size: 6 }),
      joe = evoShop.add({name: "joe" , price: 3 , color:'orange' , size: 3 }),
      jeff = evoShop.add({name: "jeff" , price: 4 , color:'blue' , size: 4 }),
      bill = evoShop.add({name: "bill" , price: 5 , color:'red' , size: 5 });
    		 
    console.log( evoShop.find({ color: 'orange' }) ); // [ joe ]
    console.log( evoShop.find({ price: '>=4' }) ); // [ jeff , bill ]
    console.log( evoShop.find({ size: '<5' }) ); // [ bob , joe , jeff ]
    console.log( evoShop.find({ name: "bob" }) );  // [ bob ]
    console.log( evoShop.find({ color: 'blue', size: '<4' }) );  // [ bob ]