netmorais
Forum Replies Created
-
OK thanks. I await the new version. Sergio.Hello. I’m configuring a POS plugin, specifically “WePos for Woocommerce” and trying to integrate it with “Decimal Product Quantity for WooCommerce”, “DpQt”. To do that I need to have access to the “Meta Data” of “DpQt” to transfer them to “WePos”. I asked this forum how to do this programmatically and they replied that in this version there was no possibility. Despite this, I continued researching and found a solution, not at all elegant, but it was working, so I decided to just make a “Suggestion” to the forum. Grateful. Sergio.
Guys, I’m going to repeat my suggestion on how to programmatically get product properties, such as default quantity:
I’m “testing” the following Javascript function and I’m getting good results. Suppose the Object of a certain product named “product” already exists:
function get_woo_dec_pro_ite_qnt() {
var woo_dec_pro_ite_qnt = “”; for (var i in product.meta_data) {
if (product.meta_data[i][‘key’] == ‘wooddecimalproduct_item_qnt’)
{ woo_dec_pro_ite_qnt = product.meta_data[i][‘value’]; }}
return woo_dec_pro_ite_qnt; }if (get_woo_dec_pro_ite_qnt() == “”) { console.log (“not found”); }
else{ console.log(get_woo_dec_pro_ite_qnt()); }The suggested function uses: wooddecimalproduct_item_qnt which is a plugin metadata: “Decimal Product Quantity for WooCommerce”
Grateful. Sergio.
Dear. I’m “testing” the following Javascript function and I’m getting good results. Suppose the Object of a certain product named “product” already exists:
function get_woo_dec_pro_ite_qnt () {
var woo_dec_pro_ite_qnt = “”; for (var i in product.meta_data) {
if (product.meta_data[i][‘key’] == ‘woodecimalproduct_item_qnt’)
{ woo_dec_pro_ite_qnt = product.meta_data[i][‘value’]; }}
return woo_dec_pro_ite_qnt; }
if (get_woo_dec_pro_ite_qnt () == “”) { console.log (“not found”); }
else{ console.log (get_woo_dec_pro_ite_qnt ()); }Grateful. Sergio.