WP eCommerce - Version 3.8.9.1-dev

Version Description

Download this release

Release Info

Developer garyc40
Plugin Icon 128x128 WP eCommerce
Version 3.8.9.1-dev
Comparing to
See all releases

Code changes from version 3.8.9 to 3.8.9.1-dev

readme.txt CHANGED
@@ -155,6 +155,18 @@ Before updating please make a backup of your existing files and database. Just i
155
  After upgrading from earlier versions look for link "Update Store". This will update your database structure to work with new version.
156
 
157
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
158
  = 3.8.9 =
159
  * New: Additional columns can now be added to Store Sales page via filter hook.
160
  * New: Additional filters for purchase log notification classes.
155
  After upgrading from earlier versions look for link "Update Store". This will update your database structure to work with new version.
156
 
157
  == Changelog ==
158
+ = 3.8.9.1 =
159
+ * Fix: Fatal error in Shipwire.
160
+ * Fix: Fatal error with customer meta on multisite.
161
+ * Fix: Pagination in admin product list doesn't work.
162
+ * Fix: Permalinks are incorrect when products page is set as home page and permalink scheme is set to %post_name%.
163
+ * Fix: Rewrite rules are not regenerated correctly when switching from "Default" to "Post name".
164
+ * Fix: Shipwire and Google Analytics are not working properly.
165
+ * Fix: Shipwire request is sent even when Shipwire is not active.
166
+ * Fix: States are displayed as numbers in admin purchase report.
167
+ * Fix: Transaction results displaying cart content twice as well as "Oops, there is nothing in your cart".
168
+ * Fix: Use customer meta instead of $_SESSION for eway and payflow message.
169
+
170
  = 3.8.9 =
171
  * New: Additional columns can now be added to Store Sales page via filter hook.
172
  * New: Additional filters for purchase log notification classes.
wp-shopping-cart.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP e-Commerce
4
  * Plugin URI: http://getshopped.org/
5
  * Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://getshopped.org" target="_blank">GetShopped.org</a> | <a href="http://getshopped.org/forums/" target="_blank">Support Forum</a> | <a href="http://docs.getshopped.org/" target="_blank">Documentation</a>
6
- * Version: 3.8.9
7
  * Author: Instinct Entertainment
8
  * Author URI: http://getshopped.org/
9
  **/
3
  * Plugin Name: WP e-Commerce
4
  * Plugin URI: http://getshopped.org/
5
  * Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://getshopped.org" target="_blank">GetShopped.org</a> | <a href="http://getshopped.org/forums/" target="_blank">Support Forum</a> | <a href="http://docs.getshopped.org/" target="_blank">Documentation</a>
6
+ * Version: 3.8.9.1-dev
7
  * Author: Instinct Entertainment
8
  * Author URI: http://getshopped.org/
9
  **/
wpsc-admin/admin.php CHANGED
@@ -984,7 +984,6 @@ function _wpsc_action_permalink_structure_changed() {
984
  add_action( 'admin_notices', 'wpsc_check_permalink_notice' );
985
 
986
  wpsc_update_page_urls( true );
987
- return $return;
988
  }
989
 
