html-csv-import-done.php
5 years ago
html-csv-import-footer.php
8 years ago
html-csv-import-header.php
8 years ago
html-csv-import-mapping.php
8 years ago
html-csv-import-progress.php
8 years ago
html-csv-import-steps.php
8 years ago
html-product-csv-import-form.php
5 years ago
html-csv-import-done.php
105 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Importer - Done! |
| 4 | * |
| 5 | * @package WooCommerce\Admin\Importers |
| 6 | */ |
| 7 | |
| 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | exit; |
| 10 | } |
| 11 | ?> |
| 12 | <div class="wc-progress-form-content woocommerce-importer"> |
| 13 | <section class="woocommerce-importer-done"> |
| 14 | <?php |
| 15 | $results = array(); |
| 16 | |
| 17 | if ( 0 < $imported ) { |
| 18 | $results[] = sprintf( |
| 19 | /* translators: %d: products count */ |
| 20 | _n( '%s product imported', '%s products imported', $imported, 'woocommerce' ), |
| 21 | '<strong>' . number_format_i18n( $imported ) . '</strong>' |
| 22 | ); |
| 23 | } |
| 24 | |
| 25 | if ( 0 < $updated ) { |
| 26 | $results[] = sprintf( |
| 27 | /* translators: %d: products count */ |
| 28 | _n( '%s product updated', '%s products updated', $updated, 'woocommerce' ), |
| 29 | '<strong>' . number_format_i18n( $updated ) . '</strong>' |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | if ( 0 < $skipped ) { |
| 34 | $results[] = sprintf( |
| 35 | /* translators: %d: products count */ |
| 36 | _n( '%s product was skipped', '%s products were skipped', $skipped, 'woocommerce' ), |
| 37 | '<strong>' . number_format_i18n( $skipped ) . '</strong>' |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | if ( 0 < $failed ) { |
| 42 | $results [] = sprintf( |
| 43 | /* translators: %d: products count */ |
| 44 | _n( 'Failed to import %s product', 'Failed to import %s products', $failed, 'woocommerce' ), |
| 45 | '<strong>' . number_format_i18n( $failed ) . '</strong>' |
| 46 | ); |
| 47 | } |
| 48 | |
| 49 | if ( 0 < $failed || 0 < $skipped ) { |
| 50 | $results[] = '<a href="#" class="woocommerce-importer-done-view-errors">' . __( 'View import log', 'woocommerce' ) . '</a>'; |
| 51 | } |
| 52 | |
| 53 | if ( ! empty( $file_name ) ) { |
| 54 | $results[] = sprintf( |
| 55 | /* translators: %s: File name */ |
| 56 | __( 'File uploaded: %s', 'woocommerce' ), |
| 57 | '<strong>' . $file_name . '</strong>' |
| 58 | ); |
| 59 | } |
| 60 | |
| 61 | /* translators: %d: import results */ |
| 62 | echo wp_kses_post( __( 'Import complete!', 'woocommerce' ) . ' ' . implode( '. ', $results ) ); |
| 63 | ?> |
| 64 | </section> |
| 65 | <section class="wc-importer-error-log" style="display:none"> |
| 66 | <table class="widefat wc-importer-error-log-table"> |
| 67 | <thead> |
| 68 | <tr> |
| 69 | <th><?php esc_html_e( 'Product', 'woocommerce' ); ?></th> |
| 70 | <th><?php esc_html_e( 'Reason for failure', 'woocommerce' ); ?></th> |
| 71 | </tr> |
| 72 | </thead> |
| 73 | <tbody> |
| 74 | <?php |
| 75 | if ( count( $errors ) ) { |
| 76 | foreach ( $errors as $error ) { |
| 77 | if ( ! is_wp_error( $error ) ) { |
| 78 | continue; |
| 79 | } |
| 80 | $error_data = $error->get_error_data(); |
| 81 | ?> |
| 82 | <tr> |
| 83 | <th><code><?php echo esc_html( $error_data['row'] ); ?></code></th> |
| 84 | <td><?php echo esc_html( $error->get_error_message() ); ?></td> |
| 85 | </tr> |
| 86 | <?php |
| 87 | } |
| 88 | } |
| 89 | ?> |
| 90 | </tbody> |
| 91 | </table> |
| 92 | </section> |
| 93 | <script type="text/javascript"> |
| 94 | jQuery(function() { |
| 95 | jQuery( '.woocommerce-importer-done-view-errors' ).on( 'click', function() { |
| 96 | jQuery( '.wc-importer-error-log' ).slideToggle(); |
| 97 | return false; |
| 98 | } ); |
| 99 | } ); |
| 100 | </script> |
| 101 | <div class="wc-actions"> |
| 102 | <a class="button button-primary" href="<?php echo esc_url( admin_url( 'edit.php?post_type=product' ) ); ?>"><?php esc_html_e( 'View products', 'woocommerce' ); ?></a> |
| 103 | </div> |
| 104 | </div> |
| 105 |