class Retailigence::Product
A product from the Retailigence
API
Attributes¶ ↑
-
id
- The Product’s GUID -
externalproductid
- TheRetailer
provided product ID -
weight
- The item’s weight (if known) -
msrp
- Manufacturer suggested retail price -
msrp_currency
- Currency respective ofmsrp
-
name
- Name of the product -
description_short
- Short description of the product -
description_long
- Long description of the product -
barcode
- The barcode/UPC label value -
brand
- The brand/manufacturer of the product -
images
- Array ofImage
-
sku
- Product’s SKU number -
distance
- The product’sDistance
-
url
- URL to purchase or view more details about the product -
product_type
- String array of product types -
location
-Location
returned from the search results
Public Class Methods
Search products nearby the provided userlocation
Parameters¶ ↑
See the official Retailigence
documentation for a list of parameters.
Return¶ ↑
SearchResult
with results
being an array of Products
Example¶ ↑
search_results = Retailigence::Product.search( userlocation: '37.3323,-122.0312', requestorid: 'test', name: 'Xbox One' ) search_results.results # => [#<Retailigence::Product>, #<Retailigence::Product>]
# File lib/retailigence/product.rb, line 43 def self.search(params = {}) results = get('products', params) products = results['RetailigenceSearchResult']['results'].map do |result| product = result['SearchResult']['product'] product[:distance] = result['SearchResult']['distance'] product[:price] = result['SearchResult']['price'] product[:location] = result['SearchResult']['location'] Product.new(product) end SearchResult.new(products) end