{"id":23774558,"url":"https://github.com/wpup/wc-export","last_synced_at":"2025-07-23T13:09:26.225Z","repository":{"id":62507686,"uuid":"63584739","full_name":"wpup/wc-export","owner":"wpup","description":"Export various data from WooCommerce","archived":false,"fork":false,"pushed_at":"2019-12-02T14:24:21.000Z","size":60,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-02T08:47:07.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wpup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-18T08:36:07.000Z","updated_at":"2019-12-02T14:24:23.000Z","dependencies_parsed_at":"2022-11-02T12:31:54.567Z","dependency_job_id":null,"html_url":"https://github.com/wpup/wc-export","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wpup/wc-export","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpup%2Fwc-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpup%2Fwc-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpup%2Fwc-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpup%2Fwc-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpup","download_url":"https://codeload.github.com/wpup/wc-export/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpup%2Fwc-export/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266682672,"owners_count":23967837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-01T06:15:46.915Z","updated_at":"2025-07-23T13:09:26.179Z","avatar_url":"https://github.com/wpup.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WooCommerce Export \n\n[![Build Status](https://travis-ci.org/wpup/wc-export.svg?branch=master)](https://travis-ci.org/wpup/wc-export)\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\nExport various data from WooCommerce.\n\nThe plugin cames with two exporters, a customers export that will export all billing fields and a emails exporter that will export the billing email field from a order.\n\nThe are three writers built in, CSV, XML and JSON.\n\n## Installation\n\n```sh\ncomposer require frozzare/wc-export\n```\n\n## Documentation\n\n* [Custom export](#custom-export)\n* [Custom writer](#custom-writer)\n\n### Custom export\n\nExample of a custom export type that will export the `billing_email` field from a order. With `query_args` method you can modify the `WP_Query` arguments.\n\n```php\n\u003c?php\n\nuse Frozzare\\WooCommerce\\Export\\Exports\\Export;\n\nclass Custom_Emails extends Export {\n\n\t/**\n\t * Get fields that should be exported.\n\t *\n\t * @return array\n\t */\n\tpublic function get_fields() {\n\t\treturn [\n\t\t\t'billing_email' =\u003e __( 'Email', 'woocommerce' )\n\t\t];\n\t}\n\n\t/**\n\t * Modify WP Query args.\n\t *\n\t * @param  array  $args\n\t *\n\t * @return array\n\t */\n\tpublic function query_args( array $args ) {\n\t\treturn $args;\n\t}\n}\n```\n\nThen you have to add the custom export to the exporter list with `wc_export_classes` filter.\n\n```php\n\u003c?php\n\n/**\n * Add export classes.\n *\n * @param  array $exports\n *\n * @return array\n */\nadd_filter( 'wc_export_classes', function ( array $exports ) {\n\treturn array_merge( $exports, [\n\t\t'Custom emails' =\u003e '\\\\Custom_Emails'\n\t] );\n} );\n```\n\n### Custom writer\n\nExample of a custom export writer that will export the given data argument to `render` method as JSON.\n\n```php\n\u003c?php\n\nuse Frozzare\\WooCommerce\\Export\\Writers\\Writer;\n\nclass Custom_JSON extends Writer {\n\n\t/**\n\t * Get the content type.\n\t *\n\t * @var string\n\t */\n\tprotected function get_content_type() {\n\t\treturn 'application/json';\n\t}\n\n\t/**\n\t * Get the file extension.\n\t *\n\t * @var string\n\t */\n\tprotected function get_extension() {\n\t\treturn 'json';\n\t}\n\n\t/**\n\t * Render JSON file.\n\t *\n\t * @param array $data\n\t */\n\tprotected function render( array $data ) {\n\t\tforeach ( $data as $index =\u003e $row ) {\n\t\t\tif ( ! is_array( $row ) ) {\n\t\t\t\tunset( $data[$index] );\n\t\t\t}\n\t\t}\n\n\t\techo json_encode( $data, JSON_UNESCAPED_UNICODE );\n\t}\n}\n```\n\nThen you have to add the custom writer to the writers list with `wc_export_writers` filter.\n\n```php\n\u003c?php\n\n/**\n * Add export writer.\n *\n * @param  array $writers\n *\n * @return array\n */\nadd_filter( 'wc_export_writers', function ( array $writers ) {\n\treturn array_merge( $writers, [\n\t\t'Custom JSON' =\u003e '\\\\Custom_JSON'\n\t] );\n} );\n```\n\n## License\n\nMIT © [Fredrik Forsmo](https://github.com/frozzare)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpup%2Fwc-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpup%2Fwc-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpup%2Fwc-export/lists"}