wpsc_pre_purchase_logs

Located in: wpsc-user_log_functions.php

Functions that call this hook: wpsc_user_details()
Arguments Accepted: none
Version Introduced: 3.8

Description: This hook is triggered from the “My Account page” it will run just before the users purchase history is output.

note: The users purchase table has already been output at this stage, this hook is triggered before any column details are output to the browser.

Code in context:
[php firstline=”379″ highlight=”386″]
function wpsc_user_details() {
global $wpdb, $user_ID, $wpsc_purchlog_statuses, $gateway_checkout_form_fields, $purchase_log, $col_count;

$nzshpcrt_gateways = nzshpcrt_get_gateways();
$i = 0;
$subtotal = 0;

do_action( ‘wpsc_pre_purchase_logs’ );

foreach ( (array)$purchase_log as $purchase ) {
$status_state = "expand";
$status_style = "display:none;";
$alternate = "";
$i++;

if ( ($i % 2) != 0 )
$alternate = "class=’alt’";

echo "<tr $alternate>nr";
echo " <td class=’processed’>";
echo "<a href=’#’ onclick=’return show_details_box("status_box_" . $purchase[‘id’] . "","log_expander_icon_" . $purchase[‘id’] . "");’>";

if ( !empty($_GET[‘id’]) && $_GET[‘id’] == $purchase[‘id’] ) {
$status_state = "collapse";
$status_style = "style=’display: block;’";
}

echo "<img class=’log_expander_icon’ id=’log_expander_icon_" . $purchase[‘id’] . "’ src=’" . WPSC_CORE_IMAGES_URL . "/icon_window_$status_state.gif’ alt=” title=” />";

echo "<span id=’form_group_" . $purchase[‘id’] . "_text’>" . __( ‘Details’, ‘wpsc’ ) . "</span>";
echo "</a>";
echo " </td>nr";

echo " <td>";
echo date( "jS M Y", $purchase[‘date’] );
echo " </td>nr";

echo " <td>";
[/php]