Skip to content

Commit

Permalink
Merge pull request #4454 from internetarchive/consolidating-vendors
Browse files Browse the repository at this point in the history
consolidating vendors back to core group
  • Loading branch information
cdrini authored Jan 26, 2021
2 parents 10d1cda + e19e08f commit 492f402
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions openlibrary/macros/AffiliateLinks.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
amz_metadata = get_amazon_metadata(isbn, resources='prices')
amazon['price'] = amz_metadata and amz_metadata.get('price')

stores = [store for store in [bwb, amazon, bookshop] if store]
primary_stores = [store for store in [bwb, amazon] if store]
more_stores = [store for store in [bookshop] if store]

$def affiliate_link(key, analytics_key, name, link, price='', price_note=''):
<li class="prices-$key">
Expand All @@ -55,6 +56,12 @@
</li>

<ul class="buy-options-table">
$for store in stores:
$for store in primary_stores:
$:affiliate_link(store['key'], store['analytics_key'], store['name'], store['link'], store.get('price', ''), store.get('price_note', ''))
$if more_stores:
<details>
<summary>$_('More')</summary>
$for store in more_stores:
$:affiliate_link(store['key'], store['analytics_key'], store['name'], store['link'], store.get('price', ''), store.get('price_note', ''))
</details>
</ul>

0 comments on commit 492f402

Please sign in to comment.