990
  /**
984
  add_action( 'admin_notices', 'wpsc_check_permalink_notice' );
985
 
986
  wpsc_update_page_urls( true );
 
987
  }
988
 
989
  /**
wpsc-admin/init.php CHANGED
@@ -491,6 +491,8 @@ function wpsc_update_page_urls( $auto = false ) {
491
  global $wpdb;
492
 
493
  wpsc_update_permalink_slugs();
 
 
494
 
495
  if( ! $auto ){
496
  $sendback = wp_get_referer();
491
  global $wpdb;
492
 
493
  wpsc_update_permalink_slugs();
494
+ wpsc_core_load_page_titles();
495
+ wpsc_register_post_types();
496
 
497
  if( ! $auto ){
498
  $sendback = wp_get_referer();
wpsc-core/wpsc-constants.php CHANGED
@@ -30,9 +30,9 @@ function wpsc_core_constants() {
30
  if(!defined('WPSC_URL'))
31
  define( 'WPSC_URL', plugins_url( '', __FILE__ ) );
32
  // Define Plugin version
33
- define( 'WPSC_VERSION', '3.8.9' );
34
- define( 'WPSC_MINOR_VERSION', '618697' );
35
- define( 'WPSC_PRESENTABLE_VERSION', '3.8.9' );
36
  define( 'WPSC_DB_VERSION', 3 );
37
 
38
  // Define Debug Variables for developers
30
  if(!defined('WPSC_URL'))
31
  define( 'WPSC_URL', plugins_url( '', __FILE__ ) );
32
  // Define Plugin version
33
+ define( 'WPSC_VERSION', '3.8.9.1-dev' );
34
+ define( 'WPSC_MINOR_VERSION', '621694' );
35
+ define( 'WPSC_PRESENTABLE_VERSION', '3.8.9.1-dev' );
36
  define( 'WPSC_DB_VERSION', 3 );
37
 
38
  // Define Debug Variables for developers
wpsc-core/wpsc-functions.php CHANGED
@@ -355,7 +355,7 @@ function wpsc_register_post_types() {
355
  'query_var' => true,
356
  'register_meta_box_cb' => 'wpsc_meta_boxes',
357
  'rewrite' => array(
358
- 'slug' => $wpsc_page_titles['products'] . '/%wpsc_product_category%',
359
  'with_front' => false
360
  )
361
  );
@@ -417,7 +417,7 @@ function wpsc_register_post_types() {
417
  'labels' => $labels,
418
  'hierarchical' => true,
419
  'rewrite' => array(
420
- 'slug' => $wpsc_page_titles['products'],
421
  'with_front' => false,
422
  'hierarchical' => (bool) get_option( 'product_category_hierarchical_url', 0 ),
423
  ),
@@ -655,7 +655,7 @@ add_filter( 'wp_nav_menu_args', 'wpsc_switch_the_query', 99 );
655
  function _wpsc_pre_get_posts_reset_taxonomy_globals( $query ) {
656
  global $wp_the_query;
657
 
658
- if ( $query !== $wp_the_query )
659
  return;
660
 
661
  if ( ! $query->get( 'page' ) && ! $query->get( 'paged' ) )
@@ -1291,7 +1291,6 @@ function wpsc_is_checkout() {
1291
  */
