Version Description
- Fix: Special price mix-up when ugprade to 3.8
- Fix: Missing database update notice
- Fix: Breadcrumb markup and style fixes
- Fix: Deprecate WPSC_Query()
- Fix: Deprecate wpsc_total_product_count()
- Fix: Deprecate wpsc_print_product_list()
- Change: Warning message for PHP 4 users. GoldCart requires PHP 5 or above.
- Change: Don't display categories when there's a search
Download this release
Release Info
Developer | garyc40 |
Plugin | WP eCommerce |
Version | 3.8.1 |
Comparing to | |
See all releases |
Code changes from version 3.8 to 3.8.1
- readme.txt +25 -10
- wp-shopping-cart.php +1 -1
- wpsc-admin/admin.php +1 -1
- wpsc-admin/ajax-and-init.php +40 -13
- wpsc-admin/display-update.page.php +16 -7
- wpsc-admin/includes/display-items-functions.php +1 -1
- wpsc-admin/includes/product-functions.php +13 -0
- wpsc-admin/includes/settings-pages/presentation.php +6 -1
- wpsc-admin/includes/updating-functions.php +1 -1
- wpsc-core/js/wp-e-commerce.js +1 -1
- wpsc-core/wpsc-constants.php +4 -4
- wpsc-core/wpsc-deprecated.php +37 -0
- wpsc-core/wpsc-functions.php +6 -2
- wpsc-core/wpsc-installer.php +28 -5
- wpsc-includes/ajax.functions.php +7 -0
- wpsc-includes/breadcrumbs.class.php +1 -1
- wpsc-includes/display.functions.php +1 -0
- wpsc-includes/product-template.php +1 -1
- wpsc-includes/theming.class.php +1 -1
- wpsc-theme/wpsc-products_page.php +2 -1
- wpsc-updates/updating_tasks.php +0 -34
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: mufasa, jghazally, valentinas, mychelle
|
|
3 |
Donate link: http://getshopped.org
|
4 |
Tags: e-commerce, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 3.1
|
7 |
-
Stable tag: 3.8
|
8 |
|
9 |
WP e-Commerce is a Web 2.0 application designed with usability, aesthetics, and presentation in mind.
|
10 |
|
@@ -37,6 +37,16 @@ After upgrading from earlier versions look for link "Update Store". This will up
|
|
37 |
|
38 |
|
39 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
= 3.8 =
|
41 |
* Utilize custom post types for products
|
42 |
* Utilize custom taxonomy for categories and variations
|
@@ -72,7 +82,7 @@ After upgrading from earlier versions look for link "Update Store". This will up
|
|
72 |
* All In One SEO Pack compatibility bugfixes and improvements.
|
73 |
* CSV has had some work done on it, it now takes larger files, and associates a CSV file to a single category of your choice. We'd love to be able to allow users to add the categories and images as part of the CSV file. We will look into it more at a later date.
|
74 |
* SSL we fixed the image issue from beta1 and used James Collis recommended fix (using is_ssl() for our conditions) Thanks James!
|
75 |
-
*
|
76 |
* When duplicating products, their tags do not get duplicated for the new product. <- Oh yes they DO!
|
77 |
* Google Checkout now sends off Discount Coupons As well. And we fixed the `name` vs `code` Issue people mentioned in the forum
|
78 |
* Category shortcode backwards compatibility
|
@@ -81,14 +91,14 @@ After upgrading from earlier versions look for link "Update Store". This will up
|
|
81 |
* Fixed adding variations when adding products
|
82 |
* Sender from the 'resend email to buyer' link on the purchase log details page has been fixed
|
83 |
* Shipping Discount Bug that stopped shipping working at all.
|
84 |
-
* Categories Widget has had numerous changes
|
85 |
* Better MU support.
|
86 |
-
* Canadian Tax
|
87 |
-
* US Tax
|
88 |
* Product Categories Caching Issue Resolved
|
89 |
-
* Coupons
|
90 |
-
*
|
91 |
-
*
|
92 |
* Stock claims are now cleared when the cart is emptied
|
93 |
* Purchase log bulk actions now work
|
94 |
* PayPal gateway module fixes and improvements
|
@@ -114,4 +124,9 @@ Advanced users can edit the CSS (and do just about anything). Not so advanced us
|
|
114 |
1. Products list in WordPress backend
|
115 |
2. Edit Product screen
|
116 |
3. Single product page
|
117 |
-
4. Checkout page
|
|
|
|
|
|
|
|
|
|
3 |
Donate link: http://getshopped.org
|
4 |
Tags: e-commerce, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 3.1.1
|
7 |
+
Stable tag: 3.8.1
|
8 |
|
9 |
WP e-Commerce is a Web 2.0 application designed with usability, aesthetics, and presentation in mind.
|
10 |
|
37 |
|
38 |
|
39 |
== Changelog ==
|
40 |
+
= 3.8.1 =
|
41 |
+
* Fix: Special price mix-up when ugprade to 3.8
|
42 |
+
* Fix: Missing database update notice
|
43 |
+
* Fix: Breadcrumb markup and style fixes
|
44 |
+
* Fix: Deprecate WPSC_Query()
|
45 |
+
* Fix: Deprecate wpsc_total_product_count()
|
46 |
+
* Fix: Deprecate wpsc_print_product_list()
|
47 |
+
* Change: Warning message for PHP 4 users. GoldCart requires PHP 5 or above.
|
48 |
+
* Change: Don't display categories when there's a search
|
49 |
+
|
50 |
= 3.8 =
|
51 |
* Utilize custom post types for products
|
52 |
* Utilize custom taxonomy for categories and variations
|
82 |
* All In One SEO Pack compatibility bugfixes and improvements.
|
83 |
* CSV has had some work done on it, it now takes larger files, and associates a CSV file to a single category of your choice. We'd love to be able to allow users to add the categories and images as part of the CSV file. We will look into it more at a later date.
|
84 |
* SSL we fixed the image issue from beta1 and used James Collis recommended fix (using is_ssl() for our conditions) Thanks James!
|
85 |
+
* Show list of Product Groupsí shows all Groups <- there may be some backwards compatibility issues (we havent encountered any but nevertheless if you spot any let us know)
|
86 |
* When duplicating products, their tags do not get duplicated for the new product. <- Oh yes they DO!
|
87 |
* Google Checkout now sends off Discount Coupons As well. And we fixed the `name` vs `code` Issue people mentioned in the forum
|
88 |
* Category shortcode backwards compatibility
|
91 |
* Fixed adding variations when adding products
|
92 |
* Sender from the 'resend email to buyer' link on the purchase log details page has been fixed
|
93 |
* Shipping Discount Bug that stopped shipping working at all.
|
94 |
+
* Categories Widget has had numerous changes ñ
|
95 |
* Better MU support.
|
96 |
+
* Canadian Tax ñ Fixes
|
97 |
+
* US Tax ñFixes
|
98 |
* Product Categories Caching Issue Resolved
|
99 |
+
* Coupons ñ ëApply to all Productsí and numerous bug fixes
|
100 |
+
* ëYour Accountí done some fixes to it.
|
101 |
+
* ëAccepted Paymentí goes straight to ëClosed Orderí
|
102 |
* Stock claims are now cleared when the cart is emptied
|
103 |
* Purchase log bulk actions now work
|
104 |
* PayPal gateway module fixes and improvements
|
124 |
1. Products list in WordPress backend
|
125 |
2. Edit Product screen
|
126 |
3. Single product page
|
127 |
+
4. Checkout page
|
128 |
+
|
129 |
+
== Upgrade Notice ==
|
130 |
+
|
131 |
+
= 3.8.1 =
|
132 |
+
This version addresses several urgent issues when upgrading from 3.7.x to 3.8.
|
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
|
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.1
|
7 |
* Author: Instinct Entertainment
|
8 |
* Author URI: http://getshopped.org/
|
9 |
**/
|
wpsc-admin/admin.php
CHANGED
@@ -908,7 +908,7 @@ function wpsc_check_permalink_notice(){
|
|
908 |
|
909 |
add_action( 'permalink_structure_changed' , 'wpsc_check_permalink_notice' );
|
910 |
add_action( 'permalink_structure_changed' , 'wpsc_update_permalinks' );
|
911 |
-
add_action( 'get_sample_permalink_html' , 'wpsc_update_permalinks' );
|
912 |
add_action( 'wp_ajax_category_sort_order', 'wpsc_ajax_set_category_order' );
|
913 |
add_action( 'wp_ajax_wpsc_ie_save', 'wpsc_ajax_ie_save' );
|
914 |
add_action('in_admin_header', 'wpsc_add_meta_boxes');
|
908 |
|
909 |
add_action( 'permalink_structure_changed' , 'wpsc_check_permalink_notice' );
|
910 |
add_action( 'permalink_structure_changed' , 'wpsc_update_permalinks' );
|
911 |
+
/* add_action( 'get_sample_permalink_html' , 'wpsc_update_permalinks' ); // this just seems unnecessary and produces PHP notices */
|
912 |
add_action( 'wp_ajax_category_sort_order', 'wpsc_ajax_set_category_order' );
|
913 |
add_action( 'wp_ajax_wpsc_ie_save', 'wpsc_ajax_ie_save' );
|
914 |
add_action('in_admin_header', 'wpsc_add_meta_boxes');
|
wpsc-admin/ajax-and-init.php
CHANGED
@@ -989,6 +989,8 @@ function wpsc_update_page_urls($auto = false) {
|
|
989 |
$changes_made = false;
|
990 |
foreach ( $wpsc_pageurl_option as $option_key => $page_string ) {
|
991 |
$post_id = $wpdb->get_var( "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` IN('page','post') AND `post_content` LIKE '%$page_string%' LIMIT 1" );
|
|
|
|
|
992 |
$the_new_link = _get_page_link( $post_id );
|
993 |
if ( stristr( get_option( $option_key ), "https://" ) ) {
|
994 |
$the_new_link = str_replace( 'http://', "https://", $the_new_link );
|
@@ -1253,16 +1255,11 @@ if ( isset( $_REQUEST['wpsc_admin_action'] ) && ($_REQUEST['wpsc_admin_action']
|
|
1253 |
function wpsc_checkout_settings() {
|
1254 |
global $wpdb;
|
1255 |
$wpdb->show_errors = true;
|
1256 |
-
|
1257 |
-
$filter = $wpdb->escape( $_POST['wpsc_form_set'] );
|
1258 |
-
} else {
|
1259 |
-
$filter = 0;
|
1260 |
-
}
|
1261 |
|
1262 |
if ( $_POST['new_form_set'] != null ) {
|
1263 |
-
$new_form_set = $wpdb->escape( stripslashes( $_POST['new_form_set'] ) );
|
1264 |
$checkout_sets = get_option( 'wpsc_checkout_form_sets' );
|
1265 |
-
$checkout_sets[] = $new_form_set;
|
1266 |
update_option( 'wpsc_checkout_form_sets', $checkout_sets );
|
1267 |
}
|
1268 |
|
@@ -1280,16 +1277,20 @@ function wpsc_checkout_settings() {
|
|
1280 |
}
|
1281 |
|
1282 |
$options = serialize( $options );
|
1283 |
-
$
|
1284 |
-
|
|
|
|
|
|
|
|
|
|
|
1285 |
}
|
1286 |
}
|
1287 |
|
1288 |
|
1289 |
if ( $_POST['form_name'] != null ) {
|
1290 |
foreach ( $_POST['form_name'] as $form_id => $form_name ) {
|
1291 |
-
$
|
1292 |
-
$form_type = $wpdb->escape( $_POST['form_type'][$form_id] );
|
1293 |
$form_mandatory = 0;
|
1294 |
if ( isset( $_POST['form_mandatory'][$form_id] ) && ($_POST['form_mandatory'][$form_id] == 1) ) {
|
1295 |
$form_mandatory = 1;
|
@@ -1302,7 +1303,19 @@ function wpsc_checkout_settings() {
|
|
1302 |
if ( $_POST['unique_names'][$form_id] != '-1' ) {
|
1303 |
$unique_name = $_POST['unique_names'][$form_id];
|
1304 |
}
|
1305 |
-
$wpdb->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1306 |
}
|
1307 |
}
|
1308 |
|
@@ -1329,7 +1342,21 @@ function wpsc_checkout_settings() {
|
|
1329 |
$max_order_sql = $wpdb->get_results( $max_order_sql, ARRAY_A );
|
1330 |
$order_number = $max_order_sql[0]['checkout_order'] + 1;
|
1331 |
}
|
1332 |
-
$wpdb->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1333 |
$added++;
|
1334 |
}
|
1335 |
}
|
989 |
$changes_made = false;
|
990 |
foreach ( $wpsc_pageurl_option as $option_key => $page_string ) {
|
991 |
$post_id = $wpdb->get_var( "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` IN('page','post') AND `post_content` LIKE '%$page_string%' LIMIT 1" );
|
992 |
+
if ( ! $post_id )
|
993 |
+
continue;
|
994 |
$the_new_link = _get_page_link( $post_id );
|
995 |
if ( stristr( get_option( $option_key ), "https://" ) ) {
|
996 |
$the_new_link = str_replace( 'http://', "https://", $the_new_link );
|
1255 |
function wpsc_checkout_settings() {
|
1256 |
global $wpdb;
|
1257 |
$wpdb->show_errors = true;
|
1258 |
+
$filter = isset( $_POST['wpsc_form_set'] ) ? $_POST['wpsc_form_set'] : 0;
|
|
|
|
|
|
|
|
|
1259 |
|
1260 |
if ( $_POST['new_form_set'] != null ) {
|
|
|
1261 |
$checkout_sets = get_option( 'wpsc_checkout_form_sets' );
|
1262 |
+
$checkout_sets[] = $_POST['new_form_set'];
|
1263 |
update_option( 'wpsc_checkout_form_sets', $checkout_sets );
|
1264 |
}
|
1265 |
|
1277 |
}
|
1278 |
|
1279 |
$options = serialize( $options );
|
1280 |
+
$wpdb->update(
|
1281 |
+
WPSC_TABLE_CHECKOUT_FORMS,
|
1282 |
+
array( 'options' => $options ),
|
1283 |
+
array( 'id' => $form_id ),
|
1284 |
+
'%s',
|
1285 |
+
'%d'
|
1286 |
+
);
|
1287 |
}
|
1288 |
}
|
1289 |
|
1290 |
|
1291 |
if ( $_POST['form_name'] != null ) {
|
1292 |
foreach ( $_POST['form_name'] as $form_id => $form_name ) {
|
1293 |
+
$form_type = $_POST['form_type'][$form_id];
|
|
|
1294 |
$form_mandatory = 0;
|
1295 |
if ( isset( $_POST['form_mandatory'][$form_id] ) && ($_POST['form_mandatory'][$form_id] == 1) ) {
|
1296 |
$form_mandatory = 1;
|
1303 |
if ( $_POST['unique_names'][$form_id] != '-1' ) {
|
1304 |
$unique_name = $_POST['unique_names'][$form_id];
|
1305 |
}
|
1306 |
+
$wpdb->update(
|
1307 |
+
WPSC_TABLE_CHECKOUT_FORMS,
|
1308 |
+
array(
|
1309 |
+
'name' => $form_name,
|
1310 |
+
'type' => $form_type,
|
1311 |
+
'mandatory' => $form_mandatory,
|
1312 |
+
'display_log' => $form_display_log,
|
1313 |
+
'unique_name' => $unique_name,
|
1314 |
+
),
|
1315 |
+
array( 'id' => $form_id ),
|
1316 |
+
'%s',
|
1317 |
+
'%d'
|
1318 |
+
);
|
1319 |
}
|
1320 |
}
|
1321 |
|
1342 |
$max_order_sql = $wpdb->get_results( $max_order_sql, ARRAY_A );
|
1343 |
$order_number = $max_order_sql[0]['checkout_order'] + 1;
|
1344 |
}
|
1345 |
+
$wpdb->insert(
|
1346 |
+
WPSC_TABLE_CHECKOUT_FORMS,
|
1347 |
+
array(
|
1348 |
+
'name' => $form_name,
|
1349 |
+
'type' => $form_type,
|
1350 |
+
'mandatory' => $form_mandatory,
|
1351 |
+
'display_log' => $form_display_log,
|
1352 |
+
'default' => '',
|
1353 |
+
'active' => '1',
|
1354 |
+
'checkout_order' => $order_number,
|
1355 |
+
'unique_name' => $form_unique_name,
|
1356 |
+
'checkout_set' => $filter,
|
1357 |
+
),
|
1358 |
+
array( '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%s' )
|
1359 |
+
);
|
1360 |
$added++;
|
1361 |
}
|
1362 |
}
|
wpsc-admin/display-update.page.php
CHANGED
@@ -23,14 +23,12 @@ if ( 0 == count( get_option( 'wpsc_product_category_children' ) ) ) {
|
|
23 |
_get_term_hierarchy( 'wpsc_product_category_children' );
|
24 |
}
|
25 |
|
|
|
|
|
26 |
// If database is already updated, then no need to update
|
27 |
-
if ( get_option( '
|
28 |
$show_update_page = 0;
|
29 |
-
}
|
30 |
-
|
31 |
-
// Check to see if there are any products.
|
32 |
-
// if they don't have any, they don't need to update
|
33 |
-
if ( get_option( 'wpsc_version' ) < 3.8 || !get_option( 'wpsc_version' ) ) {
|
34 |
|
35 |
$product_count = $wpdb->get_var( "SELECT COUNT(*) FROM " . WPSC_TABLE_PRODUCT_LIST );
|
36 |
|
@@ -40,7 +38,7 @@ if ( get_option( 'wpsc_version' ) < 3.8 || !get_option( 'wpsc_version' ) ) {
|
|
40 |
echo "<div id='wpsc-warning' class='error fade'><p><strong>" . __( 'WP e-Commerce is almost ready.', 'wpsc' ) . "</strong> " . sprintf( __( 'You must <a href="%1$s">update your database</a> to import all of your products.', 'wpsc' ), "admin.php?page=wpsc-update") . "</p></div>";
|
41 |
}
|
42 |
|
43 |
-
if ( isset( $_GET['page'] )
|
44 |
add_action( 'admin_notices', 'wpsc_display_update_notice' );
|
45 |
|
46 |
// There weren't any products, so mark the update as complete
|
@@ -49,6 +47,16 @@ if ( get_option( 'wpsc_version' ) < 3.8 || !get_option( 'wpsc_version' ) ) {
|
|
49 |
}
|
50 |
}
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
function wpsc_display_update_page() { ?>
|
53 |
|
54 |
<div class="wrap">
|
@@ -77,6 +85,7 @@ function wpsc_display_update_page() { ?>
|
|
77 |
}
|
78 |
update_option('wpsc_version', 3.8);
|
79 |
update_option('wpsc_hide_update', true);
|
|
|
80 |
else:
|
81 |
|
82 |
|
23 |
_get_term_hierarchy( 'wpsc_product_category_children' );
|
24 |
}
|
25 |
|
26 |
+
$wpsc_version = get_option( 'wpsc_version', '0' );
|
27 |
+
|
28 |
// If database is already updated, then no need to update
|
29 |
+
if ( ! get_option( 'wpsc_needs_update', false ) ) {
|
30 |
$show_update_page = 0;
|
31 |
+
} else {
|
|
|
|
|
|
|
|
|
32 |
|
33 |
$product_count = $wpdb->get_var( "SELECT COUNT(*) FROM " . WPSC_TABLE_PRODUCT_LIST );
|
34 |
|
38 |
echo "<div id='wpsc-warning' class='error fade'><p><strong>" . __( 'WP e-Commerce is almost ready.', 'wpsc' ) . "</strong> " . sprintf( __( 'You must <a href="%1$s">update your database</a> to import all of your products.', 'wpsc' ), "admin.php?page=wpsc-update") . "</p></div>";
|
39 |
}
|
40 |
|
41 |
+
if ( ! isset( $_GET['page'] ) || $_GET['page'] != 'wpsc-update' )
|
42 |
add_action( 'admin_notices', 'wpsc_display_update_notice' );
|
43 |
|
44 |
// There weren't any products, so mark the update as complete
|
47 |
}
|
48 |
}
|
49 |
|
50 |
+
if ( version_compare( PHP_VERSION, '5.0.0', '<' ) ) {
|
51 |
+
add_action( 'admin_notices', 'wpsc_display_php_version_notice' );
|
52 |
+
}
|
53 |
+
|
54 |
+
function wpsc_display_php_version_notice() {
|
55 |
+
?>
|
56 |
+
<div id='wpsc-warning' class='error fade'><p><?php printf( __( "You are using PHP %s. WP e-Commerce %s requires PHP 5.0 or above. Please contact your hosting provider for further assistance." ), PHP_VERSION, WPSC_VERSION ); ?></p></div>
|
57 |
+
<?php
|
58 |
+
}
|
59 |
+
|
60 |
function wpsc_display_update_page() { ?>
|
61 |
|
62 |
<div class="wrap">
|
85 |
}
|
86 |
update_option('wpsc_version', 3.8);
|
87 |
update_option('wpsc_hide_update', true);
|
88 |
+
update_option( 'wpsc_needs_update', false );
|
89 |
else:
|
90 |
|
91 |
|
wpsc-admin/includes/display-items-functions.php
CHANGED
@@ -1180,7 +1180,7 @@ function edit_multiple_image_gallery( $post ) {
|
|
1180 |
|
1181 |
function wpsc_save_quickedit_box( $post_id ) {
|
1182 |
global $current_screen;
|
1183 |
-
if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || $current_screen->id != 'edit-wpsc-product' )
|
1184 |
return;
|
1185 |
|
1186 |
$is_parent = ( bool )wpsc_product_has_children( $post_id );
|
1180 |
|
1181 |
function wpsc_save_quickedit_box( $post_id ) {
|
1182 |
global $current_screen;
|
1183 |
+
if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || $current_screen->id != 'edit-wpsc-product' || ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
1184 |
return;
|
1185 |
|
1186 |
$is_parent = ( bool )wpsc_product_has_children( $post_id );
|
wpsc-admin/includes/product-functions.php
CHANGED
@@ -222,6 +222,19 @@ add_filter( 'wp_insert_post_data','wpsc_pre_update', 99, 2 );
|
|
222 |
add_action( 'save_post', 'wpsc_admin_submit_product', 10, 2 );
|
223 |
add_action( 'admin_notices', 'wpsc_admin_submit_notices' );
|
224 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
function wpsc_admin_submit_notices() {
|
227 |
global $current_screen, $post;
|
222 |
add_action( 'save_post', 'wpsc_admin_submit_product', 10, 2 );
|
223 |
add_action( 'admin_notices', 'wpsc_admin_submit_notices' );
|
224 |
|
225 |
+
/**
|
226 |
+
* Remove category meta box from variation editor. This would disassociate variations
|
227 |
+
* with the default category. See #431 (http://code.google.com/p/wp-e-commerce/issues/detail?id=431)
|
228 |
+
*
|
229 |
+
*/
|
230 |
+
function wpsc_variation_remove_metaboxes() {
|
231 |
+
global $post;
|
232 |
+
if ( ! $post->post_parent )
|
233 |
+
return;
|
234 |
+
|
235 |
+
remove_meta_box( 'wpsc_product_categorydiv', 'wpsc-product', 'side' );
|
236 |
+
}
|
237 |
+
add_action( 'add_meta_boxes_wpsc-product', 'wpsc_variation_remove_metaboxes', 99 );
|
238 |
|
239 |
function wpsc_admin_submit_notices() {
|
240 |
global $current_screen, $post;
|
wpsc-admin/includes/settings-pages/presentation.php
CHANGED
@@ -698,6 +698,8 @@ function wpsc_options_presentation() {
|
|
698 |
} else {
|
699 |
$dis = "";
|
700 |
}
|
|
|
|
|
701 |
?>
|
702 |
<input type='radio' onclick='jQuery("#wpsc_advanced_search").show()' value='1' name='wpsc_options[show_search]' id='show_search1' <?php echo $show_search1; ?> /> <label for='show_search1'><?php _e( 'Yes', 'wpsc' ); ?></label>
|
703 |
<input type='radio' onclick='jQuery("#wpsc_advanced_search").hide()' value='0' name='wpsc_options[show_search]' id='show_search2' <?php echo $show_search2; ?> /> <label for='show_search2'><?php _e( 'No', 'wpsc' ); ?></label>
|
@@ -708,7 +710,10 @@ function wpsc_options_presentation() {
|
|
708 |
<?php _e( 'Show Advanced Search', 'wpsc' ); ?><br />
|
709 |
<input type='hidden' name='wpsc_options[show_live_search]' value='0' />
|
710 |
<input type='checkbox' name='wpsc_options[show_live_search]' id='show_live_search' <?php echo $show_live_search; ?> value='1' />
|
711 |
-
<?php _e( 'Use Live Search', 'wpsc' );
|
|
|
|
|
|
|
712 |
</div>
|
713 |
</td>
|
714 |
</tr>
|
698 |
} else {
|
699 |
$dis = "";
|
700 |
}
|
701 |
+
|
702 |
+
$embed_live_search_results = get_option( 'embed_live_search_results', '0' ) == '1' ? ' checked="checked"' : '';
|
703 |
?>
|
704 |
<input type='radio' onclick='jQuery("#wpsc_advanced_search").show()' value='1' name='wpsc_options[show_search]' id='show_search1' <?php echo $show_search1; ?> /> <label for='show_search1'><?php _e( 'Yes', 'wpsc' ); ?></label>
|
705 |
<input type='radio' onclick='jQuery("#wpsc_advanced_search").hide()' value='0' name='wpsc_options[show_search]' id='show_search2' <?php echo $show_search2; ?> /> <label for='show_search2'><?php _e( 'No', 'wpsc' ); ?></label>
|
710 |
<?php _e( 'Show Advanced Search', 'wpsc' ); ?><br />
|
711 |
<input type='hidden' name='wpsc_options[show_live_search]' value='0' />
|
712 |
<input type='checkbox' name='wpsc_options[show_live_search]' id='show_live_search' <?php echo $show_live_search; ?> value='1' />
|
713 |
+
<?php _e( 'Use Live Search', 'wpsc' ); ?><br />
|
714 |
+
<input type='hidden' name='wpsc_options[embed_live_search_results]' value='0' />
|
715 |
+
<input type='checkbox' name='wpsc_options[embed_live_search_results]' id='embed_live_search_results'<?php echo $embed_live_search_results; ?> value='1' />
|
716 |
+
<?php _e( 'Dynamically replace search results into product list' ); ?>
|
717 |
</div>
|
718 |
</td>
|
719 |
</tr>
|
wpsc-admin/includes/updating-functions.php
CHANGED
@@ -216,7 +216,7 @@ GROUP BY ".WPSC_TABLE_PRODUCT_LIST.".id", ARRAY_A);
|
|
216 |
|
217 |
$post_data['_wpsc_original_id'] = (int)$product['id'];
|
218 |
$post_data['_wpsc_price'] = (float)$product['price'];
|
219 |
-
$post_data['_wpsc_special_price'] = (float)$product['special_price'];
|
220 |
$post_data['_wpsc_stock'] = (float)$product['quantity'];
|
221 |
$post_data['_wpsc_is_donation'] = $product['donation'];
|
222 |
$post_data['_wpsc_sku'] = $sku;
|
216 |
|
217 |
$post_data['_wpsc_original_id'] = (int)$product['id'];
|
218 |
$post_data['_wpsc_price'] = (float)$product['price'];
|
219 |
+
$post_data['_wpsc_special_price'] = $post_data['_wpsc_price'] - (float)$product['special_price']; // special price get stored in a weird way in 3.7.x
|
220 |
$post_data['_wpsc_stock'] = (float)$product['quantity'];
|
221 |
$post_data['_wpsc_is_donation'] = $product['donation'];
|
222 |
$post_data['_wpsc_sku'] = $sku;
|
wpsc-core/js/wp-e-commerce.js
CHANGED
@@ -232,7 +232,7 @@ jQuery(document).ready(function () {
|
|
232 |
});
|
233 |
|
234 |
// Submit the product form using AJAX
|
235 |
-
jQuery("form.product_form").submit
|
236 |
// we cannot submit a file through AJAX, so this needs to return true to submit the form normally if a file formfield is present
|
237 |
file_upload_elements = jQuery.makeArray(jQuery('input[type=file]', jQuery(this)));
|
238 |
if(file_upload_elements.length > 0) {
|
232 |
});
|
233 |
|
234 |
// Submit the product form using AJAX
|
235 |
+
jQuery("form.product_form").live('submit', function() {
|
236 |
// we cannot submit a file through AJAX, so this needs to return true to submit the form normally if a file formfield is present
|
237 |
file_upload_elements = jQuery.makeArray(jQuery('input[type=file]', jQuery(this)));
|
238 |
if(file_upload_elements.length > 0) {
|
wpsc-core/wpsc-constants.php
CHANGED
@@ -26,9 +26,9 @@ function wpsc_core_constants() {
|
|
26 |
if(!defined('WPSC_URL'))
|
27 |
define( 'WPSC_URL', plugins_url( '', __FILE__ ) );
|
28 |
// Define Plugin version
|
29 |
-
define( 'WPSC_VERSION', '3.8' );
|
30 |
-
define( 'WPSC_MINOR_VERSION', '
|
31 |
-
define( 'WPSC_PRESENTABLE_VERSION', '3.8' );
|
32 |
|
33 |
// Define Debug Variables for developers
|
34 |
define( 'WPSC_DEBUG', false );
|
@@ -309,4 +309,4 @@ function wpsc_core_setup_globals() {
|
|
309 |
if ( !empty( $selected_theme ) && file_exists( WPSC_THEMES_PATH . $selected_theme . '/' . $selected_theme . '.php' ) )
|
310 |
include_once( WPSC_THEMES_PATH . $selected_theme . '/' . $selected_theme . '.php' );
|
311 |
|
312 |
-
}
|
26 |
if(!defined('WPSC_URL'))
|
27 |
define( 'WPSC_URL', plugins_url( '', __FILE__ ) );
|
28 |
// Define Plugin version
|
29 |
+
define( 'WPSC_VERSION', '3.8.1' );
|
30 |
+
define( 'WPSC_MINOR_VERSION', '372308' );
|
31 |
+
define( 'WPSC_PRESENTABLE_VERSION', '3.8.1' );
|
32 |
|
33 |
// Define Debug Variables for developers
|
34 |
define( 'WPSC_DEBUG', false );
|
309 |
if ( !empty( $selected_theme ) && file_exists( WPSC_THEMES_PATH . $selected_theme . '/' . $selected_theme . '.php' ) )
|
310 |
include_once( WPSC_THEMES_PATH . $selected_theme . '/' . $selected_theme . '.php' );
|
311 |
|
312 |
+
}
|
wpsc-core/wpsc-deprecated.php
CHANGED
@@ -438,4 +438,41 @@ function wpsc_is_admin() {
|
|
438 |
|
439 |
return false;
|
440 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
}
|
438 |
|
439 |
return false;
|
440 |
|
441 |
+
}
|
442 |
+
|
443 |
+
/**
|
444 |
+
* used in legacy theme templates
|
445 |
+
* see http://plugins.svn.wordpress.org/wp-e-commerce/tags/3.7.8/themes/default/category_widget.php
|
446 |
+
*
|
447 |
+
* @return void
|
448 |
+
*/
|
449 |
+
function wpsc_print_product_list() {
|
450 |
+
_deprecated_function( __FUNCTION__, '3.8' );
|
451 |
+
}
|
452 |
+
|
453 |
+
/**
|
454 |
+
* count total products on a page
|
455 |
+
* see http://plugins.svn.wordpress.org/wp-e-commerce/tags/3.7.8/themes/iShop/products_page.php
|
456 |
+
*
|
457 |
+
* @return int
|
458 |
+
*/
|
459 |
+
function wpsc_total_product_count() {
|
460 |
+
_deprecated_function( __FUNCTION__, '3.8' );
|
461 |
+
return wpsc_product_count();
|
462 |
+
}
|
463 |
+
|
464 |
+
/**
|
465 |
+
* WPSC_Query() is deprecated in favor of WP_Query()
|
466 |
+
* Note that although we fall back to WP_Query() when WPSC_Query() is used,
|
467 |
+
* the results might not be what you expect.
|
468 |
+
*
|
469 |
+
*/
|
470 |
+
class WPSC_Query extends WP_Query
|
471 |
+
{
|
472 |
+
function WPSC_Query( $query ) {
|
473 |
+
$query = wp_parse_args( $query );
|
474 |
+
$query['post_type'] = 'wpsc-product';
|
475 |
+
_deprecated_function( __FUNCTION__, '3.8', 'WP_Query class' );
|
476 |
+
parent::WP_Query( $query );
|
477 |
+
}
|
478 |
}
|
wpsc-core/wpsc-functions.php
CHANGED
@@ -542,7 +542,11 @@ function wpsc_add_meta_table_where($where){
|
|
542 |
function wpsc_add_meta_table($join){
|
543 |
global $wpdb;
|
544 |
remove_filter( 'posts_join', 'wpsc_add_meta_table' );
|
545 |
-
|
|
|
|
|
|
|
|
|
546 |
}
|
547 |
|
548 |
/**
|
@@ -1185,4 +1189,4 @@ if ( is_ssl() ) {
|
|
1185 |
add_filter( 'option_transact_url', 'wpsc_add_https_to_page_url_options' );
|
1186 |
add_filter( 'option_user_account_url', 'wpsc_add_https_to_page_url_options' );
|
1187 |
}
|
1188 |
-
?>
|
542 |
function wpsc_add_meta_table($join){
|
543 |
global $wpdb;
|
544 |
remove_filter( 'posts_join', 'wpsc_add_meta_table' );
|
545 |
+
if(strpos($join, "INNER JOIN ON (".$wpdb->posts.".ID = ".$wpdb->postmeta.".post_id)") !== false){
|
546 |
+
return ' JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts. '.ID = ' . $wpdb->postmeta . '.post_id';
|
547 |
+
}else{
|
548 |
+
return $join;
|
549 |
+
}
|
550 |
}
|
551 |
|
552 |
/**
|
1189 |
add_filter( 'option_transact_url', 'wpsc_add_https_to_page_url_options' );
|
1190 |
add_filter( 'option_user_account_url', 'wpsc_add_https_to_page_url_options' );
|
1191 |
}
|
1192 |
+
?>
|
wpsc-core/wpsc-installer.php
CHANGED
@@ -9,8 +9,20 @@ function wpsc_auto_update() {
|
|
9 |
wpsc_create_upload_directories();
|
10 |
wpsc_product_files_htaccess();
|
11 |
wpsc_check_and_copy_files();
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
update_option( 'wpsc_version', WPSC_VERSION );
|
15 |
update_option( 'wpsc_minor_version', WPSC_MINOR_VERSION );
|
16 |
}
|
@@ -35,8 +47,6 @@ function wpsc_install() {
|
|
35 |
if ( !$first_install )
|
36 |
wpsc_regenerate_thumbnails();
|
37 |
|
38 |
-
add_option( 'wpsc_version', WPSC_VERSION, '', 'yes' );
|
39 |
-
|
40 |
// run the create or update code here.
|
41 |
wpsc_create_or_update_tables();
|
42 |
wpsc_create_upload_directories();
|
@@ -48,10 +58,23 @@ function wpsc_install() {
|
|
48 |
wp_schedule_event( time(), 'daily', 'wpsc_daily_cron_tasks' );
|
49 |
|
50 |
// All code to add new database tables and columns must be above here
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
update_option( 'wpsc_version', WPSC_VERSION );
|
53 |
update_option( 'wpsc_minor_version', WPSC_MINOR_VERSION );
|
54 |
}
|
|
|
55 |
if('' == get_option('show_subcatsprods_in_cat'))
|
56 |
update_option('show_subcatsprods_in_cat',0);
|
57 |
|
9 |
wpsc_create_upload_directories();
|
10 |
wpsc_product_files_htaccess();
|
11 |
wpsc_check_and_copy_files();
|
12 |
+
|
13 |
+
$wpsc_version = get_option( 'wpsc_version' );
|
14 |
+
$wpsc_minor_version = get_option( 'wspc_minor_version' );
|
15 |
+
|
16 |
+
if ( $wpsc_version === false )
|
17 |
+
add_option( 'wpsc_version', WPSC_VERSION, '', 'yes' );
|
18 |
+
|
19 |
+
if ( $wpsc_minor_version === false )
|
20 |
+
add_option( 'wpsc_minor_version', WPSC_MINOR_VERSION, '', 'yes' );
|
21 |
+
|
22 |
+
if ( version_compare( $wpsc_version, WPSC_VERSION, '<' ) || version_compare( $wpsc_minor_vesion, WPSC_MINOR_VERSION, '<' ) ) {
|
23 |
+
if ( version_compare( WPSC_VERSION, '3.8', '=' ) )
|
24 |
+
add_option( 'wpsc_needs_update', true, '', 'no' );
|
25 |
+
update_option( 'wpsc_needs_update', true );
|
26 |
update_option( 'wpsc_version', WPSC_VERSION );
|
27 |
update_option( 'wpsc_minor_version', WPSC_MINOR_VERSION );
|
28 |
}
|
47 |
if ( !$first_install )
|
48 |
wpsc_regenerate_thumbnails();
|
49 |
|
|
|
|
|
50 |
// run the create or update code here.
|
51 |
wpsc_create_or_update_tables();
|
52 |
wpsc_create_upload_directories();
|
58 |
wp_schedule_event( time(), 'daily', 'wpsc_daily_cron_tasks' );
|
59 |
|
60 |
// All code to add new database tables and columns must be above here
|
61 |
+
$wpsc_version = get_option( 'wpsc_version' );
|
62 |
+
$wpsc_minor_version = get_option( 'wspc_minor_version' );
|
63 |
+
|
64 |
+
if ( $wpsc_version === false )
|
65 |
+
add_option( 'wpsc_version', WPSC_VERSION, '', 'yes' );
|
66 |
+
|
67 |
+
if ( $wpsc_minor_version === false )
|
68 |
+
add_option( 'wpsc_minor_version', WPSC_MINOR_VERSION, '', 'yes' );
|
69 |
+
|
70 |
+
if ( version_compare( $wpsc_version, WPSC_VERSION, '<' ) || version_compare( $wpsc_minor_vesion, WPSC_MINOR_VERSION, '<' ) ) {
|
71 |
+
if ( version_compare( WPSC_VERSION, '3.8', '=' ) )
|
72 |
+
add_option( 'wpsc_needs_update', true, '', 'no' );
|
73 |
+
update_option( 'wpsc_needs_update', true );
|
74 |
update_option( 'wpsc_version', WPSC_VERSION );
|
75 |
update_option( 'wpsc_minor_version', WPSC_MINOR_VERSION );
|
76 |
}
|
77 |
+
|
78 |
if('' == get_option('show_subcatsprods_in_cat'))
|
79 |
update_option('show_subcatsprods_in_cat',0);
|
80 |
|
wpsc-includes/ajax.functions.php
CHANGED
@@ -35,8 +35,15 @@ function wpsc_add_to_cart() {
|
|
35 |
$default_parameters['meta'] = null;
|
36 |
|
37 |
$provided_parameters = array();
|
|
|
38 |
/// sanitise submitted values
|
39 |
$product_id = (int)$_POST['product_id'];
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
if(isset($_POST['variation'])){
|
41 |
foreach ( (array)$_POST['variation'] as $key => $variation )
|
42 |
$provided_parameters['variation_values'][(int)$key] = (int)$variation;
|
35 |
$default_parameters['meta'] = null;
|
36 |
|
37 |
$provided_parameters = array();
|
38 |
+
|
39 |
/// sanitise submitted values
|
40 |
$product_id = (int)$_POST['product_id'];
|
41 |
+
|
42 |
+
// compatibility with older themes
|
43 |
+
if ( is_array( $_POST['wpsc_quantity_update'] ) ) {
|
44 |
+
$_POST['wpsc_quantity_update'] = $_POST['wpsc_quantity_update'][$product_id];
|
45 |
+
}
|
46 |
+
|
47 |
if(isset($_POST['variation'])){
|
48 |
foreach ( (array)$_POST['variation'] as $key => $variation )
|
49 |
$provided_parameters['variation_values'][(int)$key] = (int)$variation;
|
wpsc-includes/breadcrumbs.class.php
CHANGED
@@ -104,7 +104,7 @@ function wpsc_output_breadcrumbs($options = Array()) {
|
|
104 |
if(wpsc_breadcrumb_url()) {
|
105 |
echo '<a class="wpsc-crumb" id="wpsc-crumb-'.wpsc_breadcrumb_slug().'" href="'.wpsc_breadcrumb_url().'">'.wpsc_breadcrumb_name().'</a>';
|
106 |
} else {
|
107 |
-
echo wpsc_breadcrumb_name();
|
108 |
}
|
109 |
echo isset($options['after-crumb']) ? $options['after-crumb'] : '';
|
110 |
}
|
104 |
if(wpsc_breadcrumb_url()) {
|
105 |
echo '<a class="wpsc-crumb" id="wpsc-crumb-'.wpsc_breadcrumb_slug().'" href="'.wpsc_breadcrumb_url().'">'.wpsc_breadcrumb_name().'</a>';
|
106 |
} else {
|
107 |
+
echo '<span class="wpsc-crumb" id="wpsc-crumb-'.wpsc_breadcrumb_slug().'">' . wpsc_breadcrumb_name() . '<span>';
|
108 |
}
|
109 |
echo isset($options['after-crumb']) ? $options['after-crumb'] : '';
|
110 |
}
|
wpsc-includes/display.functions.php
CHANGED
@@ -147,6 +147,7 @@ add_action( 'wpsc_theme_footer', 'wpsc_fancy_notifications' );
|
|
147 |
|
148 |
function fancy_notification_content( $cart_messages ) {
|
149 |
$siteurl = get_option( 'siteurl' );
|
|
|
150 |
foreach ( (array)$cart_messages as $cart_message ) {
|
151 |
$output .= "<span>" . $cart_message . "</span><br />";
|
152 |
}
|
147 |
|
148 |
function fancy_notification_content( $cart_messages ) {
|
149 |
$siteurl = get_option( 'siteurl' );
|
150 |
+
$output = '';
|
151 |
foreach ( (array)$cart_messages as $cart_message ) {
|
152 |
$output .= "<span>" . $cart_message . "</span><br />";
|
153 |
}
|
wpsc-includes/product-template.php
CHANGED
@@ -455,7 +455,7 @@ function wpsc_display_categories() {
|
|
455 |
$category_id = $_GET['products'];
|
456 |
|
457 |
// if we have no categories, and no search, show the group list
|
458 |
-
if ( is_numeric( get_option( 'wpsc_default_category' ) ) || (isset( $product_id ) && is_numeric( $product_id ))
|
459 |
$output = true;
|
460 |
if ( (get_option( 'wpsc_default_category' ) == 'all+list'))
|
461 |
$output = true;
|
455 |
$category_id = $_GET['products'];
|
456 |
|
457 |
// if we have no categories, and no search, show the group list
|
458 |
+
if ( is_numeric( get_option( 'wpsc_default_category' ) ) || (isset( $product_id ) && is_numeric( $product_id )) )
|
459 |
$output = true;
|
460 |
if ( (get_option( 'wpsc_default_category' ) == 'all+list'))
|
461 |
$output = true;
|
wpsc-includes/theming.class.php
CHANGED
@@ -41,7 +41,7 @@ class wpsc_theming {
|
|
41 |
check_admin_referer( 'wpsc_copy_themes' );
|
42 |
|
43 |
$this->active_wp_style = trailingslashit( get_stylesheet_directory() );
|
44 |
-
$this->templates_to_move = $_POST['wpsc_templates_to_port'];
|
45 |
$this->list_of_templates = wpsc_list_product_templates( $this->active_wp_style );
|
46 |
$this->theme_file_prefix = 'wpsc-';
|
47 |
|
41 |
check_admin_referer( 'wpsc_copy_themes' );
|
42 |
|
43 |
$this->active_wp_style = trailingslashit( get_stylesheet_directory() );
|
44 |
+
$this->templates_to_move = isset( $_POST['wpsc_templates_to_port'] ) ? $_POST['wpsc_templates_to_port'] : array();
|
45 |
$this->list_of_templates = wpsc_list_product_templates( $this->active_wp_style );
|
46 |
$this->theme_file_prefix = 'wpsc-';
|
47 |
|
wpsc-theme/wpsc-products_page.php
CHANGED
@@ -60,7 +60,7 @@ global $wp_query;
|
|
60 |
<?php endif; ?>
|
61 |
|
62 |
|
63 |
-
|
64 |
<?php /** start the product loop here */?>
|
65 |
<?php while (wpsc_have_products()) : wpsc_the_product(); ?>
|
66 |
|
@@ -226,6 +226,7 @@ global $wp_query;
|
|
226 |
|
227 |
<?php endwhile; ?>
|
228 |
<?php /** end the product loop here */?>
|
|
|
229 |
<?php if(wpsc_product_count() == 0):?>
|
230 |
<h3><?php _e('There are no products in this group.', 'wpsc'); ?></h3>
|
231 |
<?php endif ; ?>
|
60 |
<?php endif; ?>
|
61 |
|
62 |
|
63 |
+
<div class="wpsc_default_product_list">
|
64 |
<?php /** start the product loop here */?>
|
65 |
<?php while (wpsc_have_products()) : wpsc_the_product(); ?>
|
66 |
|
226 |
|
227 |
<?php endwhile; ?>
|
228 |
<?php /** end the product loop here */?>
|
229 |
+
</div>
|
230 |
<?php if(wpsc_product_count() == 0):?>
|
231 |
<h3><?php _e('There are no products in this group.', 'wpsc'); ?></h3>
|
232 |
<?php endif ; ?>
|
wpsc-updates/updating_tasks.php
CHANGED
@@ -65,40 +65,6 @@ if($wpdb->get_results("SHOW FULL COLUMNS FROM `".WPSC_TABLE_REGION_TAX."` LIKE '
|
|
65 |
}
|
66 |
|
67 |
|
68 |
-
|
69 |
-
// here is the code to update the payment gateway options.
|
70 |
-
$selected_gateways = array();
|
71 |
-
$current_gateway = get_option('payment_gateway');
|
72 |
-
$selected_gateways = get_option('custom_gateway_options');
|
73 |
-
if($current_gateway == '') {
|
74 |
-
// set the gateway to Manual Payment if it is not set.
|
75 |
-
$current_gateway = 'testmode';
|
76 |
-
}
|
77 |
-
if(get_option('payment_method') != null) {
|
78 |
-
switch(get_option('payment_method')) {
|
79 |
-
case 2:
|
80 |
-
// mode 2 is credit card and manual payment / test mode
|
81 |
-
if($current_gateway == 'testmode') {
|
82 |
-
$current_gateway = 'paypal_multiple';
|
83 |
-
}
|
84 |
-
$selected_gateways[] = 'testmode';
|
85 |
-
$selected_gateways[] = $current_gateway;
|
86 |
-
break;
|
87 |
-
|
88 |
-
case 3;
|
89 |
-
// mode 3 is manual payment / test mode
|
90 |
-
$current_gateway = 'testmode';
|
91 |
-
case 1:
|
92 |
-
// mode 1 is whatever gateway is currently selected.
|
93 |
-
default:
|
94 |
-
$selected_gateways[] = $current_gateway;
|
95 |
-
break;
|
96 |
-
}
|
97 |
-
update_option('custom_gateway_options', $selected_gateways);
|
98 |
-
update_option('payment_method', null);
|
99 |
-
}
|
100 |
-
|
101 |
-
|
102 |
// here is the code to update the payment gateway options.
|
103 |
$selected_gateways = array();
|
104 |
$current_gateway = get_option('payment_gateway');
|
65 |
}
|
66 |
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
// here is the code to update the payment gateway options.
|
69 |
$selected_gateways = array();
|
70 |
$current_gateway = get_option('payment_gateway');
|