• Resolved tpo

    (@topod)


    Hello, I’d like to ask how in the plugin set the quantity of products in stock if I have an import file in this format:

    <qty>0</qty> – not in stock
    <qty>1</qty> – is in stock
    <qty>7</qty> – delivery within 7 days

    Thank you!

Viewing 1 replies (of 1 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @topod

    Out of the box, WooCommerce supports “instock” and “outofstock” as values in the stock status field. So, to change the 0’s and 1’s, you can use a custom PHP function: https://www.wpallimport.com/documentation/developers/execute-php/. For example:

    [str_replace( array( "0", "1" ), array( "outofstock", "instock" ), {qty[1]} )]

    You’d pass this to the “Set with XPath” field under “Stock status” in the Inventory tab of our WooCommerce add-on. And, you can adjust this function to return the proper value for the custom stock status “delivery within 7 days” that’s on your site.

    • This reply was modified 6 years, 8 months ago by WP All Import.
Viewing 1 replies (of 1 total)
  • The topic ‘Manage inventory’ is closed to new replies.