rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -461,12 +461,13 @@ class WC_Product_CSV_Importer_Controller {
*/
protected function done() {
check_admin_referer( 'woocommerce-csv-importer' );
$imported = isset( $_GET['products-imported'] ) ? absint( $_GET['products-imported'] ) : 0;
$updated = isset( $_GET['products-updated'] ) ? absint( $_GET['products-updated'] ) : 0;
$failed = isset( $_GET['products-failed'] ) ? absint( $_GET['products-failed'] ) : 0;
$skipped = isset( $_GET['products-skipped'] ) ? absint( $_GET['products-skipped'] ) : 0;
$file_name = isset( $_GET['file-name'] ) ? sanitize_text_field( wp_unslash( $_GET['file-name'] ) ) : '';
$errors = array_filter( (array) get_user_option( 'product_import_error_log' ) );
$imported = isset( $_GET['products-imported'] ) ? absint( $_GET['products-imported'] ) : 0;
$imported_variations = isset( $_GET['products-imported-variations'] ) ? absint( $_GET['products-imported-variations'] ) : 0;
$updated = isset( $_GET['products-updated'] ) ? absint( $_GET['products-updated'] ) : 0;
$failed = isset( $_GET['products-failed'] ) ? absint( $_GET['products-failed'] ) : 0;
$skipped = isset( $_GET['products-skipped'] ) ? absint( $_GET['products-skipped'] ) : 0;
$file_name = isset( $_GET['file-name'] ) ? sanitize_text_field( wp_unslash( $_GET['file-name'] ) ) : '';
$errors = array_filter( (array) get_user_option( 'product_import_error_log' ) );
include_once dirname( __FILE__ ) . '/views/html-csv-import-done.php';
}

View File

@@ -32,7 +32,7 @@ function wc_importer_current_locale() {
* @return array
*/
function wc_importer_default_english_mappings( $mappings ) {
if ( 'en_US' === wc_importer_current_locale() ) {
if ( 'en_US' === wc_importer_current_locale() && is_array( $mappings ) && count( $mappings ) > 0 ) {
return $mappings;
}
@@ -92,7 +92,7 @@ add_filter( 'woocommerce_csv_product_import_mapping_default_columns', 'wc_import
* @return array
*/
function wc_importer_default_special_english_mappings( $mappings ) {
if ( 'en_US' === wc_importer_current_locale() ) {
if ( 'en_US' === wc_importer_current_locale() && is_array( $mappings ) && count( $mappings ) > 0 ) {
return $mappings;
}

View File

@@ -30,6 +30,14 @@ if ( ! defined( 'ABSPATH' ) ) {
);
}
if ( 0 < $imported_variations ) {
$results[] = sprintf(
/* translators: %d: products count */
_n( '%s variations imported', '%s variations imported', $imported_variations, 'woocommerce' ),
'<strong>' . number_format_i18n( $imported_variations ) . '</strong>'
);
}
if ( 0 < $skipped ) {
$results[] = sprintf(
/* translators: %d: products count */