0

I am writing an API plugin. Every time a product or quantity changes in woocommerce, I need to export a new price to the server. Also in the IPA there is import, which I will conduct through cron.

Help me find a way. Thank.

  • Can I get product changes? – Виктор Юстус Sep 18 '19 at 23:03
  • Probably. How are price and quantity stored in WooCommerce - as post_meta? How to hook post meta updates. – Rup Sep 18 '19 at 23:16
  • Yes, as post_meta. Do you offer to listen to all post_meta changes and catch the necessary keys? @Rup – Виктор Юстус Sep 18 '19 at 23:34
  • Like this? function update_price_hook ($meta_id, $post_id, $meta_key, $meta_value) { if ($meta_key == '_price' || $meta_key =='_regular_price') { //To do } } – Виктор Юстус Sep 18 '19 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.