Commit Graph

186 Commits

Author SHA1 Message Date
Jonathan Sadowski c67fda9552 Update importer to grab downloads id from export file when updating rows 2021-06-15 10:06:37 -05:00
James Allan 53e6a7317b Add filter to allow third-parties to filter exportable product types 2021-02-02 14:41:03 +10:00
Nestor Soriano 52eed70f04 Add a 'NumberUtil' class with a 'round' method.
There's a number of places in the WooCommerce codebase where the
built-in function 'round' is executed passing a non-numeric value
(not a number and not a string that can be parsed as a number),
for example round(''). In PHP 7 this yields a value of 0, but in
PHP 8 this throws an error.

This commit adds a 'NumberUtil' class with a static 'round' method,
this method checks if the passed value is numeric and if so it just
executes the built-in function, otherwise it returns 0. And all the
calls to 'round' in the codebase are replaced with 'NumberUtil::round'.
2020-10-01 11:08:51 +02:00
Claudio Sanches d48f1d4e2e Fixed package tag usage 2020-08-05 13:36:24 -03:00
Claudio Sanches 37777432d4 [Importer/Exporter] Fix "Published" column values
While variations only uses "published" and "private" statuses when
exporting we should display the variations as "draft" in case the parent
product it's also a draft.
2020-07-15 21:45:51 -03:00
Claudio Sanches f6cd453840
Merge pull request #26669 from woocommerce/fix/filter-params
Normalize parameters for woocommerce_product_importer_parsed_data filter
2020-07-01 12:39:17 -03:00
Claudio Sanches ab8a1b78a3
Merge pull request #26668 from woocommerce/fix/typo
Fixed typo in WC_Product_CSV_Importer class
2020-07-01 12:39:03 -03:00
Julia Amosova 7982efb3df Fix the @return description of the CSV Import categories parsing function 2020-06-08 15:03:00 -04:00
Julia Amosova ea17484e42 Remove check for existing term when parsing category & add better error handling 2020-06-07 20:59:23 -04:00
Claudio Sanches 9020cebdbb Normalize parameters for woocommerce_product_importer_parsed_data filter 2020-06-02 14:21:33 -03:00
Claudio Sanches f8a050f914 Fixed typo in WC_Product_CSV_Importer class 2020-06-02 11:42:50 -03:00
Claudio Sanches cd137915b8 Set correct post type for product variation
And catch any WC_Data_Exception
2020-01-06 21:36:54 -03:00
Claudio Sanches 8033d5751e Changed wc_get_product_classname function name to wc_get_product_object 2019-12-04 16:15:16 -03:00
Claudio Sanches ba0773d12e Apply wc_get_product_classname() in the current code base 2019-11-13 15:30:09 -03:00
Nico Hauser 5c84557984
Updated filter name 2019-08-20 08:05:19 +02:00
Nico Hauser 5291767228
Add new filter in addition to existing action
Currently there is no way to change the data fed into the importer. An example use of it is the following filter:

    add_filter('woocommerce_product_import_before_process_item', "product_import_before_process_item", 10, 1);
    function product_import_before_process_item($data){
        //modify the data before importing e.g. prevent inserting an empty name!
        foreach($data as $key => $value){
            if(isset($data[$key]) && empty($value)){
                unset($data[$key]);
            }
        }
    return $data;
    }
