How to access to Feed Property in Non-Recommendations Templates?

Comments

1 comment

  • Official comment
    Gidi Vigo

    Hi Malte,

    If you’d like to pull information about a product from the product feed, you can use the following example:

    DY.API('callback', function() {
    	DY.ServerUtil.getProductsData(DY.recommendationContext.data, "", "", true, function(e, data) { 
        var productInfo = data[DY.recommendationContext.data[0]].productData;
    
        document.querySelector('CSS Selector').textContent = productData.name;
      });
    });
    

    This snippet is utilizing the getProductsData 3 API, which allows you to fetch products’ social proof information and feed properties.

    if you want to access feed properties of the current context’s page they’re easily accessible in DY.feedProperties:

    Comment actions Permalink

Please sign in to leave a comment.