Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxrice/3acf9676951537c04052 to your computer and use it in GitHub Desktop.
Save maxrice/3acf9676951537c04052 to your computer and use it in GitHub Desktop.
WooCommerce Customer/Order CSV Export - Add HTTP Basic Auth to HTTP POST export
<?php
function wc_csv_export_add_http_post_basic_auth( $args ) {
// you can set other HTTP headers using the format $args['headers']['Header Name'] = 'header value'
$args['headers']['Authorization'] = 'Basic ' . base64_encode( 'your_username:your_password' );
return $args;
}
add_filter( 'wc_customer_order_csv_export_http_post_args', 'wc_csv_export_add_http_post_basic_auth' );
@setjo1980
Copy link

I have recently purchased Order/Customer CSV Export addon

I want to export csv directly to the extranet at: http://corp.gourmetsolution.com:6081/clients/nativo/ under the folder “Orders Upload”The folder supports WebDAV but not FTP

And this extranet url requires Username and password

Can this be done thru the above code

If yes pls let me know how to do this, where to add the code?

Guide me thru all steps

@bekarice
Copy link

hey @setjo1980 unfortunately there are no notifications for gist comments, sorry for the delay here.

Not familiar enough with webDAV to know if you could use HTTP POST instead of FTP, but that might be the best option to start with. This would require customization, and while support is included with each purchase, plugin customizations are not. We typically recommend Codeable for these projects. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment