Improved detection if a price given on the page specially when multiple in dom

This commit is contained in:
Daniel Hüsken 2025-03-07 14:20:57 +01:00
parent 1c608ac0c2
commit 95aefb9922
No known key found for this signature in database
GPG key ID: 9F732DA37FA709E8

View file

@ -162,6 +162,12 @@ class SingleProductBootstap {
},
]
.map( ( f ) => f() )
.sort((a, b) => {
if (parseInt(a.replace(/\D/g, '')) < parseInt(b.replace(/\D/g, '')) ) {
return 1;
}
return -1;
})
.find( ( val ) => val );
if ( typeof priceText === 'undefined' ) {