diff --git a/src/fathom_coefficients.json b/src/fathom_coefficients.json
index 46f28f0..83b8f89 100644
--- a/src/fathom_coefficients.json
+++ b/src/fathom_coefficients.json
@@ -1,3 +1,3 @@
{
- "hasDivWithPriceClass": 2
+ "hasPriceClass": 2
}
diff --git a/src/fathom_extraction.js b/src/fathom_extraction.js
index ba4846e..6efad7f 100644
--- a/src/fathom_extraction.js
+++ b/src/fathom_extraction.js
@@ -13,16 +13,14 @@
import {dom, out, rule, ruleset, score, type} from 'fathom-web';
import fathomCoeffs from 'commerce/fathom_coefficients.json';
-const SCORE_THRESHOLD = fathomCoeffs.hasDivWithPriceClass;
+const SCORE_THRESHOLD = fathomCoeffs.hasPriceClass;
/**
- * Checks to see if an element is a
with a class of "price".
- * Returns an integer corresponding to the coefficient to use for
- * scoring an element with this rule.
+ * Scores fnodes with a "price" class
*/
-function hasDivWithPriceClass(fnode) {
+function hasPriceClass(fnode) {
if (fnode.element.classList.contains('price')) {
- return fathomCoeffs.hasDivWithPriceClass;
+ return fathomCoeffs.hasPriceClass;
}
return 1;
}
@@ -35,7 +33,7 @@ const rules = ruleset(
rule(dom('div'), type('priceish')),
// check class names to see if they contain 'price'
- rule(type('priceish'), score(hasDivWithPriceClass)),
+ rule(type('priceish'), score(hasPriceClass)),
// return price element with max score
rule(type('priceish').max(), out('product-price')),