1. AAWP
  2. Documentation
  3. Functions
  4. Fields (Single product data)

The so called Fields allow you to display single product data e.g. title, description or price via shortcode or inside your PHP templates.

What do I need?


Shortcode

Default usage

[amazon fields="3424201200" value="title"]

The shortcodes above can be extended by adding further "attributes". We prepared an overview of all shortcodes and adjustments for the Amazon Affiliate WordPress plugin.

Passing more attributes

[amazon fields="3424201200" value="button_detail" button_detail="/test/product-name/"]


Using PHP functions inside templates

Display value

echo aawp_get_field_value('3424201200', 'price');

Store value in a variable

$value = aawp_get_field_value('3424201200', 'price');

Passing more attributes

$value = aawp_get_field_value('3424201200', 'price', array( 'button_detail' => '/test/product-name/' );

Overview of all available values

IDs

Parameter Description
asin ASIN of the product
ean EAN of the product (only if available)
isbn ISBN of the product (only if available)

Content

Parameter Description
title Title of the product
url URL to the product detail page
link Link to the product detail page (HTML)
image URL to the product image
image_count Amount of available product images
thumb Thumbnail (HTML, incl. link) of the product
description Product description (HTML, unordered list)

Star-/Ratings

Parameter Description
rating Rating as a number (e.g. 1.5, 3 or 5.2)
star_rating Star-rating (HTML)
reviews Amount of collected reviews

Pricing

Parameter Description
price Advertised price (formatted incl. currency)
list_price List price (formatted incl. currency)
amount_saved Current savings (formatted incl. currency)
percentage_saved Current savings in percentage (only the number)

Other

Parameter Description
button Buy button (HTML, incl. link)
button_detail Detail button (HTML, incl. link)
prime Amazon Prime logo (only if prime is available)
premium Amazon Prime logo (only if prime is available)
last_update Date of last product update

Was this article helpful?

Related Articles