Skip to content
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.

Fix #154: Parse Open Graph price string to a number #155

Merged
merged 1 commit into from
Oct 11, 2018

Conversation

biancadanforth
Copy link
Collaborator

@biancadanforth biancadanforth commented Oct 9, 2018

This is a bit of a moot point for the MVP, since #70 restricts extraction to our five supported sites, none of which make use of Open Graph meta tags, however, that may change, and the fix was quick.

Note: To test this, comment out the other extraction methods in './src/extraction/index.js' and the allowlist check in that file's 'main' function, then visit a Crate and Barrel product page.

@biancadanforth biancadanforth requested a review from Osmose October 9, 2018 20:15
@biancadanforth
Copy link
Collaborator Author

@Osmose Ready for your review!

Copy link
Contributor

@Osmose Osmose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work!

Make sure to update the commit message before landing this after rebasing it.

Since the propTypes check for 'extractedProduct' object expects a number data type for the 'price' key's value, this patch parses the price string extracted via Open Graph into a number using the same 'parsePrice' function used by the other two extraction methods (Fathom and CSS Selectors).
@biancadanforth biancadanforth merged commit d90a16b into master Oct 11, 2018
@biancadanforth biancadanforth deleted the 134-og-price branch October 11, 2018 17:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants