Skip to the content

PHP functions for themes and plugins

Read a product, get its tracked link, or draw a product box, table or list from your own code.

These are available once the plugin has loaded. Each product function accepts a product id or an ASIN. The full reference, with every field, is in the developer guide that ships with the plugin (doc/DEVELOPERS.md).

  • selldigits_get_product( $product ) returns the product's public data (id, ASIN, title, brand, features, picture, price and list price, currency, discount, availability, marketplace, categories and tags, last update, sales rank, category, extra pictures, your rating and Amazon's deal, and your own badge, rating label, verdict, key points, brand, rank and review date), or null. Prices here are the stored ones: if you print them yourself, check the last-updated time against Amazon's price-age rule.
  • selldigits_get_product_url( $product ) returns the affiliate link a visitor would get right now, with geotargeting and the selldigits_product_link filter applied.
  • selldigits_render_product( $product, $args ), selldigits_render_table( $id ) and selldigits_render_list( $id ) return the same HTML as the block or shortcode.

Type a word, such as "price", "disclosure" or "shortcode".