prmr / Creco

Recommendation System for Consumer Products
Apache License 2.0
6 stars 2 forks source link

Getting products' price attribute #54

Closed forgues closed 10 years ago

forgues commented 10 years ago

I've been trying to retrieve the price attribute of products, but I'm not able to get it through the data API. I'm not sure if this is a bug or if it's because the data API is undergoing some changes.

I did the test with a category search of "toaster", and then listed all ratings and specs. Here's what I got:

Rating : One slice Rating : Color range Rating : Ease of cleaning Rating : Overall score Rating : Ease of use Rating : Full batch Rating : Successive batches Spec : Color Spec : Touchpad Spec : One slot Spec : Bagel setting Spec : Exterior material

I know the price attribute is in the json files. Here's the price for one of the toaster products:

"price":{"sortOrder":1,"attributeId":"31","dataPresentationFormat":"NON GRAFIC","filterWidget":"NUMERIC SLIDER","value":180.0,"displayName":"Price","description":"An approximate retail price.","isForDisplayOnCRO":false,"isCategoryCommonAttribute":false}

So how can I access the price attribute through our data API?

prmr commented 10 years ago

For a quick solution in your branch you can add a field in Product and set its value in JsonLoadingService.buildProduct(...) by simply copying whatever you need from pProductStub into Product.

However if time permits it would be best to coordinate this change with enew in issue #44.

enewe101 commented 10 years ago

Price implemented as any other Attribute. Use Product.isPriced() and Product.getPrice(). Merged into Integration branch.