• Resolved jakevoelcker

    (@jakevoelcker)


    I’m writing a small extension to allow product exports to be filtered by modified date. I’ve got the backend stuff working, and I’ve used the “woocommerce_product_export_row” hook to add a date field to the product Export page.

    When the Export page is submitted, the form is processed by /woocommerce/assets/js/admin/wc-product-export.js – how can I get my new date field to be processed without having to modify the stock wc-product-export.js file?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there!

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers!

    Thread Starter jakevoelcker

    (@jakevoelcker)

    Thanks @gabrielfuentes

    A more general question which may be easier to answer is:

    Is there a way of hooking into or adding to files in /woocommerce/assets/js/admin/ without overwriting the core?

    Thread Starter jakevoelcker

    (@jakevoelcker)

    I found my answer.

    No need to modify the wc-product-export.js file.

    Instead, it is possible to access the form post data directly from php. But any custom fields you have added using the “woocommerce_product_export_row” hook will be submitted as an array called ‘form’.

    For example, if you add a new input field with name=”supplier”, you access it using $_POST[‘form’][‘supplier’] or $_POST[‘form’][0] (NOT $_POST[‘supplier’]).

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    That’s wonderful! Thank you for sharing it ??

    Great! If you have any further questions, you can start a new thread.

    Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add custom date field to Export Products’ is closed to new replies.