2019-08-15 22:00:31 +02:00
Ron Rennick 71d7f2c1bb remove trailing space 2019-07-10 14:01:38 -03:00
Ron Rennick 64476263b8 add filter for product import image separator 2019-07-10 09:13:05 -03:00
Rodrigo Primo 34e5018137
Merge pull request #23262 from woocommerce/fix/23257
CSV Import - check if sku or id column exists when updating products from csv
2019-07-09 14:25:03 -03:00
Claudio Sanches 55692cba87
Merge pull request #23255 from woocommerce/shopify-column-mapping
Mapping for default Shopify fields
2019-07-08 18:53:57 -03:00
Rodrigo Primo c21a69ff6d Complement WC_Product_CSV_Importer::parse_published_field() phpdoc
Add a phrase to WC_Product_CSV_Importer::parse_published_field() phpdoc
to note that 'true' and 'false' are also supported to set product
published status.
2019-05-21 15:55:41 -03:00
Mike Jolley aaca13ee3d Map more fields, including special columns with custom data handling requirements 2019-04-15 16:05:29 +01:00
Mike Jolley 93535047fd Ability to parse tags with space separators 2019-04-15 15:55:42 +01:00
Mike Jolley 558e96fdb9 parse_tax_status_field 2019-04-15 15:08:25 +01:00
Mike Jolley 244156c0be check if sku or id column exists when updating products from csv 2019-04-10 11:11:40 +01:00
Mike Jolley 7e3eec3ed6 Added parse_published_field 2019-04-04 12:21:38 +01:00
Viktor Szépe bd6a348af5
Fix PHPDoc in WC_Product_Importer
old stuff
2019-03-30 00:35:32 +01:00
Mike Jolley 8c2e305823 phpcs 2019-02-14 15:05:56 +00:00
Mike Jolley 621229b894 Variations cannot be drafts - set to private. 2019-02-14 15:05:10 +00:00
Mike Jolley b4427e0c25 Merge branch 'pr/22298' 2019-01-09 13:51:30 +00:00
Mike Jolley 06b5480f2d
Merge pull request #22071 from Prospress/fix/22060
don't html escape sku used in product lookup
2019-01-09 13:07:04 +00:00
Mike Jolley 0da7f9f06f
Merge pull request #21896 from jespervnielsen/patch-3
Add dependency to WC_Product_CSV_Importer_Controller
2019-01-07 12:48:45 +00:00
Ron Rennick 3083f05a0c missed phpcs sniffs 2018-12-27 11:45:12 -04:00
Ron Rennick 9b200b213d convert newlines to/from \n on export/import 2018-12-26 15:30:40 -04:00
Ron Rennick 0e9494ba50 phpcs sniff fixes in class-wc-product-csv-importer.php 2018-12-26 11:22:52 -04:00
Ron Rennick 99a48cc0a0 don't html escape sku used in product lookup 2018-11-28 13:47:27 -04:00
Ron Rennick ddcfb50d4b fix phpcs in class-wc-product-csv-importer.php 2018-11-28 13:45:33 -04:00
Ron Rennick 900c150569 Introduce `unescape_data` replacing `unescape_negative_number` for consistency with `escape_data` for strings in a CSV context 2018-11-15 15:49:39 -04:00
Jesper V Nielsen a09ddb99dc
Add dependency to WC_Product_CSV_Importer_Controller
When using the class WC_Product_CSV_Importer it gives fatal error, when using outsite of controller context, after "WC_Product_CSV_Importer_Controller" is introduced in this class.

This fixes it, and makes sure the external class exists, and is loaded.
2018-11-13 10:18:05 +01:00
Nicolas Bovee b7ef951ac0 Revised error message and set is_type method on . 2018-11-05 23:19:10 -07:00
Nicolas Bovee fe5f2d411b added an error for variation using variation for parent in import and removed @access on 87 2018-11-04 23:34:17 -07:00
Menaka S 566c57cc45 Trim the import file headers while reading 2018-10-19 16:43:52 +05:30
claudiulodro 7b19673dea Extra file type checking 2018-10-11 13:31:27 -07:00
Rodrigo Primo e3cbebf29e
Merge pull request #21192 from woocommerce/fix/20979
Restrict category creation in importer to appropriate permissions
2018-08-29 11:27:49 -03:00
Rodrigo Primo f1c2dbbf2b Remove unneeded phpcs ignore comment 2018-08-29 10:34:06 -03:00
claudiulodro 74645b13f9 Dont allow users without manage_product_terms permissions to create categories using the importer 2018-08-24 11:32:48 -07:00
Joey cd8416122f removed low stock options for variations, and addressed changes 2018-06-19 12:40:27 +01:00
Joey b08b55a651 added changes for low stock notifications per product 2018-05-27 05:40:58 +01:00
Mike Jolley e6ddc65c2a Wrap cell in ' rather than prepend 2018-05-11 12:16:02 +01:00
Mike Jolley 970a77b43b This was not needed after all. 2018-04-26 17:18:39 +01:00