Title: PHP Warning: array_sum()
Last modified: July 31, 2025

---

# PHP Warning: array_sum()

 *  Resolved [Tushar Tajane](https://wordpress.org/support/users/tushonline/)
 * (@tushonline)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/php-warning-array_sum/)
 * Hi, we’re getting similar error for `array_sum(): Addition is not supported on
   type string` & sum of the stock shows 0, even if locations show their stock quantity.
 * `proxy_fcgi:error [pid 1928858:tid 1928942 [client 103.110.xxx.xxx AH01071: Got
   error 'PHP message: PHP Warning: array_sum(): Addition is not supported on type
   string in /home//jtxnqx…………stock-locations-for-woocommerce/src/classes/class-
   slw-stock-locations-tab.php on line 146', referer: /wp-admin/edit.php?s=54927&
   post_status=all&post_type=product&action=-1&location&product_type&stock_status&
   seo-filter&paged=1&action2=-1`
 * TIA 🙂

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

 *  Plugin Author [Fahad Mahmood](https://wordpress.org/support/users/fahadmahmood/)
 * (@fahadmahmood)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/php-warning-array_sum/#post-18579295)
 * Just fixed it, you will get it in the next version.
 *  Thread Starter [Tushar Tajane](https://wordpress.org/support/users/tushonline/)
 * (@tushonline)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/php-warning-array_sum/#post-18585552)
 * Thanks a lot Fahad
 *  Thread Starter [Tushar Tajane](https://wordpress.org/support/users/tushonline/)
 * (@tushonline)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/php-warning-array_sum/#post-18654070)
 * Hi Fahad
 * Despite running a cron & getting success message – the SUM of products does not
   show 0 when all the locations stock is gone to 0.
 * This is causing customers placing the order when stock is 1.
 * See image below
 * ![](https://i0.wp.com/i.ibb.co/sd2t6dvp/Whats-App-Image-2025-09-23-at-13-06-05-
   da71622a.jpg?ssl=1)
 *  Plugin Author [Fahad Mahmood](https://wordpress.org/support/users/fahadmahmood/)
 * (@fahadmahmood)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/php-warning-array_sum/#post-18655588)
 * Make sure your locations are enabled from the edit location page or stock locations
   tab under the plugin settings page? When locations are disabled, they won’t save
   the values.
   And please start a new topic when you have a new problem, this topic
   has been resolved already.
    -  This reply was modified 8 months, 2 weeks ago by [Fahad Mahmood](https://wordpress.org/support/users/fahadmahmood/).

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

The topic ‘PHP Warning: array_sum()’ is closed to new replies.

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

 * 4 replies
 * 2 participants
 * Last reply from: [Fahad Mahmood](https://wordpress.org/support/users/fahadmahmood/)
 * Last activity: [8 months, 2 weeks ago](https://wordpress.org/support/topic/php-warning-array_sum/#post-18655588)
 * Status: resolved