1. Home
  2. Knowledge Base
  3. Functions
  4. How-to display the currentness of product data
  1. Home
  2. Knowledge Base
  3. Extending & Styling
  4. How-to display the currentness of product data

How-to display the currentness of product data

The plugin allows you to easily display the currentness of product data. Additionally you can choose between multiple formats.

What’s the meaning of “last update”?

This stands for the date/time the plugin fetched/renewed a product (via Amazon’s API) at last.

How can I display the last update info?

In general there are multiple ways to display the last update info.

Inline info

Note: This is an exemplary screenshot. No real-time data. Live demonstration can be found here.

This is a little area inside a template which can be used to display custom text.

The inline info does not show up in every template. If you want to make sure that the last update date/time shows up, make use of the disclaimer instead.

The content can be controlled via plugin settings (tab “general”). Simply use the placeholder %last_update% inside the textarea and the date/time will be displayed.


Disclaimer

Note: This is an exemplary screenshot. No real-time data. Live demonstration can be found here.

By using the disclaimer you can display custom text below each box/list or once at the bottom of a post/page.

The content can be controlled via plugin settings (tab “general”). Simply use the placeholder %last_update% inside the textarea and the date/time will be displayed.

Tip: By using the following shortcode, you can place the disclaimer wherever you want:

[amazon_disclaimer /]
Please keep in mind that each product has an unique last update date/time. Using this shortcode simply returns the date/time of the last API call the plugin made.

Shortcodes

Additionally you can display the last update date/time by using one of the following shortcodes:

Global
This stands for date/time the plugin fetched/renewed products the last time.

[amazon_last_update /]
Please keep in mind that each product has an unique last update date/time. Using this shortcode simply returns the date/time of the last API call the plugin made.

Product specific
By using the following shortcode you can display the exact date/time of the last update for a single product:

[amazon fields="ASIN" value="last_update" /]

How-to adjust the format of the last update info

On the plugin settings page (tab “general”) you can choose whether you want to show the date + time, or only the date.

The format itself comes from your WordPress’ date/time settings which can be found under: Settings > General.

If you want to use a custom format, this can be done by using the following filter:


add_filter( 'aawp_func_last_update_format', function( $format_overwrite ) {
return 'j. F Y - G:i';
});

In case you don’t know what to do with the code above, take a look at the following article: How-to use custom PHP code snippets.

Was this article helpful?

Related Articles

WordPress Cookie Notice by Real Cookie Banner