1292
  function wpsc_product_link( $permalink, $post, $leavename ) {
1293
  global $wp_query, $wpsc_page_titles, $wpsc_query, $wp_current_filter;
1294
- $term_url = '';
1295
  $rewritecode = array(
1296
  '%wpsc_product_category%',
1297
  $leavename ? '' : '%postname%',
@@ -1311,9 +1310,9 @@ function wpsc_product_link( $permalink, $post, $leavename ) {
1311
  return $permalink;
1312
 
1313
  $permalink_structure = get_option( 'permalink_structure' );
1314
- // This may become customiseable later
1315
 
1316
- $our_permalink_structure = $wpsc_page_titles['products'] . "/%wpsc_product_category%/%postname%/";
 
1317
  // Mostly the same conditions used for posts, but restricted to items with a post type of "wpsc-product "
1318
 
1319
  if ( '' != $permalink_structure && !in_array( $post->post_status, array( 'draft', 'pending' ) ) ) {
@@ -1339,7 +1338,6 @@ function wpsc_product_link( $permalink, $post, $leavename ) {
1339
  $product_category = $link;
1340
  }
1341
  $category_slug = $product_category;
1342
- $term_url = get_term_link( $category_slug, 'wpsc_product_category' );
1343
  } else {
1344
  // If the product is associated with only one category, we only have one choice
1345
  if ( !isset( $product_categories[0] ) )
@@ -1354,8 +1352,6 @@ function wpsc_product_link( $permalink, $post, $leavename ) {
1354
  $product_category->slug = null;
1355
 
1356
  $category_slug = $product_category->slug;
1357
-
1358
- $term_url = get_term_link( $category_slug, 'wpsc_product_category' );
1359
  }
1360
 
1361
  $post_name = $post->post_name;
@@ -1384,6 +1380,7 @@ function wpsc_product_link( $permalink, $post, $leavename ) {
1384
 
1385
  $permalink = str_replace( $rewritecode, $rewritereplace, $our_permalink_structure );
1386
  $permalink = user_trailingslashit( $permalink, 'single' );
 
1387
  $permalink = home_url( $permalink );
1388
  }
1389
  return apply_filters( 'wpsc_product_permalink', $permalink, $post->ID );
@@ -1436,7 +1433,6 @@ function wpsc_checkout_template_fallback() {
1436
  * @return void
1437
  */
1438
  function wpsc_get_page_post_names() {
1439
-
1440
  $wpsc_page['products'] = basename( get_option( 'product_list_url' ) );
1441
  $wpsc_page['checkout'] = basename( get_option( 'checkout_url' ) );
1442
  $wpsc_page['transaction_results'] = basename( get_option( 'transact_url' ) );
@@ -1656,6 +1652,8 @@ function wpsc_get_current_customer_id( $mode = '' ) {
1656
  * if otherwise.
1657
  */
1658
  function wpsc_get_all_customer_meta( $id = false ) {
 
 
1659
  if ( ! $id )
1660
  $id = wpsc_get_current_customer_id();
1661
 
@@ -1712,6 +1710,8 @@ function wpsc_get_customer_meta( $key = '', $id = false ) {
1712
  * if otherwise.
1713
  */
1714
  function wpsc_update_all_customer_meta( $profile, $id = false ) {
 
 
1715
  if ( ! $id )
1716
  $id = wpsc_get_current_customer_id( 'create' );
1717
 
355
  'query_var' => true,
356
  'register_meta_box_cb' => 'wpsc_meta_boxes',
357
  'rewrite' => array(
358
+ 'slug' => str_replace( basename( home_url() ), '', $wpsc_page_titles['products'] ) . '/%wpsc_product_category%',
359
  'with_front' => false
360
  )
361
  );
417
  'labels' => $labels,
418
  'hierarchical' => true,
419
  'rewrite' => array(
420
+ 'slug' => str_replace( basename( home_url() ), '', $wpsc_page_titles['products'] ),
421
  'with_front' => false,
422
  'hierarchical' => (bool) get_option( 'product_category_hierarchical_url', 0 ),
423
  ),
655
  function _wpsc_pre_get_posts_reset_taxonomy_globals( $query ) {
656
  global $wp_the_query;
657
 
658
+ if ( is_admin() || $query !== $wp_the_query )
659
  return;
660
 
661
  if ( ! $query->get( 'page' ) && ! $query->get( 'paged' ) )
1291
  */
1292
  function wpsc_product_link( $permalink, $post, $leavename ) {
1293
  global $wp_query, $wpsc_page_titles, $wpsc_query, $wp_current_filter;
 
1294
  $rewritecode = array(
1295
  '%wpsc_product_category%',
1296
  $leavename ? '' : '%postname%',
1310
  return $permalink;
1311
 
1312
  $permalink_structure = get_option( 'permalink_structure' );
 
1313
 
1314
+ // This may become customiseable later
1315
+ $our_permalink_structure = str_replace( basename( home_url() ), '', $wpsc_page_titles['products'] ) . "/%wpsc_product_category%/%postname%/";
1316
  // Mostly the same conditions used for posts, but restricted to items with a post type of "wpsc-product "
1317
 
1318
  if ( '' != $permalink_structure && !in_array( $post->post_status, array( 'draft', 'pending' ) ) ) {
1338
  $product_category = $link;
1339
  }
1340
  $category_slug = $product_category;
 
1341
  } else {
1342
  // If the product is associated with only one category, we only have one choice
1343
  if ( !isset( $product_categories[0] ) )
1352
  $product_category->slug = null;
1353
 
1354
  $category_slug = $product_category->slug;
 
 
1355
  }
1356
 
1357
  $post_name = $post->post_name;
1380
 
1381
  $permalink = str_replace( $rewritecode, $rewritereplace, $our_permalink_structure );
1382
  $permalink = user_trailingslashit( $permalink, 'single' );
1383
+
1384
  $permalink = home_url( $permalink );
1385
  }
1386
  return apply_filters( 'wpsc_product_permalink', $permalink, $post->ID );
1433
  * @return void
1434
  */
1435
  function wpsc_get_page_post_names() {
 
1436
  $wpsc_page['products'] = basename( get_option( 'product_list_url' ) );
1437
  $wpsc_page['checkout'] = basename( get_option( 'checkout_url' ) );
1438
  $wpsc_page['transaction_results'] = basename( get_option( 'transact_url' ) );
1652
  * if otherwise.
1653
  */
1654
  function wpsc_get_all_customer_meta( $id = false ) {
1655
+ global $wpdb;
1656
+
1657
  if ( ! $id )
1658
  $id = wpsc_get_current_customer_id();
1659
 
1710
  * if otherwise.
1711
  */
1712
  function wpsc_update_all_customer_meta( $profile, $id = false ) {
1713
+ global $wpdb;
1714
+
1715
  if ( ! $id )
1716
  $id = wpsc_get_current_customer_id( 'create' );
1717
 
wpsc-includes/category.functions.php CHANGED
@@ -123,10 +123,12 @@ function wpsc_print_category_classes($category_to_print = false, $echo = true) {
123
  global $wp_query, $wpdb;
124
 
125
  //if we are in wpsc category page then get the current category
126
- if(isset($wp_query->query_vars['wpsc_product_category']) || (isset($wp_query->query_vars['taxonomy']) && 'wpsc_product_category' == $wp_query->query_vars['taxonomy']))
127
- $curr_cat = get_term_by('slug',$wp_query->query_vars['term'], 'wpsc_product_category');
128
- else
129
- $curr_cat = false;
 
 
130
 
131
  //check if we are in wpsc category page and that we have a term_id of the category to print
132
  //this is done here because none of the following matters if we don't have one of those and we can
@@ -592,14 +594,14 @@ function wpsc_get_terms_variation_sort_filter($terms){
592
  add_filter('get_terms','wpsc_get_terms_variation_sort_filter');
593
 
594
  /**
595
- * Abstracts Suhosin check into a function. Used primarily in relation to target markets.
596
  * May be deprecated or never publicly launched if we change how the target market variables work.
597
- *
598
  * @since 3.8.9
599
  * @return boolean
600
  */
601
  function wpsc_is_suhosin_enabled() {
602
- return @ extension_loaded( 'suhosin' ) && @ ini_get( 'suhosin.post.max_vars' ) > 0 && @ ini_get( 'suhosin.post.max_vars' ) < 500;
603
  }
604
 
605
  ?>
123
  global $wp_query, $wpdb;
124
 
125
  //if we are in wpsc category page then get the current category
126
+ $curr_cat = false;
127
+ $term = get_query_var( 'wpsc_product_category' );
128
+ if ( ! $term && get_query_var( 'taxonomy' ) == 'wpsc_product_category' )
129
+ $term = get_query_var( 'term' );
130
+ if ( $term )
131
+ $curr_cat = get_term_by( 'slug', $term, 'wpsc_product_category' );
132
 
133
  //check if we are in wpsc category page and that we have a term_id of the category to print
134
  //this is done here because none of the following matters if we don't have one of those and we can
594
  add_filter('get_terms','wpsc_get_terms_variation_sort_filter');
595
 
596
  /**
597
+ * Abstracts Suhosin check into a function. Used primarily in relation to target markets.
598
  * May be deprecated or never publicly launched if we change how the target market variables work.
599
+ *
600
  * @since 3.8.9
601
  * @return boolean
602
  */
603
  function wpsc_is_suhosin_enabled() {
604
+ return @ extension_loaded( 'suhosin' ) && @ ini_get( 'suhosin.post.max_vars' ) > 0 && @ ini_get( 'suhosin.post.max_vars' ) < 500;
605
  }
606
 
607
  ?>
wpsc-includes/purchase-log-notification.class.php CHANGED
@@ -328,6 +328,8 @@ class WPSC_Purchase_Log_Admin_Notification extends WPSC_Purchase_Log_Notificatio
328
  }
329
 
330
  public function get_raw_message() {
 
 
331
  $form_data = new WPSC_Checkout_Form_Data( $this->purchase_log->get( 'id' ) );
332
  $raw_data = $form_data->get_raw_data();
333
 
@@ -386,8 +388,13 @@ class WPSC_Purchase_Log_Admin_Notification extends WPSC_Purchase_Log_Notificatio
386
  foreach ( $data as $section ) {
387
  if ( empty( $section['fields'] ) )
388
  continue;
 
389
  $message .= "<strong>{$section['title']}</strong>\r\n";
390
  foreach ( $section['fields'] as $field ) {
 
 
 
 
391
  $message .= $field->name . ' : ' . $field->value . "\r\n";
392
  }
393
  $message .= "\r\n";
328
  }
329
 
330
  public function get_raw_message() {
331
+ global $wpdb;
332
+
333
  $form_data = new WPSC_Checkout_Form_Data( $this->purchase_log->get( 'id' ) );
334
  $raw_data = $form_data->get_raw_data();
335
 
388
  foreach ( $data as $section ) {
389
  if ( empty( $section['fields'] ) )
390
  continue;
391
+
392
  $message .= "<strong>{$section['title']}</strong>\r\n";
393
  foreach ( $section['fields'] as $field ) {
394
+ if ( strpos( $field->unique_name, 'state' ) && is_numeric( $field->value ) ) {
395
+ $sql = $wpdb->prepare( "SELECT name FROM " . WPSC_TABLE_REGION_TAX . " WHERE id = %d", $field->value );
396
+ $field->value = $wpdb->get_var( $sql );
397
+ }
398
  $message .= $field->name . ' : ' . $field->value . "\r\n";
399
  }
400
  $message .= "\r\n";
wpsc-shipping/library/shipwire_functions.php CHANGED
@@ -57,6 +57,9 @@ class WPSC_Shipwire {
57
  self::$warehouse = '00';
58
  self::$endpoint = 'https://api.shipwire.com/exec/'; //For testing, change to api.beta.shipwire
59
 
 
 
 
60
  //Hooks into transaction results for Order Fulfillment API. wpsc_confirm_checkout would be logical - but it is run for each cart item.
61
  //In fact, the only two current transaction page actions happen within the cart loop. Not great.
62
  //I believe there is a patch on Issue 490 that proposes a 'wpsc_transaction_results_shutdown' action. It doesn't pass a $log_id, but it does pass a sessionid, which is fine.
@@ -315,12 +318,9 @@ class WPSC_Shipwire {
315
  * @since 3.8.9
316
  * @return type
317
  */
318
- public function shipwire_on_checkout( $object, $sessionid, $display ) {
319
  global $wpdb;
320
-
321
- $log_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM " . WPSC_TABLE_PURCHASE_LOGS . " WHERE sessionid = %s", $sessionid ) );
322
-
323
- self::process_order_request( $log_id );
324
  }
325
 
326
  /**
@@ -909,6 +909,4 @@ function shipwire_sent_request( $xml ) {
909
  function shipwire_send_tracking_request( $xml ) {
910
  _deprecated_function( __FUNCTION__, '3.8.9', 'WPSC_Shipwire' );
911
  return WPSC_Shipwire::send_tracking_request( $xml );
912
- }
913
-
914
- ?>
57
  self::$warehouse = '00';
58
  self::$endpoint = 'https://api.shipwire.com/exec/'; //For testing, change to api.beta.shipwire
59
 
60
+ if ( ! self::is_active() )
61
+ return;
62
+
63
  //Hooks into transaction results for Order Fulfillment API. wpsc_confirm_checkout would be logical - but it is run for each cart item.
64
  //In fact, the only two current transaction page actions happen within the cart loop. Not great.
65
  //I believe there is a patch on Issue 490 that proposes a 'wpsc_transaction_results_shutdown' action. It doesn't pass a $log_id, but it does pass a sessionid, which is fine.
318
  * @since 3.8.9
319
  * @return type
320
  */
321
+ public function shipwire_on_checkout( $purchase_log_object, $sessionid, $display ) {
322
  global $wpdb;
323
+ self::process_order_request( $purchase_log_object->get( 'id' ) );
 
 
 
324
  }
325
 
326
  /**
909
  function shipwire_send_tracking_request( $xml ) {
910
  _deprecated_function( __FUNCTION__, '3.8.9', 'WPSC_Shipwire' );
911
  return WPSC_Shipwire::send_tracking_request( $xml );
912
+ }
 
 
wpsc-shipping/shipwire.php CHANGED
@@ -1,14 +1,16 @@
1
  <?php
2
 
 
 
3
  /**
4
- * New Shipwire Shipping rates
5
  * This is a very simple gateway - no settings, and essentially just a wrapper function for the Shipwire Shipping Rate API
6
  */
7
 
8
  class WPSC_Shipwire_Shipping {
9
  public $internal_name;
10
- public $name;
11
-
12
  /**
13
  * Constructor
14
  */
@@ -18,18 +20,18 @@ class WPSC_Shipwire_Shipping {
18
  $this->is_external = true;
19
  $this->requires_weight = false;
20
  $this->needs_zipcode = true;
21
-
22
  return true;
23
  }
24
-
25
  function getName() {
26
  return $this->name;
27
  }
28
-
29
  function getInternalName() {
30
  return $this->internal_name;
31
  }
32
-
33
 
34
  function getForm() {
35
 
@@ -40,7 +42,7 @@ class WPSC_Shipwire_Shipping {
40
 
41
  return $output;
42
  }
43
-
44
  function submit_form() {
45
  return true;
46
  }
@@ -56,6 +58,4 @@ if ( WPSC_Shipwire::is_active() ) {
56
 
57
  $wpsc_shipwire = new WPSC_Shipwire_Shipping();
58
  $wpsc_shipping_modules[$wpsc_shipwire->getInternalName()] = $wpsc_shipwire;
59
- }
60
-
61
- ?>
1
  <?php
2
 
3
+ require_once( WPSC_FILE_PATH . '/wpsc-shipping/library/shipwire_functions.php' );
4
+
5
  /**
6
+ * New Shipwire Shipping rates
7
  * This is a very simple gateway - no settings, and essentially just a wrapper function for the Shipwire Shipping Rate API
8
  */
9
 
10
  class WPSC_Shipwire_Shipping {
11
  public $internal_name;
12
+ public $name;
13
+
14
  /**
15
  * Constructor
16
  */
20
  $this->is_external = true;
21
  $this->requires_weight = false;
22
  $this->needs_zipcode = true;
23
+
24
  return true;
25
  }
26
+
27
  function getName() {
28
  return $this->name;
29
  }
30
+
31
  function getInternalName() {
32
  return $this->internal_name;
33
  }
34
+
35
 
36
  function getForm() {
37
 
42
 
43
  return $output;
44
  }
45
+
46
  function submit_form() {
47
  return true;
48
  }
58
 
59
  $wpsc_shipwire = new WPSC_Shipwire_Shipping();
60
  $wpsc_shipping_modules[$wpsc_shipwire->getInternalName()] = $wpsc_shipwire;
61
+ }
 
 
wpsc-theme/functions/wpsc-transaction_results_functions.php CHANGED
@@ -10,25 +10,30 @@
10
  * @param $transaction_id (int) the transaction id
11
  */
12
  function transaction_results( $sessionid, $display_to_screen = true, $transaction_id = null ) {
13
- global $message_html, $echo_to_screen, $wpsc_cart;
14
 
 
15
  $echo_to_screen = $display_to_screen;
16
 
17
- $purchase_log = new WPSC_Purchase_Log( $sessionid, 'sessionid' );
18
 
19
- $message_html = _wpsc_transaction_results_html( $purchase_log );
 
 
 
 
 
20
 
21
  $wpsc_cart->empty_cart();
22
- return $message_html;
23
- }
24
 
25
- function _wpsc_transaction_results_html( $purchase_log ) {
26
- $output = wpsc_get_transaction_html_output( $purchase_log );
27
 
28
- if ( version_compare( WPSC_VERSION, '3.8.9', '>=' ) )
29
- echo $output;
30
 
31
- return $output;
 
 
32
  }
33
 
34
  function wpsc_transaction_theme() {
@@ -54,10 +59,10 @@ function wpsc_transaction_theme() {
54
  if ( isset( $_REQUEST['eway'] ) && '1' == $_REQUEST['eway'] )
55
  $sessionid = $_GET['result'];
56
  elseif ( isset( $_REQUEST['eway'] ) && '0' == $_REQUEST['eway'] )
57
- echo $_SESSION['eway_message'];
58
  elseif ( isset( $_REQUEST['payflow'] ) && '1' == $_REQUEST['payflow'] ){
59
- echo $_SESSION['payflow_message'];
60
- $_SESSION['payflow_message'] = '';
61
  }
62
 
63
  $dont_show_transaction_results = false;
@@ -123,4 +128,4 @@ function wpsc_transaction_theme() {
123
  }else
124
  printf( __( 'Sorry your transaction was not accepted.<br /><a href="%1$s">Click here to go back to checkout page</a>.', 'wpsc' ), get_option( "shopping_cart_url" ) );
125
  }
126
- }
10
  * @param $transaction_id (int) the transaction id
11
  */
12
  function transaction_results( $sessionid, $display_to_screen = true, $transaction_id = null ) {
13
+ global $message_html, $echo_to_screen, $wpsc_cart, $purchase_log;
14
 
15
+ // pre-3.8.9 variable
16
  $echo_to_screen = $display_to_screen;
17
 
18
+ $purchase_log_object = new WPSC_Purchase_Log( $sessionid, 'sessionid' );
19
 
20
+ // compatibility with pre-3.8.9 templates where they use a global
21
+ // $purchase_log object which is simply just a database row
22
+ $purchase_log = (object) $purchase_log_object->get_data();
23
+
24
+ // pre-3.8.9 templates also use this global variable
25
+ $message_html = wpsc_get_transaction_html_output( $purchase_log_object );
26
 
27
  $wpsc_cart->empty_cart();
 
 
28
 
29
+ do_action( 'wpsc_transaction_results_shutdown', $purchase_log_object, $sessionid, $display_to_screen );
 
30
 
31
+ return $message_html;
32
+ }
33
 
34
+ function wpsc_transaction_html_output() {
35
+ global $message_html;
36
+ echo $message_html;
37
  }
38
 
39
  function wpsc_transaction_theme() {
59
  if ( isset( $_REQUEST['eway'] ) && '1' == $_REQUEST['eway'] )
60
  $sessionid = $_GET['result'];
61
  elseif ( isset( $_REQUEST['eway'] ) && '0' == $_REQUEST['eway'] )
62
+ echo wpsc_get_customer_meta( 'eway_message' );
63
  elseif ( isset( $_REQUEST['payflow'] ) && '1' == $_REQUEST['payflow'] ){
64
+ echo wpsc_get_customer_meta( 'payflow_message' );
65
+ wpsc_delete_customer_meta( 'payflow_message' );
66
  }
67
 
68
  $dont_show_transaction_results = false;
128
  }else
129
  printf( __( 'Sorry your transaction was not accepted.<br /><a href="%1$s">Click here to go back to checkout page</a>.', 'wpsc' ), get_option( "shopping_cart_url" ) );
130
  }
131
+ }