Skip to content

Instantly share code, notes, and snippets.

@nmedia82
Created December 19, 2019 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmedia82/e2bcc4e9db4f8acc4cfb8bf29962bc19 to your computer and use it in GitHub Desktop.
Save nmedia82/e2bcc4e9db4f8acc4cfb8bf29962bc19 to your computer and use it in GitHub Desktop.
PPOM Price V2 - Extending price object example
// 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