mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 21:27:58 +08:00
FIX: Only display the first listed price (#16138)
Multiple prices may be returned by Amazon (e.g. for new, and also for used). We should only display the first price.
This commit is contained in:
@ -124,7 +124,7 @@ module Onebox
|
||||
elsif !raw.css("#priceblock_ourprice").inner_text.empty?
|
||||
raw.css("#priceblock_ourprice").inner_text
|
||||
else
|
||||
result = raw.css('#corePrice_feature_div .a-price .a-offscreen').inner_text
|
||||
result = raw.css('#corePrice_feature_div .a-price .a-offscreen').first&.inner_text
|
||||
if result.blank?
|
||||
result = raw.css(".mediaMatrixListItem.a-active .a-color-price").inner_text
|
||||
end
|
||||
|
Reference in New Issue
Block a user