Maybe I am going crazy here, but I thought the Amazon price of an item was displaying in the info with the Amazon cck field.
Now I don't see the price, not in the basic info or full info display.
I went to create a view using Amazon items, and I am able to select list price, but not the actual Amazon price, so there is no way of showing how much the items actually cost.
Am I missing something?
I added some Amazon widgets in blocks in sidebars recently, but that doesn't seem like it should've affected anything.
Any suggestions?

Comments

lvthunder’s picture

I would like the same thing. I don't really care about the list price. Just what amazon is charging for the item.

zoidberg’s picture

Actually, I don't know, why he took the listprice, but the fix is quite simple.

In line 330/331 in amazon.module change the lines with "...ListPrice..." to

$item['listpriceamount'] = (string)$xml->OfferSummary->LowestNewPrice->Amount;
$item['listpricecurrencycode'] = (string)$xml->OfferSummary->LowestNewPrice->CurrencyCode;
$item['listpriceformattedprice'] = (string)$xml->OfferSummary->LowestNewPrice->FormattedPrice;

Hope, that helps.

André

911’s picture

Will the price be grabed once on Node create date or is it possible to keep the price up to date? So it is cached, but updatet after time when someone reads the node. Any Idea?

I would like to have the price stay update.

rfay’s picture

Status: Active » Fixed

If this is still an open issue, please open it back up and change the title and explain what you'd like. I wasn't able to figure it out exactly. Thanks,
-Randy

tomcatuk’s picture

Hi Randy - I'm interested in this one, and think I'm after the same answer. Once I've got a cached value for LowestNewPrice does it get re-checked when cron runs?

tomcatuk’s picture

Hi Andre - I've tried this and no result - I get no value at all (using a valid ASIN of course and all the other data comes through). I'm thinking I must be missing something obvious, but can't think what it is. I do notice you metioned modifying two lines (330 & 331) but then your example shows three (which makes more sense!). Also, would I not have to modify the code for the cron job to keep looking up the correct value?

rfay’s picture

@tomcatuk: I believe that on cron run you should get an updated LIST price.
@trevorvos: It is possible to add specific support for the current offer price, which is a different field. I think it would be best to offer it through the views interface.

Again, if this is still an open issue, or you want to turn it into a feature request, please do so.

-Randy

tomcatuk’s picture

Hi Randy - I thought a bit more about this, and here's what I've done to amazon.module:

replace:

if (!empty($xml->ItemAttributes->ListPrice)) {
$item['listpriceamount'] = (string)$xml->ItemAttributes->ListPrice->Amount;
$item['listpricecurrencycode'] = (string)$xml->ItemAttributes->ListPrice->CurrencyCode;
$item['listpriceformattedprice'] = (string)$xml->ItemAttributes->ListPrice->FormattedPrice;
}

with:

if (!empty($xml->OfferSummary->LowestNewPrice)) {
$item['listpriceamount'] = (string)$xml->OfferSummary->LowestNewPrice->Amount;
$item['listpricecurrencycode'] = (string)$xml->OfferSummary->LowestNewPrice->CurrencyCode;
$item['listpriceformattedprice'] = (string)$xml->OfferSummary->LowestNewPrice->FormattedPrice;
}

and in the cron section made these two modifications:

$tokens['amazon_item']['listprice'] = t("The product's list price");

to:

$tokens['amazon_item']['lowestnewprice'] = t("The product's sell price");

and

$values['listprice'] = check_plain($item['listpriceformattedprice']);

to:

$values['lowestnewprice'] = check_plain($item['lowestnewpriceformattedprice']);

Put simply, I reasoned that what zoidberg had posted above looked correct, it was just that in the Amazon product XML tree his code was still looking in "ItemAttributes" for the price, but the sell price isn't in there (so I got no result). It's actually in "OfferSummary". I'll have to try it with an item that changes it's price to see if I've got the cron part right.

tomcatuk’s picture

Just a quick note to say what I did seems to have worked after the cron run - price is now updating with the "lowestnewprice" (the actual lowest selling price on Amazon for the item).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.