Plugin Author
wpgear
(@wpgear)
Hello netmorais!
In the current version of the plugin, unfortunately there is no such possibility.
Well, because there was no such need
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.
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.
Plugin Author
wpgear
(@wpgear)
Hi Bro!
I tell you exactly that in my Plugin there is no JS Oject like: Product
But if you say why you need it, and what exactly you want to do, then I can think about it.
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.
Plugin Author
wpgear
(@wpgear)
Not so simple.
The parameters of the Quantity (Min/Max/STEP/Default) for each Product is a Hierarchical Structure.
Product -> Product Category -> Global Settings.
In fact, it is even more difficult:
Product Variation -> Product -> Product Category -> Global Settings.
The value for each of the parameters is determined by this chain until it is determined.
That is why I say that in this version of the Plugin there is no ready to use the parameters of Quantity for external use as Object (JS).
But now, when you explained why this is necessary, I will try to add such an opportunity in the next version.
OK thanks. I await the new version. Sergio.
Plugin Author
wpgear
(@wpgear)
try v10.30
Product JS Object: QNT_Data
Use Function: DPQW_Get_QuantityData (Product_ID)