wpsc_purchase_log_pre_insert

Located in: purchase-log.class.php

Functions that call this hook: WPSC_Purchase_Log::save()

Arguments Accepted: none

Version Introduced: 3.8.9

Description: This action is triggered before a purchase log’s data is inserted into the database.

Code in context:

[php firstline=”519″ highlight=”519″]

do_action( ‘wpsc_purchase_log_pre_insert’ );

$data = apply_filters( ‘wpsc_purchase_log_insert_data’, $this->data );

$format = $this->get_data_format( $data );

$result = $wpdb->insert( WPSC_TABLE_PURCHASE_LOGS, $data, $format );

if ( $result ) {

$this->set( ‘id’, $wpdb->insert_id );

// set $this->args so that properties can be lazy loaded right after

// the row is inserted into the db

$this->args = array(

‘col’ => ‘id’,

‘value’ => $this->get( ‘id’ ),

);

}

do_action( ‘wpsc_purchase_log_insert’, $this );

[/php]