Title: chalisoft's Replies | WordPress.org

---

# chalisoft

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Can’t add product to cart on variable product](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/#post-15944654)
 * [@fahadmahmood](https://wordpress.org/support/users/fahadmahmood/) I added the
   code to line 565 of the file class-slw-stock-locations-tab.php, you can see it
   at [https://imgur.com/tHSiQ0O](https://imgur.com/tHSiQ0O) . And it worked perfectly.
   _stock_status meta key of the variations worked correctly when I updated the 
   product with any quantity. You can refer to this solution of mine.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Can’t add product to cart on variable product](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/#post-15943963)
 * [@fahadmahmood](https://wordpress.org/support/users/fahadmahmood/) I am sorry,
   I can’t speak English, I can only write English so my videos have no voice. And
   I’m so sorry for understanding some of the WooCommerce functions, for example,
   wc_get_product() only works after the init action. And I am also very sorry if
   I have wasted your time. But for testers like me, I will check many cases, find
   bugs and fix it myself. I’m also a developer very busy with my work however I
   would also like to take a moment to contribute and perfect this great plugin.
   Thank you once again.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Can’t add product to cart on variable product](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/#post-15942179)
 * [@fahadmahmood](https://wordpress.org/support/users/fahadmahmood/) It still doesn’t
   work. I checked the update_wc_stock_status() method in the helper-slw-product.
   php file . And I see that the code is crashing, you used the update_wc_stock_status()
   method to call the variation ID. In this method you used wc_get_product() function
   to get product data. However, it cannot get variation data through variation 
   ID. You can watch my short record [https://vimeo.com/742260706](https://vimeo.com/742260706)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Can’t add product to cart on variable product](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/#post-15941673)
 * [@fahadmahmood](https://wordpress.org/support/users/fahadmahmood/) I checked 
   your code and i see [https://imgur.com/oGW3OuU](https://imgur.com/oGW3OuU)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Can’t add product to cart on variable product](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/#post-15941457)
 * [@fahadmahmood](https://wordpress.org/support/users/fahadmahmood/) Thank you 
   so much! There’s just one more problem, I think it’d be great if it’s fixed [https://imgur.com/PP3cScG](https://imgur.com/PP3cScG)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Can’t add product to cart on variable product](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/cant-add-product-to-cart-on-variable-product/#post-15941269)
 * [@fahadmahmood](https://wordpress.org/support/users/fahadmahmood/) You can see
   my recent recording [https://vimeo.com/742192217](https://vimeo.com/742192217).
   This video makes the problem more clear at the end of the video.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Stock value updated. Please refresh this page.](https://wordpress.org/support/topic/stock-value-updated-please-refresh-this-page/)
 *  [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/stock-value-updated-please-refresh-this-page/#post-15921206)
 * [@fahadmahmood](https://wordpress.org/support/users/fahadmahmood/) Hi, I checked
   the method get_all_product_stock_locations_for_selection() on file stock-locations-
   for-woocommerce\src\helpers\helper-slw-frontend.php, you can see [https://i.imgur.com/EnmMX0x.png](https://i.imgur.com/EnmMX0x.png),
   then i checked the method get_product_locations_stock_total() on stock-locations-
   for-woocommerce\src\helpers\helper-slw-product.php, you can see [https://i.imgur.com/00qAZj3.png](https://i.imgur.com/00qAZj3.png),
   and i checked the method getProductStockLocations() on stock-locations-for-woocommerce\
   src\helpers\helper-slw-stock-allocation.php, you can see [https://i.imgur.com/fA6abIn.png](https://i.imgur.com/fA6abIn.png)
 * I see that, I only get the “Stock value updated. Please refresh this page.” on
   the variant product page. When I try to refresh the page, stock will be set to
   0. Through a few checks on the code, I found the getProductStockLocations() method
   only works with simple products. I think you update the handling for the variant
   product in this method so it can work properly
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Stock value updated. Please refresh this page.](https://wordpress.org/support/topic/stock-value-updated-please-refresh-this-page/)
 *  [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/stock-value-updated-please-refresh-this-page/#post-15919933)
 * I am also getting the “Stock value updated. Please refresh this page.” on the
   product pages. [@fahadmahmood](https://wordpress.org/support/users/fahadmahmood/)
   You can view this at [https://i.imgur.com/aJj18Js.png](https://i.imgur.com/aJj18Js.png).
   I updated my inventory via a CSV file and got the above message
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Does this plugin support quick view?](https://wordpress.org/support/topic/does-this-plugin-support-quick-view/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/does-this-plugin-support-quick-view/#post-15919661)
 * Thanks for your feedback. I will try to do it
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] How to add a blank option to the select locations?](https://wordpress.org/support/topic/how-to-add-a-blank-option-to-the-select-locations/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [4 years ago](https://wordpress.org/support/topic/how-to-add-a-blank-option-to-the-select-locations/#post-15711909)
 * [@fahadmahmood](https://wordpress.org/support/users/fahadmahmood/) Thank you 
   so much!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Error 500 when upgrading to the latest version](https://wordpress.org/support/topic/error-500-when-upgrading-to-the-latest-version/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [4 years ago](https://wordpress.org/support/topic/error-500-when-upgrading-to-the-latest-version/#post-15652147)
 * [@fahadmahmood](https://wordpress.org/support/users/fahadmahmood/) Many thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Error 500 when upgrading to the latest version](https://wordpress.org/support/topic/error-500-when-upgrading-to-the-latest-version/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [4 years ago](https://wordpress.org/support/topic/error-500-when-upgrading-to-the-latest-version/#post-15652128)
 * `$data['stock_quantity_sum'] += $data['stock_quantity'][$variation_id][$term-
   >term_id];` change to `$data['stock_quantity_sum'] += (int) $data['stock_quantity'][
   $variation_id][$term->term_id];` will work normally
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Error 500 when upgrading to the latest version](https://wordpress.org/support/topic/error-500-when-upgrading-to-the-latest-version/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [4 years ago](https://wordpress.org/support/topic/error-500-when-upgrading-to-the-latest-version/#post-15652122)
 * Yes, same as [@siriusnode](https://wordpress.org/support/users/siriusnode/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Stock Locations error is not displayed when creating variant product](https://wordpress.org/support/topic/stock-locations-error-is-not-displayed-when-creating-variant-product/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/stock-locations-error-is-not-displayed-when-creating-variant-product/#post-15497952)
 * It’s just that I haven’t enabled Stock Location. But, there is a small bug. When
   I clear select attribute on product page, The Stock Location select is still 
   visible. Can you fix this in the next update?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Stock Locations for WooCommerce] Stock Locations error is not displayed when creating variant product](https://wordpress.org/support/topic/stock-locations-error-is-not-displayed-when-creating-variant-product/)
 *  Thread Starter [chalisoft](https://wordpress.org/support/users/chalisoft/)
 * (@chalisoft)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/stock-locations-error-is-not-displayed-when-creating-variant-product/#post-15497593)
 * I have solved the problem. Thank you

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