PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Is it possible to reload/redraw specific product data after field modification?

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello,

I am using"woobe_after_update_page_field" hook to connect some product-related variables.

A simple example:

add_action( 'woobe_after_update_page_field', 'stock_2_times', 3, 5 );
function stock_2_times($product_id, $product, $field_key, $value, $field_type) {
if ( $field_key != 'custom_stock' ) return;
$product->set_stock_quantity( $value * 2 );
if ( !empty( $product->get_changes() ) ) {
$product->save();
}
}

I use $product->save() in this hook, so in this case the"stock_quantity" and"stock_status" would change due to a meta field input change. These changes are not visible in BEAR until reloading product data.

Is there a script that I can use in this hook to tell BEAR to forcefully redraw some, or all product data which's data was edited?

Thank you

Hello

You can use this hook woobe_before_update_product_field  for custom change of field data

Then the plugin will return the current data of the changed field for redrawing in the table. But only the field that you changed in the table (front-end) will be redrawn.

In another case, redrawing fields is possible only in JS code:  woobe_redraw_table_row(jQuery('#ID_selector_of_row'));

Understood, thank you, then I will try the JS code.

Regards

Hello

Great! Welcome;)