commercetools / sphere-play-sdk

Java API client and helper classes for building a SPHERE.IO shop on Play 2.2
http://sphere.io
7 stars 6 forks source link

Discounted price is absent #123

Closed salander closed 10 years ago

salander commented 10 years ago

Please check soon: API returns discounted price for a product correctly, but on price creation https://github.com/commercetools/sphere-play-sdk/blob/master/java-client/src/main/java/io/sphere/client/shop/model/Price.java#L36 the Optional.fromNullable(discounted) creates absent value. so i never get the discounted price when calling variant.getPrice().getDiscounted() for a discounted product.

schleichardt commented 10 years ago

I cannot reproduce the problem, the CI builds with the tests for the discounts are green.

Please consult https://github.com/commercetools/sphere-play-sdk/blob/master/CONTRIBUTING.md to clarify the problem.

salander commented 10 years ago

i'm using java7, sdk 0.67.0, play 2.2.4 i refreshed product search, cleaned project, use newest sdk, restarted sbt and drunk a lot of coffee but it doesn't work. @lauraluiz was suggesting, that the data may be corrupt - can that be?

schleichardt commented 10 years ago

But I still can't reproduce:

salander commented 10 years ago

json traffic on loading one (discounted) product:

JSON removed

butenkor commented 10 years ago

"hasStagedChanges" : true @salander Did you try republishing of product again? Do you load product on PDP or POP? If POP you should use filter by isOnStock = true too.

schleichardt commented 10 years ago

Thanks, I will try to investigate with the JSON.

salander commented 10 years ago

@butenkor yes, i've republished product. the json i've provided is traced on pdp

salander commented 10 years ago

@schleichardt stop investigating i got the problem: the defined discount was using a product which was out of stock. thanks @butenkor for that hint. thanks @schleichardt for investigating.

schleichardt commented 10 years ago

Cool!