• Resolved mrmelson

    (@mrmelson)


    Location is enable. _manage_stock is true. Product has current location. Why i can`t update quantity product location? Always 0. By PHP and ‘_stock_at_’ . $location_id i can update this value, at import too, but in admin panel – NOT! How i can do this in admin?

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Fahad Mahmood

    (@fahadmahmood)

    My friend, spend a little more time and you will find the reason. When locations are using the stock value field so default stock value field will remain disabled. And if location is assigned to a product and that location is enabled too, then stock value will must save the inserted number.

    Thread Starter mrmelson

    (@mrmelson)

    How it must working? I come here becouse I lost a lot of time for any variations params. I go to code for finding how it must working. Please, help

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    I am working on a task and can’t immediately switch to this one for troubleshooting with you, if you can copy/paste any error or warning so that can easily be fixed but troubleshooting or recreating the case as you are facing would take time. Kindly record a video, it will help in diagnosis.

    Thread Starter mrmelson

    (@mrmelson)

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    I just watched the video, you didn’t change the value in the input field. Why? Try to insert a number and then hit the update button. Or maybe I am missing something?

    Thread Starter mrmelson

    (@mrmelson)

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    https://youtu.be/550DyQJLMU4

    Please watch the video I recorded for you and check the stock locations tab on the plugin settings page, maybe you will see enable/disable status better there.

    Thread Starter mrmelson

    (@mrmelson)

    Is empty
    “get_post_meta($id, ‘_manage_stock’, true)” is ‘1’, but not ‘yes’
    that all…

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    I don’t know what are you talking about, if you are comfortable with the code so please come up with a solution. Results are different on my screen so it would require troubleshooting on your end, kindly continue with it and let me know if any improvement is required. It would be a contribution from your side obviously.

    Thread Starter mrmelson

    (@mrmelson)

    stock-locations-for-woocommerce\src\classes\class-slw-stock-locations-tab.php – line 492
    use this
    $manage_stock = get_post_meta($id, ‘_manage_stock’, true) === ‘1’;
    or
    $manage_stock = wc_bool_to_string(get_post_meta($id, ‘_manage_stock’, true)) === ‘yes’;
    Better “if( ! get_post_meta($id, ‘_manage_stock’, true) )” on line 493 – without $variable

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Thank you, I will release a new version with this improvement.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Quantity always 0’ is closed to new replies.