Display types and rendering
OAmazon ships 15 display types defined in OAM_Display::TYPES. Each renders one or more cached products from oam_products.
| Type key | Description |
|---|---|
card | Product Card (image + title + price + CTA) |
compact | Compact Card (slim variant) |
button | Mini Button (CTA only) |
comparison | Comparison Table (multi-product, side-by-side) |
ranked | Ranked List (1, 2, 3 with ranking badges) |
grid | Bestseller Grid (multi-product grid) |
feature | Feature Box (large image, prominent CTA) |
price_alert | Price Alert Strip (price + savings badge) |
image_box | Image Box (image-led card) |
shelf | Product Shelf (horizontal scroll) |
editorial | Editorial Grid (image + headline + body) |
deal | Deal Box (savings badge + CTA) |
quote | Quote Box (pull-quote layout) |
table | Affiliate Table (data-dense table) |
widget | Sidebar Widget (compact, sidebar-optimised) |
Styles
Every type supports 3 styles via OAM_Display::STYLES:
light(default)darkorravo(brand-tinted)
Saved displays
Saved displays live in oam_displays. Each row stores display_type, display_style, asins (comma-separated), and settings_json (per-type configuration).
php$id = OAM_Display::save_display([
'name' => 'Top Headphones 2026',
'display_type' => 'ranked',
'display_style' => 'dark',
'asins' => 'B08N5WRWNW,B09JQMJHX,B07YFGT5NP',
'settings' => [ 'show_ratings' => true, 'show_savings' => true ],
]);
echo OAM_Display::render( $id );Templates live in frontend/templates/<type>.php. Each template receives $products, $style, $settings, $link_id, $disp_id, $locale, $asins.
Helpers
phpOAM_Display::star_html( float $rating ); // 5-star unicode rendering
OAM_Display::availability_badge( string $avail ); // In Stock / Out of Stock pill
OAM_Display::savings_badge( float $amt ); // Save $X badge
OAM_Display::stale_notice(); // 'Price may vary' disclaimerPrice and availability data is cached for 24 hours. The stale-price notice is added automatically when the cache is over the freshness threshold.

