Hi @nekengren,
Sorry you are having issues with the price.
Over the years, Amazon has added more data to the API. Where it used to be something simple to get the price from one field, it now depends on more variables – so where the price is located in the data that is returned, depends on a few things.
Most of the time, the new-price or price field will return the New Price for the item. But when there are a lot of offers available or when the item is fulfilled by Amazon or another party, things get a bit more complex. When this happens, they return the data in the Offers section.
To get around this, when you notice that a product will not return the ‘new-price’ field, you can use a more specific field to pull it most of the time.
This will sound and look a bit weird, but you can use the field called Offers_Offer_OfferListing_Price_FormattedPrice to get the price most of the time when new-price does not work. The reason it is so long is that it is a nested field (it is located in the Offers/Offer/OfferListing/Price/FormattedPrice tag in the Amazon XML data that is returned, so pulling it out of there requires the long field name). The short names (i.e., price, image, button, etc.) are actually just aliases for the common long nested fields. In the next update we will be adding some new short field names to accommodate some of the more common pricing issues that have come up over the past few years.
When you use that long field for the price, you may also need the label to go with it, so in your example you provided, you would use the shortcode that looks like this:
[amazon-elements asin="B01N5RIH4H" fields="title,lg-image,large-image-link,Offers_Offer_OfferListing_Price_FormattedPrice,button" labels="Offers_Offer_OfferListing_Price_FormattedPrice::Price:"]
(If you don’t need a label, you can just take that element out of the shortcode)
You may then want to also style the fields, so you can use this example as a start:
.amazon-element-Offers_Offer_OfferListing_Price_FormattedPrice {
font-weight: bold;
color: #f00;
font-size: 1.25em;
padding-bottom: 10px;
}
.label-Offers_Offer_OfferListing_Price_FormattedPrice {
text-transform:capitalize
}
Just remember that when using the amazon-elements shortcode that whatever the field name is, the classes that go with the fields are named amazon-element-{field_name} and labels are named label-{field_name}. Keeping that in mind will allow you to style just about any field you add.
Best of luck,
Don
-
This reply was modified 8 years, 7 months ago by
Don Fischer. Reason: spelling fix
-
This reply was modified 8 years, 7 months ago by
Don Fischer. Reason: Code fix