-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compatibility issues with the references to the wpsc-theme folder
- WPSC_THEME_ENGINE_V1_PATH and WPSC_THEME_ENGINE_V1_URL should be used to refer to the templates' paths. - Restore the wpsc-theme folder, just in case old themes are still relying on these files being there.
- Loading branch information
Gary Cao
committed
Jun 11, 2013
1 parent
bf9962c
commit 2423b5c
Showing
35 changed files
with
3,731 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
Generalised theme compatibility fixes, the shopping cart does not need bullets | ||
*/ | ||
|
||
li.widget_wp_shopping_cart ul { | ||
list-style-image: none !important; | ||
list-style-type: none !important; | ||
} | ||
|
||
li.widget_wp_shopping_cart ul li { | ||
list-style-image: none !important; | ||
list-style-type: none !important; | ||
background: none !important; | ||
} | ||
|
||
li.widget_wp_shopping_cart ul li:before{ | ||
/* Countermand any content properties like the one in the default wordpress theme. */ | ||
content: "" !important; | ||
} | ||
|
||
|
||
div.categorydisplay ul li:before{ | ||
/* Countermand any content properties like the one in the default wordpress theme. */ | ||
content: "" !important; | ||
} | ||
|
||
a.additional_description_link img { | ||
margin:0px 3px 0px 0px; | ||
} | ||
|
||
div.textcol form { | ||
min-width: 300px; | ||
} | ||
|
||
div.wpsc_loading_animation { | ||
visibility: hidden; | ||
} | ||
|
||
#idc-container-parent{ | ||
clear:both; | ||
|
||
} | ||
table.wpsc_checkout_table label{ | ||
display:inline; | ||
padding-right:10px; | ||
} | ||
aside.widget_wpsc_product_specials span.oldprice { | ||
text-decoration: line-through; | ||
color: #666; | ||
} |
130 changes: 130 additions & 0 deletions
130
wpsc-theme/functions/wpsc-transaction_results_functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<?php | ||
|
||
/** | ||
* transaction_results function main function for creating the purchase reports, transaction results page, and email receipts | ||
* @access public | ||
* | ||
* @since 3.7 | ||
* @param $sessionid (string) unique session id | ||
* @param echo_to_screen (boolean) whether to output the results or return them (potentially redundant) | ||
* @param $transaction_id (int) the transaction id | ||
*/ | ||
function transaction_results( $sessionid, $display_to_screen = true, $transaction_id = null ) { | ||
global $message_html, $echo_to_screen, $wpsc_cart, $purchase_log; | ||
|
||
// pre-3.8.9 variable | ||
$echo_to_screen = $display_to_screen; | ||
|
||
$purchase_log_object = new WPSC_Purchase_Log( $sessionid, 'sessionid' ); | ||
|
||
// compatibility with pre-3.8.9 templates where they use a global | ||
// $purchase_log object which is simply just a database row | ||
$purchase_log = $purchase_log_object->get_data(); | ||
|
||
// pre-3.8.9 templates also use this global variable | ||
$message_html = wpsc_get_transaction_html_output( $purchase_log_object ); | ||
|
||
$wpsc_cart->empty_cart(); | ||
|
||
do_action( 'wpsc_transaction_results_shutdown', $purchase_log_object, $sessionid, $display_to_screen ); | ||
|
||
return $message_html; | ||
} | ||
|
||
function wpsc_transaction_html_output() { | ||
global $message_html; | ||
echo $message_html; | ||
} | ||
|
||
function wpsc_transaction_theme() { | ||
global $wpdb, $user_ID, $nzshpcrt_gateways, $sessionid, $cart_log_id, $errorcode; | ||
$errorcode = ''; | ||
$transactid = ''; | ||
$dont_show_transaction_results = false; | ||
if ( isset( $_GET['sessionid'] ) ) | ||
$sessionid = $_GET['sessionid']; | ||
|
||
if ( !isset( $_GET['sessionid'] ) && isset( $_GET['ms'] ) ) | ||
$sessionid = $_GET['ms']; | ||
|
||
if ( isset( $_GET['gateway'] ) && 'google' == $_GET['gateway'] ) { | ||
wpsc_google_checkout_submit(); | ||
wpsc_delete_customer_meta( 'checkout_session_id' ); | ||
} | ||
|
||
$selected_gateway = wpsc_get_customer_meta( 'selected_gateway' ); | ||
if ( $selected_gateway && in_array( $selected_gateway, array( 'paypal_certified', 'wpsc_merchant_paypal_express' ) ) ) | ||
$sessionid = wpsc_get_customer_meta( 'paypal_express_sessionid' ); | ||
|
||
if ( isset( $_REQUEST['eway'] ) && '1' == $_REQUEST['eway'] ) | ||
$sessionid = $_GET['result']; | ||
elseif ( isset( $_REQUEST['eway'] ) && '0' == $_REQUEST['eway'] ) | ||
echo wpsc_get_customer_meta( 'eway_message' ); | ||
elseif ( isset( $_REQUEST['payflow'] ) && '1' == $_REQUEST['payflow'] ){ | ||
echo wpsc_get_customer_meta( 'payflow_message' ); | ||
wpsc_delete_customer_meta( 'payflow_message' ); | ||
} | ||
|
||
$dont_show_transaction_results = false; | ||
|
||
if ( $selected_gateway ) { | ||
// Replaces the ugly if else for gateways | ||
switch( $selected_gateway ){ | ||
case 'paypal_certified': | ||
case 'wpsc_merchant_paypal_express': | ||
echo wpsc_get_customer_meta( 'paypal_express_message' ); | ||
|
||
$reshash = wpsc_get_customer_meta( 'paypal_express_reshash' ); | ||
if( isset( $reshash['PAYMENTINFO_0_TRANSACTIONTYPE'] ) && in_array( $reshash['PAYMENTINFO_0_TRANSACTIONTYPE'], array( 'expresscheckout', 'cart' ) ) ) | ||
$dont_show_transaction_results = false; | ||
else | ||
$dont_show_transaction_results = true; | ||
break; | ||
case 'dps': | ||
$sessionid = decrypt_dps_response(); | ||
break; | ||
//paystation was not updating the purchase logs for successful payment - this is ugly as need to have the databse update done in one place by all gatways on a sucsessful transaction hook not some within the gateway and some within here and some not at all??? This is getting a major overhaul but for here and now it just needs to work for the gold cart people! | ||
case 'paystation': | ||
$ec = $_GET['ec']; | ||
$result= $_GET['em']; | ||
|
||
if($result == 'Transaction successful' && $ec == 0) | ||
$processed_id = '3'; | ||
|
||
if($result == 'Insufficient Funds' && $ec == 5){ | ||
$processed_id = '6'; | ||
|
||
$payment_instructions = printf( __( 'Sorry your transaction was not accepted due to insufficient funds <br /><a href="%1$s">Click here to go back to checkout page</a>.', 'wpsc' ), get_option( "shopping_cart_url" ) ); | ||
} | ||
if ( $processed_id ) | ||
wpsc_update_purchase_log_status( $sessionid, $processed_id, 'sessionid' ); | ||
|
||
break; | ||
case 'wpsc_merchant_paymentexpress' : | ||
// Payment Express sends back there own session id, which is temporarily stored in the Auth field | ||
// so just swapping that over here | ||
$result = $wpdb->get_var( $wpdb->prepare( "SELECT `sessionid` FROM `" .WPSC_TABLE_PURCHASE_LOGS. "` WHERE `authcode` = %s", $sessionid ) ); | ||
if($result != null){ | ||
// just in case they are using an older version old gold cart (pre 2.9.5) | ||
$sessionid = $result; | ||
$dont_show_transaction_results = true; | ||
} | ||
break; | ||
case 'eway_hosted': | ||
$sessionid = decrypt_eway_uk_response(); | ||
break; | ||
//default filter for other payment gateways to use | ||
default: | ||
$sessionid = apply_filters('wpsc_previous_selected_gateway_' . $selected_gateway, $sessionid); | ||
break; | ||
} | ||
} | ||
|
||
if( ! $dont_show_transaction_results ) { | ||
if ( !empty($sessionid) ){ | ||
$cart_log_id = $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `sessionid`= %s LIMIT 1", $sessionid ) ); | ||
return transaction_results( $sessionid, true ); | ||
}else | ||
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" ) ); | ||
} | ||
} |
Oops, something went wrong.