• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / EDD_Batch_Payments_Import::process_step() – Process a step

You appear to be a bot. Output may be restricted

Description

Process a step

Usage

$bool = EDD_Batch_Payments_Import::process_step();

Parameters

Returns

bool

Source

File name: easy-digital-downloads/includes/admin/import/class-batch-import-payments.php
Lines:

1 to 53 of 53
  public function process_step() {

    $more = false;

    if ( ! $this->can_import() ) {
      wp_die( __( 'You do not have permission to import data.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
    }

    // Remove certain actions to ensure they don't fire when creating the payments
    remove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999 );
    remove_action( 'edd_admin_sale_notice', 'edd_admin_email_notice', 10 );

    $i      = 1;
    $offset = $this->step > 1 ? ( $this->per_step * ( $this->step - 1 ) ) : 0;

    if( $offset > $this->total ) {
      $this->done = true;

      // Clean up the temporary records in the payment import process
      global $wpdb;
      $sql = "DELETE FROM {$wpdb->prefix}edd_customermeta WHERE meta_key = '_canonical_import_id'";
      $wpdb->query( $sql );

      // Delete the uploaded CSV file.
      unlink( $this->file );
    }

    if( ! $this->done && $this->csv ) {

      $more = true;

      foreach( $this->csv as $key => $row ) {

        // Skip all rows until we pass our offset
        if( $key + 1 <= $offset ) {
          continue;
        }

        // Done with this batch
        if( $i > $this->per_step ) {
          break;
        }

        // Import payment
        $this->create_payment( $row );

        $i++;
      }

    }

    return $more;
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 17th June 2022

Primary Sidebar

Information

Function name: EDD_Batch_Payments_Import::process_step
Class ref: EDD_Batch_Payments_Import
Plugin ref: Easy Digital Downloads
Version: 3.1.0.2
Sourcefile: includes/admin/import/class-batch-import-payments.php
File ref: includes/admin/import/class-batch-import-payments.php
Deprecated?: No
API Letters: B,E,I,P

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 6.2.2
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins