Skip Menu |

This queue is for tickets about the Net-Amazon CPAN distribution.

Report information
The Basics
Id: 35242
Status: resolved
Priority: 0/
Queue: Net-Amazon

People
Owner: boumenot [...] gmail.com
Requestors: MSCHILLI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.48
Fixed in: (no value)



Hi Christopher, thanks for driving Net::Amazon. I just heard from someone in Germany that if you use the German locale as in use Net::Amazon; my $ua = Net::Amazon->new( token => 'XXXXXX', locale => 'de', ); my $response = $ua->search(asin => 'B000PCWZVU'); if($response->is_success()) { print $response->as_string(), "\n"; } then Net::Amazon can't find the price on item B000PCWZVU. The reason is a slightly different XML in the .de domain which looks like 'OfferSummary' => { 'TotalRefurbished' => '0', 'TotalUsed' => '0', 'TotalCollectible' => '0', 'TotalNew' => '39', 'LowestNewPrice' => { 'Amount' => '53492', 'CurrencyCode' => 'EUR', 'FormattedPrice' => 'EUR 534,92' } Do you know why the Germans are using a different layout? Would be great if you could look into it if you have some time, thanks! :) Keep up the good work! -- Mike
Subject: Fixed with Net-Amazon 0.49
I thought this issue was locale specific, but it isn't. I was able to reproduce this behavior against amazon.com. The issue appears to be that as_string() only uses OurPrice() when formatting the string. A better solution is to try all of the possible prices, but prefer OurPrice() when available. The actual order is now OurPrice(), ThirdPartyNewPrice(), and finally ThirdPartyUsedPrice(). If none of those method return a valid price, the user is notified with a price of unknown.