Title: Updating database from third party application
Last modified: June 30, 2020

---

# Updating database from third party application

 *  Resolved [obtenmiweb](https://wordpress.org/support/users/obtenmiweb/)
 * (@obtenmiweb)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/updating-database-from-third-party-application/)
 * Hello,
 * We’re integrating a wordpress/woocommerce database with a third party application.
   The purpose of the app is to keep woocommerce stock quantity in-sync with the
   third party app.
 * The stock_quantity in the product_meta_look_up table is being updated so the 
   queries are working fine. We’re able to see this on phpMyAdmin but not on the
   actual website, it keeps displaying the old values.
 * I’ve tried incognito browsing in case it’s a cache issue but that didn’t work.
 * Help is very appreciated.
    -  This topic was modified 5 years, 10 months ago by [obtenmiweb](https://wordpress.org/support/users/obtenmiweb/).
      Reason: typo

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

 *  [con](https://wordpress.org/support/users/conschneider/)
 * (@conschneider)
 * Engineer
 * [5 years, 10 months ago](https://wordpress.org/support/topic/updating-database-from-third-party-application/#post-13059691)
 * Hi there,
 * > I’ve tried incognito browsing in case it’s a cache issue but that didn’t work.
 * What does your template file use for getting the value? Is it:
 * `$product->get_stock_quantity();`
 * or something else?
 * Kind regards,
 *  Thread Starter [obtenmiweb](https://wordpress.org/support/users/obtenmiweb/)
 * (@obtenmiweb)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/updating-database-from-third-party-application/#post-13060589)
 * I’m using the default template that comes with WooCommerce, the only change I’ve
   made is in the database. I did try this too and it still doesn’t display the 
   actual DB value:
 * Your help is appreciated.
 *     ```
       add_filter( 'woocommerce_get_availability_text', 'bbloomer_custom_get_availability_text', 99, 2 );
   
       function bbloomer_custom_get_availability_text( $availability, $product ) {
         $stock = $product->get_stock_quantity();
         if ( $product->is_in_stock() && $product->managing_stock() ) $availability = __( 'Quantity: ' . $stock, 'woocommerce' );
         return $availability;
       }
       ```
   
    -  This reply was modified 5 years, 10 months ago by [obtenmiweb](https://wordpress.org/support/users/obtenmiweb/).
    -  This reply was modified 5 years, 10 months ago by [obtenmiweb](https://wordpress.org/support/users/obtenmiweb/).
 *  [con](https://wordpress.org/support/users/conschneider/)
 * (@conschneider)
 * Engineer
 * [5 years, 10 months ago](https://wordpress.org/support/topic/updating-database-from-third-party-application/#post-13063080)
 * Hi again,
 * Let’s try:
 *     ```
       function cowo_get_my_prod_info(){
   
       	global $product; // Get WooCommerce product instance.
   
       	$s = $product->get_stock_status();  // run.
       	$q = $product->get_stock_quantity();
   
       	echo('<h5>Stock info:</h5> Stock status: ' . $s . ' and we have: ' . $q . ' units left.<br><br>'); 
   
       }
   
       add_action( 'woocommerce_single_product_summary', 'cowo_get_my_prod_info' );
       ```
   
 * Kind regards,
 *  [con](https://wordpress.org/support/users/conschneider/)
 * (@conschneider)
 * Engineer
 * [5 years, 10 months ago](https://wordpress.org/support/topic/updating-database-from-third-party-application/#post-13100258)
 * Hi there,
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved–
   if you have any further questions, you can start a new thread.
 * Kind regards,

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

The topic ‘Updating database from third party application’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * 4 replies
 * 2 participants
 * Last reply from: [con](https://wordpress.org/support/users/conschneider/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/updating-database-from-third-party-application/#post-13100258)
 * Status: resolved