| 开发者 | pixel4you |
|---|---|
| 更新时间 | 2026年9月15日 03:05 |
| PHP版本: | 7.2 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[affiliate_box box="a7f3k2c9"]. The box shows the product image, title, price, star rating and a clearly labelled affiliate link.
Because the product lives in one place rather than in the post text, the same box can appear in twenty posts and still be changed once. That is also what makes it possible to keep the price honest: a price written into a post is a price nobody ever revisits.
Connect your Amazon Creators API credential and the plugin fills the box for you: paste an ASIN, press Fetch from Amazon, and title, image, price and rating arrive from Amazon. Without a credential everything still works — you type the values yourself.
The plugin is built for Amazon Associates. You enter a separate Associates Tracking ID for each marketplace you are enrolled in, point a box at any store with the marketplace attribute, and the right ID is appended to every outbound link — falling back to the marketplace you nominate whenever a target store has none of its own.
What you get
[affiliate_box] shortcode still works everywhere it always did: the classic editor, Elementor, and the shortcode or text widget of every common page builder.rel="nofollow noopener sponsored".prefers-reduced-motion, keyboard focus visible throughout.doozly-affiliate-box-for-amazon).asin (or url) plus title and image. Anything left empty falls back to the value set under Settings → Affiliate Box.
In almost every case you want the short form: [affiliate_box box="a7f3k2c9"] shows a box you built on the Product Boxes screen, and the Shortcode column there hands you the finished line. The attributes below let a post carry the product data itself instead; they are still read, so older posts keep working, but nothing needs writing by hand any more.
With box set, the product details always come from the saved box. Only layout, image_size, bg_color and button_text can be overridden per post — otherwise the price in a post would go stale again, which is the problem the saved box solves.
| Attribute | Values | Default | Description |
| --- | --- | --- | --- |
| box | Key of a saved box, e.g. a7f3k2c9 | (empty) | Shows a box built on the Product Boxes screen. With this set, every product detail comes from the saved box and only layout, image_size, bg_color and button_text are read from the shortcode. The Shortcode column on that screen hands you the finished line. |
| asin | Amazon ASIN, e.g. B08N5WRWNW | (empty) | Product ID. The link is built as https://<marketplace>/dp/<asin>?tag=<your-id>. |
| url | Full Amazon URL | (empty) | Use instead of asin for search pages or non-standard links. Your Tracking ID is appended unless the URL already carries one. |
| title | Plain text | (empty) | Product title, also used as the image alt. |
| image | Image URL | (empty) | Product image. Use your own copy or a permitted Amazon image URL. |
| price | Plain text, e.g. $19.99 | (empty) | Displayed price. Type it, or let the Amazon API fill it. |
| original_price | Plain text | (empty) | Crossed-out former price. Shown only together with savings_pct. |
| savings_pct | Number, e.g. 25 | (empty) | Discount badge, in percent. |
| rating | 0–5, e.g. 4.5 | (empty) | Star rating above the price. Empty means no stars. |
| rating_count | Number | (empty) | Review count shown next to the stars. |
| brand | Plain text | (empty) | Brand line above the title. |
| button_text | Plain text | Settings value, or "Buy on Amazon" | Text on the call-to-action button. |
| layout | post, sidebar, compact, hero | Settings default | post 640px horizontal. sidebar 400px, stacked and centred. compact a single 640 × 78px line. hero 960px with a bigger picture. |
| eyebrow | plain text | (empty) | A short line in small capitals above the product name — Our pick. Shares a line with the brand when both are filled in; compact leaves it out. |
| image_size | small, medium, large | medium | 90px / 140px / 200px on desktop; scales down on mobile. |
| bg_color | Hex colour, e.g. #f7f7f7 | Settings value | Box background, this box only. |
| marketplace | Marketplace key, e.g. de | Settings default | Which Amazon store the link points to. |
| asin_de, image_de, title_de, price_de, … | Per store | (empty) | Store-specific values. The one matching the box's marketplace wins over the plain attribute. |
Examples
In-post box:
[affiliate_box asin="B08N5WRWNW" title="Echo Dot (4th Gen)" image="https://example.com/echo-dot.jpg" price="$29.99" rating="4.5" rating_count="1204"]
Sidebar widget:
[affiliate_box asin="B08N5WRWNW" title="Echo Dot (4th Gen)" image="https://example.com/echo-dot.jpg" price="$29.99" layout="sidebar"]
A saved box, price kept in one place — the usual way:
[affiliate_box box="a7f3k2c9"]
German store, large image, discount badge:
[affiliate_box asin="B08N5WRWNW" title="Echo Dot (4. Generation)" image="https://example.com/echo-dot.jpg" price="29,99 €" original_price="39,99 €" savings_pct="25" marketplace="de" image_size="large"]
A search result page instead of a product:
[affiliate_box url="https://www.amazon.com/s?k=smart+speaker" title="Smart speakers" image="https://example.com/speakers.jpg" button_text="Browse on Amazon"]
Premium version
A Premium version is available at doozly.link. It adds bestseller lists, comparison tables, review boxes carrying your own photo and score, IP-based geotargeting — every affiliate link rewritten to the Amazon store closest to the visitor — rotation, which shows a different one of your saved boxes at the same spot each day, reports on how often each box was seen and clicked, and a nightly refresh that keeps saved prices current. This free plugin is complete on its own and never asks for a licence key. Each of these features has a tab in it as a preview, saying what the feature does — nothing in the free plugin is locked, because the code for them is not part of it.
Product images
The plugin stores an image address and renders it. It cannot tell where that address came from, and it does not try to.
Pressing Fetch from Amazon or picking a search result fills the field from the Amazon Creators API, which is the path Amazon's Associates Operating Agreement intends for product images. You can also type an address yourself — the field accepts any URL, because a product box is often built before a credential exists, or from your own photography.
Which images you are entitled to display is between you and Amazon. The Associates Operating Agreement limits it, that agreement is between Amazon and you as the account holder, and the plugin is not a party to it. Anything you enter is published on your site under your responsibility.
Disclaimer
Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates. This plugin is an independent product and is not affiliated with, endorsed by, or sponsored by Amazon.
doozly-affiliate-box-for-amazon folder to /wp-content/plugins/, or install through the WordPress Plugins screen.No. Without one you type the title, image and price yourself and the plugin builds the link from the ASIN and your Tracking ID. A credential only saves you the typing.
In Amazon Associates Central under Tools → Creators API. Amazon issues one credential per region — North America, Europe, Far East — and a credential does not work outside its own region, so enter one for each region you sell in. The old Product Advertising API keys no longer work; Amazon shut that API down.
Because Amazon does not send them. The API accepts a request for customerReviews.starRating and customerReviews.count and then answers without them — the block is absent from the response altogether. It is a long-standing gap that affects every plugin working through this API; it is not your credential, and not this plugin.
So those two fields are yours to fill: type the rating and the number of reviews from the product page. They are the one part of a box that does not keep itself current, so it is worth checking them now and then.
The plugin keeps asking for both on every request. It costs nothing extra, and if Amazon ever starts answering, they fill themselves from that day on. To see what your own account gets back, press Fetch from Amazon and read Last raw API response at the foot of the Amazon API tab.
No. Each box points at whichever store you choose with the marketplace attribute, with the matching Tracking ID appended. Automatic routing by visitor country is part of the Pro version.
The link falls back to the Tracking ID of your fallback marketplace, so you never lose a commission just because you have not enrolled in a regional programme.
Yes. The Associates programme runs separately in each country, each with its own Operating Agreement and its own Tracking ID — enter each one under Marketplaces and the plugin picks the right one per box. The settings page warns you when an ID does not look like it belongs to the store it is filed under.
On a modern theme the widget areas are block areas: add the Affiliate Box block and pick your box.
On a site running Classic Widgets, use the Affiliate Box widget under Appearance → Widgets. It defaults to the narrow Sidebar layout, and a widget with nothing chosen draws nothing at all — not even its heading.
A shortcode in a Text widget still works too: [affiliate_box box="a7f3k2c9" layout="sidebar"]. The Sidebar layout is vertical, centred, and fills the column up to 400px.
WP_DEBUG on a row of "Undefined array key" warnings appeared in the middle of the post. Found on a clean install while testing this release.Tested up to from the plugin header, where it is not a valid field.