Title: yonish3's Replies | WordPress.org

---

# yonish3

  [  ](https://wordpress.org/support/users/yonish3/)

 *   [Profile](https://wordpress.org/support/users/yonish3/)
 *   [Topics Started](https://wordpress.org/support/users/yonish3/topics/)
 *   [Replies Created](https://wordpress.org/support/users/yonish3/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/yonish3/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/yonish3/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/yonish3/engagements/)
 *   [Favorites](https://wordpress.org/support/users/yonish3/favorites/)

 Search replies:

## Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Bulk import with unknown data structure](https://wordpress.org/support/topic/bulk-import-with-unknown-data-structure/)
 *  Thread Starter [yonish3](https://wordpress.org/support/users/yonish3/)
 * (@yonish3)
 * [2 years ago](https://wordpress.org/support/topic/bulk-import-with-unknown-data-structure/#post-17730209)
 * parsing the data should be a challenge. So you suggest maybe usu SQL directly
   to the DB?
 * Any ideas about the sql code?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Why does add_action execute only after the second product update attempt?](https://wordpress.org/support/topic/why-does-add_action-execute-only-after-the-second-product-update-attempt/)
 *  Thread Starter [yonish3](https://wordpress.org/support/users/yonish3/)
 * (@yonish3)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/why-does-add_action-execute-only-after-the-second-product-update-attempt/#post-16148005)
 * Don’t add arguments to the function declaration.
    Use $product_id, which is part
   of the way WP works, to find the value you need.
 * Maybe something like this:
    `$varible = get_field( 'field_name', $product_id );`
 * Or
 *     ```
       $product_id = get_the_ID();
       $varible = get_post_meta( $product_id, 'field_name', true );
       ```
   
 * Or
 *     ```
       global $product;
       $varible = get_field( 'field_name', $product->get_id() );
       ```
   
 * Or
 *     ```
       global $product;
       $varible_2 = $product->get_attribute( 'attribute_name' );
       ```
   
 * It depends on wich file you add the code to.
 * I hope one of these will solve your issue.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Why does add_action execute only after the second product update attempt?](https://wordpress.org/support/topic/why-does-add_action-execute-only-after-the-second-product-update-attempt/)
 *  Thread Starter [yonish3](https://wordpress.org/support/users/yonish3/)
 * (@yonish3)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/why-does-add_action-execute-only-after-the-second-product-update-attempt/#post-16146658)
 * Yes, this is what solved it for me.
    I’m not a PHP WP developer, so it was a 
   lot to search until I found something that worked for me.
 * I hope it will help you as well, but I can say that for sure.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Why does add_action execute only after the second product update attempt?](https://wordpress.org/support/topic/why-does-add_action-execute-only-after-the-second-product-update-attempt/)
 *  Thread Starter [yonish3](https://wordpress.org/support/users/yonish3/)
 * (@yonish3)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/why-does-add_action-execute-only-after-the-second-product-update-attempt/#post-15717405)
 * It seems that the issue was with ACF update the DB after the hook is triggered.
   
   Therefore the value updated was always the value from the prevuis update.
 * Have slved it using this function:
 *     ```
       add_action('acf/save_post', 'woocommerce_update_product_acf_save_post', 1000, 1);
       function woocommerce_update_product_acf_save_post( $product_id ) {
           if (get_post_type($product_id) == "product") {
       		remove_action('acf/save_post', 'woocommerce_update_product_acf_save_post');
       		update_on_product_save( $product_id );
       	}
       }
   
       function update_on_product_save( $product_id ) {
           do somthing
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Why does add_action execute only after the second product update attempt?](https://wordpress.org/support/topic/why-does-add_action-execute-only-after-the-second-product-update-attempt/)
 *  Thread Starter [yonish3](https://wordpress.org/support/users/yonish3/)
 * (@yonish3)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/why-does-add_action-execute-only-after-the-second-product-update-attempt/#post-15715184)
 * Thanks, Margaret.
 * I tried adding the function code inside like this:
 *     ```
       add_action( 'woocommerce_update_product', 'update_on_product_save', 1000, 1 );
       function update_on_product_save($product_id, $product) {
   
           $updating_product_id = 'update_product_' . $product_id;
           if ( false === ( $updating_product = get_transient( $updating_product_id ) ) ) {
   
               //  do something
   
               set_transient( $updating_product_id , $product_id, 2 );
           }
       }
       ```
   
 * But it still doesn’t work.
 * I also don’t this it’s the issue.
    According to the link you shared, the issue
   is that the function will run twice. But the issue I have is that the function
   runs only after the second time I click the update button. i.e targeting the 
   _woocommerce\_update\_product _hook.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] How to remove bulk products by ID from woocomarce using SQL?](https://wordpress.org/support/topic/how-to-remove-bulk-products-by-id-from-woocomarce-using-sql/)
 *  Thread Starter [yonish3](https://wordpress.org/support/users/yonish3/)
 * (@yonish3)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/how-to-remove-bulk-products-by-id-from-woocomarce-using-sql/#post-14433495)
 * Have solved it using the REST API batch call.
    But will still be glad if someone
   has this in SQL query, as the API takes some time and many resources.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] How to fix error ‘WooCommerce.get(…).then is not a function’?](https://wordpress.org/support/topic/how-to-fix-error-woocommerce-get-then-is-not-a-function/)
 *  Thread Starter [yonish3](https://wordpress.org/support/users/yonish3/)
 * (@yonish3)
 * [6 years ago](https://wordpress.org/support/topic/how-to-fix-error-woocommerce-get-then-is-not-a-function/#post-12671108)
 * Apparently [woocommerce.github.io](https://woocommerce.github.io/woocommerce-rest-api-docs/)
   are referring to [@woocommerce/woocommerce-rest-api](https://www.npmjs.com/package/@woocommerce/woocommerce-rest-api)
   NPM package where [/docs.woocommerce.com](https://docs.woocommerce.com/document/woocommerce-rest-api/)
   official website refer to [woocommerce-api](https://www.npmjs.com/package/woocommerce-api)
   NPM package, which is out of support.
 * Kinda confusing…but that solves the mystery.
 * Make sure you are using the correct NPM package.
    -  This reply was modified 6 years ago by [yonish3](https://wordpress.org/support/users/yonish3/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] How to fix filter widget is showing on Woocommerce page?](https://wordpress.org/support/topic/how-to-fix-filter-widget-is-showing-on-woocommerce-page/)
 *  Thread Starter [yonish3](https://wordpress.org/support/users/yonish3/)
 * (@yonish3)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/how-to-fix-filter-widget-is-showing-on-woocommerce-page/#post-12541324)
 * Thanks for the input.
    I actually don’t have that options under page attribute.
 * I did manage to solve the issue. It was some settings under the theme that i 
   missed. As you suspected.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Minamaze] Mess-up the slider picture dimension.](https://wordpress.org/support/topic/mess-up-the-slider-picture-dimension/)
 *  Thread Starter [yonish3](https://wordpress.org/support/users/yonish3/)
 * (@yonish3)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/mess-up-the-slider-picture-dimension/#post-5635409)
 * any one?
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Minamaze] Move the logo](https://wordpress.org/support/topic/move-the-logo/)
 *  Thread Starter [yonish3](https://wordpress.org/support/users/yonish3/)
 * (@yonish3)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/move-the-logo/#post-5635407)
 * sure
    [](http://springlogy.com/)

Viewing 10 replies - 1 through 10 (of 10 total)