To retrieve a reco products
Without Reco Builder
- Call the following methods
javascriptrecos.reco(RECO_ID).then(console.log)
You will get a json response with all products to display
json[ { "id": "id1", "title": "title 1", "price": 20, "stroke_price": 40, "discount_rate": 50, "img_link": "https://image.png", "link": "https://link1", ... }, { "id": "id2", "title": "title 2", "price": 30, "stroke_price": null, "discount_rate": 0, "img_link": "https://image.png", "link": "https://link2", ... }, ... ]
With Reco Builder
- Call the following methods
javascriptrecos.reco(RECO_ID, {"fields": [FIELDS_NAME]}).then(console.log)
You will get a json response with the indicated FIELDS_NAME for all products to display
json[ { "id": "id1", "title": "title 1", "price": 20, "stroke_price": 40, "discount_rate": 50, "img_link": "https://image.png", "link": "https://link1", ... }, { "id": "id2", "title": "title 2", "price": 30, "stroke_price": null, "discount_rate": 0, "img_link": "https://image.png", "link": "https://link2", ... }, ... ]
- You can also access the value of a variable by calling
javascriptrecos.variable(VARIABLE_NAME).then(console.log)