WordPress post_content gets deleted in cron after wp_update_post
WooCommerce stock quantity update by using wc_update_product_stock( $postId, $quantity ) used to remove post_content, so I put quantity update before the post_content update.
I’m assuming that with ‘neutralize’ you mean de-register or remove, such that WC doesn’t see (or recognize) the file and functions as it would have without the woocommerce.php-file being there. This answer proposes a code in which your child theme (by code) physically deletes the parent theme file. There’s also a questions here that seems … Read more
if you are using subscriptions plugin, then all the actions are listed here : https://docs.woocommerce.com/document/subscriptions/develop/action-reference/ i think it woocommerce_subscription_renewal_payment_complete that you are looking for.
The “official” answer is that you need to use do_shortcode() to process the shortcode as you can’t just simply apply a shortcode within the code. Here’s your original code with the “official” do_shortcode() way: add_filter( ‘woocommerce_checkout_fields’, ‘set_checkout_field_input_value_default’ ); function set_checkout_field_input_value_default($fields) { $fields[‘billing’][‘billing_city’][‘default’] = do_shortcode( ‘[geoip_detect2 property=”city”]’ ); $fields[‘billing’][‘billing_state’][‘default’] = do_shortcode( ‘[geoip_detect2 property=”mostSpecificSubdivision”]’ ); return $fields; … Read more
You can find out what actions are assigned to given hook with this code: function print_filters_for( $hook = ” ) { global $wp_filter; if( empty( $hook ) || ! array_key_exists( $hook, $wp_filter ) ) { return; } print ‘<pre>’; print_r( $wp_filter[$hook] ); print ‘</pre>’; } Call it where you need it. In your case: <form> … Read more
WooCommerce stock quantity update by using wc_update_product_stock( $postId, $quantity ) used to remove post_content, so I put quantity update before the post_content update.
Use jQuery(‘body’).trigger(‘update_checkout’); on your javascript e.g on ajax success/response it will update checkout page with ajax. $.ajax({ type: ‘POST’, dataType: ‘json’, url: wc_checkout_params.ajax_url, data: { action: “product_remove”, product_id: product_id, cart_item_key: cart_item_key }, success: function(response) { if ( ! response || response.error ) return; var fragments = response.fragments; // Replace fragments if ( fragments ) { … Read more
If you’re using a WooTheme then this code may have been utilized in the theme. It will already be pluggable which means you’ll need to redefine the function in your functions.php file (preferably in a child theme) to overwrite the theme default. /Override theme default specification for product # per row/ function loop_columns() { return … Read more
WooCommerce: how to set stock per attribute on variable product
WooCommerce database upgrade behaviour
How to add product variations for large number of products in WooCommerce?