Created
December 19, 2019 06:23
-
-
Save nmedia82/e2bcc4e9db4f8acc4cfb8bf29962bc19 to your computer and use it in GitHub Desktop.
PPOM Price V2 - Extending price object example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PPOM Price V2 Related | |
class PPOM_OQ_Class extends PPOM_Price_Class{ | |
constructor(field, value){ | |
super(field, value) | |
} | |
get_price() { | |
let p = this.field.price || ''; | |
// if options found | |
if( p ){ | |
p = Number(this.value) * p; | |
} | |
// console.log('PRICE', p); | |
return p; | |
} | |
} | |
//Filter function | |
function ppom_get_price_quantityoption(price_obj, field_meta, value){ | |
const field_price = new PPOM_OQ_Class(field_meta, value); | |
return field_price; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment