wpsc_purchase_log_fetched

Located in: purchase-log.class.php

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

Arguments Accepted: $purchase_log_object

Version Introduced: 3.8.9

Description: This action is triggered after a purchase log’s data is fetched from the database.

Code in context:

[php firstline=”292″ highlight=”321″]

private function fetch() {

global $wpdb;

if ( $this->fetched )

return;

// If $this->args is not set yet, it means the object contains a new unsaved

// row so we don’t need to fetch from DB

if ( ! $this->args[‘col’] || ! $this->args[‘value’] )

return;

extract( $this->args );

$format = self::get_column_format( $col );

$sql = $wpdb->prepare( "SELECT * FROM " . WPSC_TABLE_PURCHASE_LOGS . " WHERE {$col} = {$format}", $value );

$this->exists = false;

if ( $data = $wpdb->get_row( $sql, ARRAY_A ) ) {

$this->exists = true;

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

$this->cart_contents = $this->get_cart_contents();

$this->set_meta_props();

self::update_cache( $this );

}

do_action( ‘wpsc_purchase_log_fetched’, $this );

$this->fetched = true;

}

[/php]