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.
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
Plugin for showing single product on a page
Woocommerce Add custom “Add to cart button” in single page with tags
WooCommerce database upgrade behaviour
You could get the queried object, but that still leaves the unmentioned problem that you’re discarding the main query and doing a second one, making the page at a minimum 2x slower. Pagination is also broken by this. You may have seen people warn you against using query_posts, this is why, using WP_Query the same … Read more
How to add product variations for large number of products in WooCommerce?