WordPress Amazon插件:Amazon Product In a Post Product Shortcode

[amazonproducts] Shortcode

WordPress Amazon插件:Amazon Product In a Post Product Shortcode

Usage in the most basic form is simply the Shortcode and the ASIN written as follows (where the XXXXXXXXX is the Amazon ASIN):
[amazonproducts asin="XXXXXXXXXX"]

Please note that the following alias shortcodes where added for backward compatibility: AMAZONPRODUCTSAMAZONPRODUCTamazonproduct

There are additional parameters that can be added if you need them are listed below with a description of each:

  • asin — this is the ASIN or ASINs comma separated. This is the only required parameter.
  • desc — using 1 shows Amazon description (if available) and 0 hides it — default is 0.
  • features — using 1 shows Amazon Features (if available) and 0 hides it — default is 0.
  • show_list — using 1 shows the List Price and 0 hides it — default is 1.
  • show_used — using 1 shows the Used Price and 0 hides it — default is 1.
  • show_new — using 1 shows the New Price and 0 hides it — default is 1.
  • template — used mostly for Gutenberg Block Layout. Default is ‘default’. Others include lightlight-reversedlight-image-topdarkdark-reverseddark-image-top
  • gallery — using 1 shows extra photos/gallery — default is 0.
  • replace_title — Replace product with your own title. If using multiple ASINs, you can separate the titles for each, using ‘::’, for example: Title One::Title Two::My Title Three, etc.
  • title_charlen — using a number greater than 0 will trim the title to that number of characters. Anything above 150 will show full title. default is 0 (show full title).
  • hide_title — using 1 hides the title and 0 shows the title — default is 0 (title will be shown).
  • hide_image — using 1 hides the Large Product Image and 0 shows it — default is 0 (large image will be shown).
  • hide_lg_img_text — using 1 hides the “See larger Image” Link and 0 shows it — default is 0 (link will be shown).
  • hide_release_date — using 1 hides the Release Date for Games or Pre-orders and 0 shows it (only when present) — default is 0 (release date will be shown when available).
  • single_only — using 1 shows the product on a Single page/post only (not on archive or blogroll) and 0 shows it on single or list pages/posts — default is 0 (product will be shown on single or list pages).
  • image_count — this is the number of images to show for the Gallery. Only used when the gallery parameter flag is set to 1 — default is -1 (show all). Other options are 1 to 10 – anything over 10 shows all.
  • is_block — this is a special parameter to tell if this is a Block element or a shortcode element. Used internally only. — default is 0 (0 for shortcode or 1 for block).
  • use_carturl — using ‘true’ will use the Cart URL link and ‘false’ will use the product page link — default is ‘false’ (product page link).
  • button — this is for the new HTML Buttons. can be any valid registered HTML Button — default is blank. Available core pluign buttons can be seen here.
  • align — not used at this time.
  • className — this is for the Gutenberg additional className attribute. You could also use it to pass an additional class name to the product wrapper. Comma or space seperate multiple class names.
  • locale — this is the Amazon locale you want to get the product from, i.e., com, co.uk, fr, etc. default is your plugin setting.
  • partner_id — allows you to add a different parent ID if different for other locale — default is ID in settings.
  • private_key — allows you to add different private key for locale if different — default is private key in settings.
  • public_key — allows you to add a different private key for locale if different — default is public key in settings.
  • listprice — add for backward compatibily only – see this parameter for usage: show_list
  • list_price — add for backward compatibily only – see this parameter for usage: show_list
  • used_price — add for backward compatibily only – see this parameter for usage: show_used
  • usedprice — add for backward compatibily only – see this parameter for usage: show_used
  • new_price — add for backward compatibily only – see this parameter for usage: show_new

Examples of it’s usage:

  • If you want to add a .com item and you have the same partner id, public key, private key and want the features showing:
    [amazonproducts asin="B0084IG8TM" features="1"]
  • Show the Description, Features, New Price, Gallery with 4 images, and a Blue Buy from Amazon Button:
    [amazonproducts asin="B0084IG8TM" features="1" desc="1" gallery="1" image_count="4" show_used="0" show_list="0" button="buy-from-blue-rounded"]
  • If you want to add a .com item and you have a different partner id, public key, private key and want the description showing but features not showing:
    [amazonproducts asin="B0084IG8TM,B005LAIHPE" locale="com" public_key="AKIAJDRNJ6O997HKGXW" private_key="Nzg499eVysc5yjcZwrIV3bhDti/OGyRHEYOWO005" partner_id="mynewid-20"]
  • If you just want to use your same locale but want 2 items with no list price and features showing:
    [amazonproducts asin="B0084IG8TM,B005LAIHPE" features="1" listprice="0"]
  • If you just want 2 products with regular settings:
    [amazonproducts asin="B0084IG8TM,B005LAIHPE"]
  • If you want to add text to a product:
    [amazonproducts asin="B0084IG8TM"]your text can go here![/amazonproducts]