Version Description
Download this release
Release Info
Developer | valentinas |
Plugin | WP eCommerce |
Version | 3.8.RC.3 |
Comparing to | |
See all releases |
Code changes from version 3.8.RC.2 to 3.8.RC.3
- wp-shopping-cart.php +1 -1
- wpsc-admin/admin-form-functions.php +2 -1
- wpsc-admin/admin.php +18 -3
- wpsc-admin/ajax-and-init.php +6 -6
- wpsc-admin/css/settingspage.css +4 -0
- wpsc-admin/display-update.page.php +5 -1
- wpsc-admin/includes/display-items-functions.php +2 -2
- wpsc-admin/includes/settings-pages/import.php +6 -9
- wpsc-admin/includes/updating-functions.php +34 -7
- wpsc-admin/js/admin.js +0 -7
- wpsc-core/js/product_rater.css +1 -1
- wpsc-core/js/wp-e-commerce.js +80 -11
- wpsc-core/wpsc-constants.php +1 -1
- wpsc-core/wpsc-functions.php +1 -1
- wpsc-includes/ajax.functions.php +22 -9
- wpsc-includes/cart.class.php +1 -1
- wpsc-includes/category.functions.php +3 -0
- wpsc-includes/processing.functions.php +1 -1
- wpsc-includes/product-template.php +6 -20
- wpsc-includes/theme.functions.php +11 -7
- wpsc-merchants/GoogleCheckout-XML.php +0 -1
- wpsc-taxes/controllers/taxes_controller.class.php +8 -4
- wpsc-theme/functions/wpsc-user_log_functions.php +14 -5
- wpsc-theme/wpsc-products_page.php +1 -6
- wpsc-theme/wpsc-shopping_cart_page.php +3 -4
wp-shopping-cart.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: WP e-Commerce
|
5 |
Plugin URI: http://getshopped.org/
|
6 |
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://getshopped.org/resources/docs/" target="_blank">Documentation</a>
|
7 |
-
Version: 3.8.RC.
|
8 |
Author: Instinct Entertainment
|
9 |
Author URI: http://getshopped.org/
|
10 |
*/
|
4 |
Plugin Name: WP e-Commerce
|
5 |
Plugin URI: http://getshopped.org/
|
6 |
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://getshopped.org/resources/docs/" target="_blank">Documentation</a>
|
7 |
+
Version: 3.8.RC.3
|
8 |
Author: Instinct Entertainment
|
9 |
Author URI: http://getshopped.org/
|
10 |
*/
|
wpsc-admin/admin-form-functions.php
CHANGED
@@ -358,7 +358,8 @@ function wpsc_packing_slip($purchase_id) {
|
|
358 |
echo "</table>\n\r";
|
359 |
|
360 |
|
361 |
-
|
|
|
362 |
|
363 |
echo "<table class='packing_slip'>";
|
364 |
|
358 |
echo "</table>\n\r";
|
359 |
|
360 |
|
361 |
+
do_action ('wpsc_packing_slip_extra_info',$purchase_id);
|
362 |
+
|
363 |
|
364 |
echo "<table class='packing_slip'>";
|
365 |
|
wpsc-admin/admin.php
CHANGED
@@ -41,8 +41,11 @@ if ( !get_option( 'wpsc_checkout_form_sets' ) ) {
|
|
41 |
* @return $vars (array) - modified query arguments
|
42 |
*/
|
43 |
function wpsc_query_vars_product_list($vars){
|
|
|
|
|
|
|
44 |
$vars['posts_per_archive_page'] = 0;
|
45 |
-
if(is_admin() && isset($vars['
|
46 |
$vars['orderby'] = 'date';
|
47 |
$vars['order'] = 'desc';
|
48 |
$vars['nopaging'] = false;
|
@@ -54,6 +57,7 @@ function wpsc_query_vars_product_list($vars){
|
|
54 |
$vars['order'] = 'desc';
|
55 |
$vars['nopaging'] = true;
|
56 |
}
|
|
|
57 |
return $vars;
|
58 |
}
|
59 |
|
@@ -559,8 +563,8 @@ add_action( 'wpsc_admin_pre_activity', 'wpsc_admin_latest_activity' );
|
|
559 |
|
560 |
function wpsc_dashboard_widget_setup() {
|
561 |
global $current_user;
|
562 |
-
|
563 |
-
if ( is_admin() ) {
|
564 |
$version_identifier = WPSC_VERSION . "." . WPSC_MINOR_VERSION;
|
565 |
// Enqueue the styles and scripts necessary
|
566 |
wp_enqueue_style( 'wp-e-commerce-admin', WPSC_URL . '/wpsc-admin/css/admin.css', false, $version_identifier, 'all' );
|
@@ -908,6 +912,17 @@ function wpsc_add_meta_boxes(){
|
|
908 |
add_meta_box( 'dashboard_right_now', __('Current Month', 'wpsc'), 'wpsc_right_now', 'dashboard_page_wpsc-sales-logs', 'top' );
|
909 |
}
|
910 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
911 |
add_action( 'permalink_structure_changed' , 'wpsc_update_permalinks' );
|
912 |
add_action( 'get_sample_permalink_html' , 'wpsc_update_permalinks' );
|
913 |
add_action( 'wp_ajax_category_sort_order', 'wpsc_ajax_set_category_order' );
|
41 |
* @return $vars (array) - modified query arguments
|
42 |
*/
|
43 |
function wpsc_query_vars_product_list($vars){
|
44 |
+
global $current_screen;
|
45 |
+
if('wpsc-product' != $current_screen->post_type) return $vars;
|
46 |
+
|
47 |
$vars['posts_per_archive_page'] = 0;
|
48 |
+
if(is_admin() && isset($vars['orderby'])){
|
49 |
$vars['orderby'] = 'date';
|
50 |
$vars['order'] = 'desc';
|
51 |
$vars['nopaging'] = false;
|
57 |
$vars['order'] = 'desc';
|
58 |
$vars['nopaging'] = true;
|
59 |
}
|
60 |
+
|
61 |
return $vars;
|
62 |
}
|
63 |
|
563 |
|
564 |
function wpsc_dashboard_widget_setup() {
|
565 |
global $current_user;
|
566 |
+
|
567 |
+
if ( is_admin() && current_user_can( 'manage_options' ) ) {
|
568 |
$version_identifier = WPSC_VERSION . "." . WPSC_MINOR_VERSION;
|
569 |
// Enqueue the styles and scripts necessary
|
570 |
wp_enqueue_style( 'wp-e-commerce-admin', WPSC_URL . '/wpsc-admin/css/admin.css', false, $version_identifier, 'all' );
|
912 |
add_meta_box( 'dashboard_right_now', __('Current Month', 'wpsc'), 'wpsc_right_now', 'dashboard_page_wpsc-sales-logs', 'top' );
|
913 |
}
|
914 |
|
915 |
+
function wpsc_check_permalink_notice(){
|
916 |
+
|
917 |
+
?>
|
918 |
+
<div id="notice" class="error fade"><p>
|
919 |
+
<?php printf( __( 'Due to a problem in WordPress Permalinks and Custom Post Types, WP e-Commerce encourages you to refresh your permalinks a second time. (for a more geeky explanation visit <a href="%s">trac</a>)' , 'wpsc' ), 'http://core.trac.wordpress.org/ticket/16736' ); ?>
|
920 |
+
</p></div>
|
921 |
+
<?php
|
922 |
+
|
923 |
+
}
|
924 |
+
|
925 |
+
add_action( 'permalink_structure_changed' , 'wpsc_check_permalink_notice' );
|
926 |
add_action( 'permalink_structure_changed' , 'wpsc_update_permalinks' );
|
927 |
add_action( 'get_sample_permalink_html' , 'wpsc_update_permalinks' );
|
928 |
add_action( 'wp_ajax_category_sort_order', 'wpsc_ajax_set_category_order' );
|
wpsc-admin/ajax-and-init.php
CHANGED
@@ -434,11 +434,11 @@ function wpsc_admin_ajax() {
|
|
434 |
if ( ($_REQUEST['log_state'] == "true") && is_numeric( $_POST['id'] ) && is_numeric( $_POST['value'] ) ) {
|
435 |
$newvalue = $_POST['value'];
|
436 |
if ( $_REQUEST['suspend'] == 'true' ) {
|
437 |
-
if ( $_REQUEST['value'] == 1 )
|
438 |
-
|
439 |
-
|
440 |
wpsc_member_deactivate_subscriptions( $_POST['id'] );
|
441 |
-
|
442 |
exit();
|
443 |
} else {
|
444 |
|
@@ -1651,9 +1651,9 @@ function variation_price_field( $variation ) {
|
|
1651 |
<span class="description"><?php _e( 'You can list a default price here for this variation. You can list a regular price (18.99), differential price (+1.99 / -2) or even a percentage-based price (+50% / -25%).', 'wpsc' ); ?></span>
|
1652 |
</div>
|
1653 |
<script type="text/javascript">
|
1654 |
-
jQuery('
|
1655 |
jQuery('#parent').mousedown(function(){
|
1656 |
-
jQuery('
|
1657 |
});
|
1658 |
</script>
|
1659 |
<?php
|
434 |
if ( ($_REQUEST['log_state'] == "true") && is_numeric( $_POST['id'] ) && is_numeric( $_POST['value'] ) ) {
|
435 |
$newvalue = $_POST['value'];
|
436 |
if ( $_REQUEST['suspend'] == 'true' ) {
|
437 |
+
if ( $_REQUEST['value'] == 1 && function_exists('wpsc_member_dedeactivate_subscriptions'))
|
438 |
+
wpsc_member_dedeactivate_subscriptions( $_POST['id'] );
|
439 |
+
elseif( function_exists('wpsc_member_deactivate_subscriptions'))
|
440 |
wpsc_member_deactivate_subscriptions( $_POST['id'] );
|
441 |
+
|
442 |
exit();
|
443 |
} else {
|
444 |
|
1651 |
<span class="description"><?php _e( 'You can list a default price here for this variation. You can list a regular price (18.99), differential price (+1.99 / -2) or even a percentage-based price (+50% / -25%).', 'wpsc' ); ?></span>
|
1652 |
</div>
|
1653 |
<script type="text/javascript">
|
1654 |
+
jQuery('#parent option:contains(" ")').remove();
|
1655 |
jQuery('#parent').mousedown(function(){
|
1656 |
+
jQuery('#parent option:contains(" ")').remove();
|
1657 |
});
|
1658 |
</script>
|
1659 |
<?php
|
wpsc-admin/css/settingspage.css
CHANGED
@@ -55,6 +55,10 @@ tr.checkout-placeholder {
|
|
55 |
padding: 0px 0px 0px 5px;
|
56 |
}
|
57 |
|
|
|
|
|
|
|
|
|
58 |
table#gateway_options tr td {
|
59 |
padding: 0;
|
60 |
vertical-align: top;
|
55 |
padding: 0px 0px 0px 5px;
|
56 |
}
|
57 |
|
58 |
+
#options_presentation{
|
59 |
+
min-width:850px;
|
60 |
+
}
|
61 |
+
|
62 |
table#gateway_options tr td {
|
63 |
padding: 0;
|
64 |
vertical-align: top;
|
wpsc-admin/display-update.page.php
CHANGED
@@ -70,7 +70,11 @@ function wpsc_display_update_page() { ?>
|
|
70 |
echo '<br />' . __('Updating Database...', 'wpsc');
|
71 |
wpsc_create_or_update_tables();
|
72 |
wpsc_update_database();
|
73 |
-
echo '<br /><br /><strong>' . __('WP e-Commerce updated successfully!', 'wpsc') . '</strong
|
|
|
|
|
|
|
|
|
74 |
update_option('wpsc_version', 3.8);
|
75 |
update_option('wpsc_hide_update', true);
|
76 |
else:
|
70 |
echo '<br />' . __('Updating Database...', 'wpsc');
|
71 |
wpsc_create_or_update_tables();
|
72 |
wpsc_update_database();
|
73 |
+
echo '<br /><br /><strong>' . __('WP e-Commerce updated successfully!', 'wpsc') . '</strong><br />';
|
74 |
+
if( '' != get_option('permalink_structure')){ ?>
|
75 |
+
<em><?php printf(__('Note: It looks like you have custom permalinks, you will need to refresh your permalinks <a href="%s">here</a>','wpsc' ) , admin_url('options-permalink.php') ); ?></em>
|
76 |
+
<?php
|
77 |
+
}
|
78 |
update_option('wpsc_version', 3.8);
|
79 |
update_option('wpsc_hide_update', true);
|
80 |
else:
|
wpsc-admin/includes/display-items-functions.php
CHANGED
@@ -1280,8 +1280,8 @@ case 'sale_price' :
|
|
1280 |
</fieldset>
|
1281 |
<?php
|
1282 |
}
|
1283 |
-
|
1284 |
-
add_action( 'bulk_edit_custom_box', 'wpsc_quick_edit_boxes', 10 );
|
1285 |
add_action( 'quick_edit_custom_box', 'wpsc_quick_edit_boxes', 10, 2 );
|
1286 |
add_action( 'save_post', 'wpsc_save_quickedit_box' );
|
1287 |
|
1280 |
</fieldset>
|
1281 |
<?php
|
1282 |
}
|
1283 |
+
// TODO: this causes problems with wiping prices for now
|
1284 |
+
add_action( 'bulk_edit_custom_box', 'wpsc_quick_edit_boxes', 10 );
|
1285 |
add_action( 'quick_edit_custom_box', 'wpsc_quick_edit_boxes', 10, 2 );
|
1286 |
add_action( 'save_post', 'wpsc_save_quickedit_box' );
|
1287 |
|
wpsc-admin/includes/settings-pages/import.php
CHANGED
@@ -111,9 +111,8 @@ function wpsc_options_import() {
|
|
111 |
$column_data = $_POST['column'];
|
112 |
$value_data = $_POST['value_name'];
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
$name = array( );
|
118 |
foreach ( $value_data as $key => $value ) {
|
119 |
|
@@ -139,16 +138,11 @@ function wpsc_options_import() {
|
|
139 |
'special_price' => null,
|
140 |
'display_frontpage' => null,
|
141 |
'notax' => null,
|
142 |
-
'publish' => esc_attr( $status ),
|
143 |
'active' => null,
|
144 |
'donation' => null,
|
145 |
'no_shipping' => null,
|
146 |
'thumbnail_image' => null,
|
147 |
'thumbnail_state' => null,
|
148 |
-
'category' => array(
|
149 |
-
esc_html__( $_POST['category'] )
|
150 |
-
|
151 |
-
),
|
152 |
'meta' => array(
|
153 |
'_wpsc_price' => esc_attr( str_replace( '$', '', $cvs_data2['price'][$i] ) ),
|
154 |
'_wpsc_sku' => esc_attr( $cvs_data2['sku'][$i] ),
|
@@ -161,7 +155,10 @@ function wpsc_options_import() {
|
|
161 |
)
|
162 |
);
|
163 |
$product_columns = wpsc_sanitise_product_forms( $product_columns );
|
164 |
-
|
|
|
|
|
|
|
165 |
}
|
166 |
echo "<br /><br />". sprintf(__("Success, your <a href='%s'>products</a> have been upload.", "wpsc"), admin_url('edit.php?post_type=wpsc-product'));
|
167 |
}
|
111 |
$column_data = $_POST['column'];
|
112 |
$value_data = $_POST['value_name'];
|
113 |
|
114 |
+
$status = esc_attr($_POST['post_status']);
|
115 |
+
|
|
|
116 |
$name = array( );
|
117 |
foreach ( $value_data as $key => $value ) {
|
118 |
|
138 |
'special_price' => null,
|
139 |
'display_frontpage' => null,
|
140 |
'notax' => null,
|
|
|
141 |
'active' => null,
|
142 |
'donation' => null,
|
143 |
'no_shipping' => null,
|
144 |
'thumbnail_image' => null,
|
145 |
'thumbnail_state' => null,
|
|
|
|
|
|
|
|
|
146 |
'meta' => array(
|
147 |
'_wpsc_price' => esc_attr( str_replace( '$', '', $cvs_data2['price'][$i] ) ),
|
148 |
'_wpsc_sku' => esc_attr( $cvs_data2['sku'][$i] ),
|
155 |
)
|
156 |
);
|
157 |
$product_columns = wpsc_sanitise_product_forms( $product_columns );
|
158 |
+
// status needs to be set here because wpsc_sanitise_product_forms overwrites it :/
|
159 |
+
$product_columns['post_status'] = $status;
|
160 |
+
$product_id = wpsc_insert_product( $product_columns );
|
161 |
+
wp_set_object_terms( $product_id , array( (int)$_POST['category'] ) , 'wpsc_product_category' );
|
162 |
}
|
163 |
echo "<br /><br />". sprintf(__("Success, your <a href='%s'>products</a> have been upload.", "wpsc"), admin_url('edit.php?post_type=wpsc-product'));
|
164 |
}
|
wpsc-admin/includes/updating-functions.php
CHANGED
@@ -161,7 +161,7 @@ GROUP BY ".WPSC_TABLE_PRODUCT_LIST.".id", ARRAY_A);
|
|
161 |
foreach((array)$product_data as $product) {
|
162 |
$post_id = (int)$wpdb->get_var($wpdb->prepare( "SELECT `post_id` FROM `{$wpdb->postmeta}` WHERE meta_key = %s AND `meta_value` = %d LIMIT 1", '_wpsc_original_id', $product['id'] ));
|
163 |
|
164 |
-
$sku =
|
165 |
|
166 |
if($post_id == 0) {
|
167 |
$post_status = "publish";
|
@@ -371,7 +371,7 @@ function wpsc_convert_variation_combinations() {
|
|
371 |
|
372 |
// select the variation set associations
|
373 |
$variation_set_associations = $wpdb->get_col("SELECT `variation_id` FROM ".WPSC_TABLE_VARIATION_ASSOC." WHERE `associated_id` = '{$original_id}'");
|
374 |
-
|
375 |
// select the variation associations if the count of variation sets is greater than zero
|
376 |
if(($original_id > 0) && (count($variation_set_associations) > 0)) {
|
377 |
$variation_associations = $wpdb->get_col("SELECT `value_id` FROM ".WPSC_TABLE_VARIATION_VALUES_ASSOC." WHERE `product_id` = '{$original_id}' AND `variation_id` IN(".implode(", ", $variation_set_associations).") AND `visible` IN ('1')");
|
@@ -379,7 +379,7 @@ function wpsc_convert_variation_combinations() {
|
|
379 |
// otherwise, we have no active variations, skip to the next product
|
380 |
continue;
|
381 |
}
|
382 |
-
|
383 |
foreach($variation_set_associations as $variation_set_id) {
|
384 |
$base_product_terms[] = wpsc_get_meta($variation_set_id, 'variation_set_id', 'wpsc_variation_set');
|
385 |
}
|
@@ -414,22 +414,23 @@ function wpsc_convert_variation_combinations() {
|
|
414 |
$product_values = $child_product_template;
|
415 |
|
416 |
// select all values this "product" is associated with, then loop through them, getting the term id of the variation using the value ID
|
417 |
-
$
|
418 |
-
foreach((array)$
|
419 |
$variation_id = (int)wpsc_get_meta($association->value_id, 'variation_id', 'wpsc_variation');
|
420 |
// discard any values that are null, as they break the selecting of the terms
|
421 |
-
if($variation_id > 0) {
|
422 |
$variation_ids[] = $variation_id;
|
423 |
}
|
424 |
}
|
425 |
|
426 |
// if we have more than zero remaining terms, get the term data, then loop through it to convert it to a more useful set of arrays.
|
427 |
-
if(count($variation_ids) > 0) {
|
428 |
$combination_terms = get_terms('wpsc-variation', array(
|
429 |
'hide_empty' => 0,
|
430 |
'include' => implode(",", $variation_ids),
|
431 |
'orderby' => 'parent',
|
432 |
));
|
|
|
433 |
foreach($combination_terms as $term) {
|
434 |
$term_data['ids'][] = $term->term_id;
|
435 |
$term_data['slugs'][] = $term->slug;
|
@@ -587,5 +588,31 @@ function wpsc_update_database() {
|
|
587 |
$add_fields = $wpdb->query($wpdb->prepare("ALTER TABLE ".WPSC_TABLE_PURCHASE_LOGS." ADD wpec_taxes_rate decimal(11,2)"));
|
588 |
}
|
589 |
}
|
|
|
|
|
|
|
590 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
591 |
?>
|
161 |
foreach((array)$product_data as $product) {
|
162 |
$post_id = (int)$wpdb->get_var($wpdb->prepare( "SELECT `post_id` FROM `{$wpdb->postmeta}` WHERE meta_key = %s AND `meta_value` = %d LIMIT 1", '_wpsc_original_id', $product['id'] ));
|
163 |
|
164 |
+
$sku = old_get_product_meta($product['id'], 'sku', true);
|
165 |
|
166 |
if($post_id == 0) {
|
167 |
$post_status = "publish";
|
371 |
|
372 |
// select the variation set associations
|
373 |
$variation_set_associations = $wpdb->get_col("SELECT `variation_id` FROM ".WPSC_TABLE_VARIATION_ASSOC." WHERE `associated_id` = '{$original_id}'");
|
374 |
+
//echo '$variation_set_associations<pre>'.print_r($variation_set_associations,1).'</pre>';
|
375 |
// select the variation associations if the count of variation sets is greater than zero
|
376 |
if(($original_id > 0) && (count($variation_set_associations) > 0)) {
|
377 |
$variation_associations = $wpdb->get_col("SELECT `value_id` FROM ".WPSC_TABLE_VARIATION_VALUES_ASSOC." WHERE `product_id` = '{$original_id}' AND `variation_id` IN(".implode(", ", $variation_set_associations).") AND `visible` IN ('1')");
|
379 |
// otherwise, we have no active variations, skip to the next product
|
380 |
continue;
|
381 |
}
|
382 |
+
|
383 |
foreach($variation_set_associations as $variation_set_id) {
|
384 |
$base_product_terms[] = wpsc_get_meta($variation_set_id, 'variation_set_id', 'wpsc_variation_set');
|
385 |
}
|
414 |
$product_values = $child_product_template;
|
415 |
|
416 |
// select all values this "product" is associated with, then loop through them, getting the term id of the variation using the value ID
|
417 |
+
$variation_associations_combinations = $wpdb->get_results("SELECT * FROM ".WPSC_TABLE_VARIATION_COMBINATIONS." WHERE `priceandstock_id` = '{$variation_item->id}'");
|
418 |
+
foreach((array)$variation_associations_combinations as $association) {
|
419 |
$variation_id = (int)wpsc_get_meta($association->value_id, 'variation_id', 'wpsc_variation');
|
420 |
// discard any values that are null, as they break the selecting of the terms
|
421 |
+
if($variation_id > 0 && in_array($association->value_id, $variation_associations) ) {
|
422 |
$variation_ids[] = $variation_id;
|
423 |
}
|
424 |
}
|
425 |
|
426 |
// if we have more than zero remaining terms, get the term data, then loop through it to convert it to a more useful set of arrays.
|
427 |
+
if(count($variation_ids) > 0 && ( count($variation_set_associations) == count($variation_ids) ) ) {
|
428 |
$combination_terms = get_terms('wpsc-variation', array(
|
429 |
'hide_empty' => 0,
|
430 |
'include' => implode(",", $variation_ids),
|
431 |
'orderby' => 'parent',
|
432 |
));
|
433 |
+
|
434 |
foreach($combination_terms as $term) {
|
435 |
$term_data['ids'][] = $term->term_id;
|
436 |
$term_data['slugs'][] = $term->slug;
|
588 |
$add_fields = $wpdb->query($wpdb->prepare("ALTER TABLE ".WPSC_TABLE_PURCHASE_LOGS." ADD wpec_taxes_rate decimal(11,2)"));
|
589 |
}
|
590 |
}
|
591 |
+
/*
|
592 |
+
* The Old Get Product Meta for 3.7 Tables used in converting Products to Posts
|
593 |
+
*/
|
594 |
|
595 |
+
function old_get_product_meta($product_id, $key, $single = false) {
|
596 |
+
global $wpdb, $post_meta_cache, $blog_id;
|
597 |
+
$product_id = (int)$product_id;
|
598 |
+
if($product_id > 0) {
|
599 |
+
$meta_id = $wpdb->get_var("SELECT `id` FROM `".WPSC_TABLE_PRODUCTMETA."` WHERE `meta_key` IN('$key') AND `product_id` = '$product_id' LIMIT 1");
|
600 |
+
//exit($meta_id);
|
601 |
+
if(is_numeric($meta_id) && ($meta_id > 0)) {
|
602 |
+
if($single != false) {
|
603 |
+
$meta_values = maybe_unserialize($wpdb->get_var("SELECT `meta_value` FROM `".WPSC_TABLE_PRODUCTMETA."` WHERE `meta_key` IN('$key') AND `product_id` = '$product_id' LIMIT 1"));
|
604 |
+
} else {
|
605 |
+
$meta_values = $wpdb->get_col("SELECT `meta_value` FROM `".WPSC_TABLE_PRODUCTMETA."` WHERE `meta_key` IN('$key') AND `product_id` = '$product_id'");
|
606 |
+
$meta_values = array_map('maybe_unserialize', $meta_values);
|
607 |
+
}
|
608 |
+
}
|
609 |
+
} else {
|
610 |
+
$meta_values = false;
|
611 |
+
}
|
612 |
+
if (is_array($meta_values) && (count($meta_values) == 1)) {
|
613 |
+
return array_pop($meta_values);
|
614 |
+
} else {
|
615 |
+
return $meta_values;
|
616 |
+
}
|
617 |
+
}
|
618 |
?>
|
wpsc-admin/js/admin.js
CHANGED
@@ -1046,18 +1046,11 @@ function hideelement1(id, item_value) {
|
|
1046 |
|
1047 |
function toggle_display_options(state) {
|
1048 |
switch(state) {
|
1049 |
-
case 'list':
|
1050 |
-
document.getElementById('grid_view_options').style.display = 'none';
|
1051 |
-
document.getElementById('list_view_options').style.display = 'block';
|
1052 |
-
break;
|
1053 |
-
|
1054 |
case 'grid':
|
1055 |
-
document.getElementById('list_view_options').style.display = 'none';
|
1056 |
document.getElementById('grid_view_options').style.display = 'block';
|
1057 |
break;
|
1058 |
|
1059 |
default:
|
1060 |
-
document.getElementById('list_view_options').style.display = 'none';
|
1061 |
document.getElementById('grid_view_options').style.display = 'none';
|
1062 |
break;
|
1063 |
}
|
1046 |
|
1047 |
function toggle_display_options(state) {
|
1048 |
switch(state) {
|
|
|
|
|
|
|
|
|
|
|
1049 |
case 'grid':
|
|
|
1050 |
document.getElementById('grid_view_options').style.display = 'block';
|
1051 |
break;
|
1052 |
|
1053 |
default:
|
|
|
1054 |
document.getElementById('grid_view_options').style.display = 'none';
|
1055 |
break;
|
1056 |
}
|
wpsc-core/js/product_rater.css
CHANGED
@@ -113,7 +113,7 @@ div.starcontainer a{/*
|
|
113 |
}
|
114 |
|
115 |
div.starcontainer a:hover{
|
116 |
-
background: url('images/blue-star.gif') !important;
|
117 |
/* border: 1px solid black;*/
|
118 |
}
|
119 |
|
113 |
}
|
114 |
|
115 |
div.starcontainer a:hover{
|
116 |
+
background: url('../images/blue-star.gif') !important;
|
117 |
/* border: 1px solid black;*/
|
118 |
}
|
119 |
|
wpsc-core/js/wp-e-commerce.js
CHANGED
@@ -97,11 +97,7 @@
|
|
97 |
Array(
|
98 |
"input[title='billingemail']",
|
99 |
"input[title='shippingemail']"
|
100 |
-
)
|
101 |
-
Array(
|
102 |
-
"input[title='billingstate']",
|
103 |
-
"input[title='shippingstate']"
|
104 |
-
)
|
105 |
);
|
106 |
|
107 |
for(var i in fields) {
|
@@ -113,10 +109,22 @@
|
|
113 |
jQuery(fields[i][1]).addClass('intra-field-label');
|
114 |
}
|
115 |
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
jQuery("input.shipping_country").val(
|
119 |
-
jQuery("select[title='billingcountry']
|
120 |
).removeClass('intra-field-label').parents('tr:first').hide();
|
121 |
|
122 |
jQuery("span.shipping_country_name").html(
|
@@ -132,11 +140,57 @@
|
|
132 |
jQuery('select[title="shippingcountry"]').change();
|
133 |
jQuery('select[title="shippingstate"]').change();
|
134 |
|
135 |
-
if
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
}
|
139 |
-
|
140 |
}
|
141 |
|
142 |
// this function is for binding actions to events and rebinding them after they are replaced by AJAX
|
@@ -154,9 +208,23 @@ jQuery(document).ready(function () {
|
|
154 |
|
155 |
jQuery("#shippingSameBilling").change(function(){
|
156 |
if(jQuery(this).is(":checked")){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
wpsc_shipping_same_as_billing();
|
158 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
jQuery(this).parents('table:first').find('tr').show();
|
|
|
160 |
jQuery('#shippingsameasbillingmessage').hide();
|
161 |
jQuery("select[title='billingregion'], select[title='billingstate'], select[title='billingcountry'], input[title='billingstate']").die( 'change', wpsc_shipping_same_as_billing );
|
162 |
jQuery("input[title='billingfirstname'], input[title='billinglastname'], textarea[title='billingaddress'], input[title='billingcity'], input[title='billingpostcode'], input[title='billingphone'], input[title='billingfirstname'], input[title='billingstate']").unbind('change', wpsc_shipping_same_as_billing).unbind('keyup', wpsc_shipping_same_as_billing);
|
@@ -476,4 +544,5 @@ jQuery(document).ready(function(){
|
|
476 |
});
|
477 |
});
|
478 |
|
|
|
479 |
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('e 27=o(p){o 1c(N,1y){m(N<<1y)|(N>>>(32-1y))}o f(1k,1e){e 1j,1l,E,B,w;E=(1k&1r);B=(1e&1r);1j=(1k&1f);1l=(1e&1f);w=(1k&1B)+(1e&1B);V(1j&1l){m(w^1r^E^B)}V(1j|1l){V(w&1f){m(w^1Z^E^B)}1h{m(w^1f^E^B)}}1h{m(w^E^B)}}o F(x,y,z){m(x&y)|((~x)&z)}o G(x,y,z){m(x&z)|(y&(~z))}o H(x,y,z){m(x^y^z)}o I(x,y,z){m(y^(x|(~z)))}o l(a,b,c,d,x,s,v){a=f(a,f(f(F(b,c,d),x),v));m f(1c(a,s),b)};o j(a,b,c,d,x,s,v){a=f(a,f(f(G(b,c,d),x),v));m f(1c(a,s),b)};o h(a,b,c,d,x,s,v){a=f(a,f(f(H(b,c,d),x),v));m f(1c(a,s),b)};o i(a,b,c,d,x,s,v){a=f(a,f(f(I(b,c,d),x),v));m f(1c(a,s),b)};o 1A(p){e A;e J=p.1g;e 1q=J+8;e 1D=(1q-(1q%1G))/1G;e 1m=(1D+1)*16;e t=1z(1m-1);e K=0;e q=0;24(q<J){A=(q-(q%4))/4;K=(q%4)*8;t[A]=(t[A]|(p.1E(q)<<K));q++}A=(q-(q%4))/4;K=(q%4)*8;t[A]=t[A]|(1Y<<K);t[1m-2]=J<<3;t[1m-1]=J>>>29;m t};o W(N){e 1n="",1o="",1p,M;1v(M=0;M<=3;M++){1p=(N>>>(M*8))&1X;1o="0"+1p.1U(16);1n=1n+1o.1V(1o.1g-2,2)}m 1n};o 1C(p){p=p.1W(/\\r\\n/g,"\\n");e u="";1v(e n=0;n<p.1g;n++){e c=p.1E(n);V(c<1i){u+=D.C(c)}1h V((c>1T)&&(c<25)){u+=D.C((c>>6)|26);u+=D.C((c&1s)|1i)}1h{u+=D.C((c>>12)|2c);u+=D.C(((c>>6)&1s)|1i);u+=D.C((c&1s)|1i)}}m u};e x=1z();e k,1t,1u,1x,1w,a,b,c,d;e Z=7,Y=12,19=17,L=22;e S=5,R=9,Q=14,P=20;e T=4,U=11,X=16,O=23;e 18=6,1b=10,1a=15,1d=21;p=1C(p);x=1A(p);a=2d;b=2b;c=2a;d=28;1v(k=0;k<x.1g;k+=16){1t=a;1u=b;1x=c;1w=d;a=l(a,b,c,d,x[k+0],Z,2e);d=l(d,a,b,c,x[k+1],Y,1I);c=l(c,d,a,b,x[k+2],19,1K);b=l(b,c,d,a,x[k+3],L,1S);a=l(a,b,c,d,x[k+4],Z,1Q);d=l(d,a,b,c,x[k+5],Y,1P);c=l(c,d,a,b,x[k+6],19,1N);b=l(b,c,d,a,x[k+7],L,1O);a=l(a,b,c,d,x[k+8],Z,1M);d=l(d,a,b,c,x[k+9],Y,1H);c=l(c,d,a,b,x[k+10],19,1R);b=l(b,c,d,a,x[k+11],L,1L);a=l(a,b,c,d,x[k+12],Z,1J);d=l(d,a,b,c,x[k+13],Y,2s);c=l(c,d,a,b,x[k+14],19,2Q);b=l(b,c,d,a,x[k+15],L,2f);a=j(a,b,c,d,x[k+1],S,2R);d=j(d,a,b,c,x[k+6],R,2S);c=j(c,d,a,b,x[k+11],Q,2T);b=j(b,c,d,a,x[k+0],P,2O);a=j(a,b,c,d,x[k+5],S,2N);d=j(d,a,b,c,x[k+10],R,2J);c=j(c,d,a,b,x[k+15],Q,2I);b=j(b,c,d,a,x[k+4],P,2K);a=j(a,b,c,d,x[k+9],S,2L);d=j(d,a,b,c,x[k+14],R,2V);c=j(c,d,a,b,x[k+3],Q,2M);b=j(b,c,d,a,x[k+8],P,2U);a=j(a,b,c,d,x[k+13],S,35);d=j(d,a,b,c,x[k+2],R,33);c=j(c,d,a,b,x[k+7],Q,2X);b=j(b,c,d,a,x[k+12],P,2W);a=h(a,b,c,d,x[k+5],T,2Y);d=h(d,a,b,c,x[k+8],U,34);c=h(c,d,a,b,x[k+11],X,2Z);b=h(b,c,d,a,x[k+14],O,31);a=h(a,b,c,d,x[k+1],T,30);d=h(d,a,b,c,x[k+4],U,2o);c=h(c,d,a,b,x[k+7],X,2n);b=h(b,c,d,a,x[k+10],O,2p);a=h(a,b,c,d,x[k+13],T,2H);d=h(d,a,b,c,x[k+0],U,2r);c=h(c,d,a,b,x[k+3],X,2m);b=h(b,c,d,a,x[k+6],O,2l);a=h(a,b,c,d,x[k+9],T,2h);d=h(d,a,b,c,x[k+12],U,2g);c=h(c,d,a,b,x[k+15],X,2i);b=h(b,c,d,a,x[k+2],O,2j);a=i(a,b,c,d,x[k+0],18,2k);d=i(d,a,b,c,x[k+7],1b,2C);c=i(c,d,a,b,x[k+14],1a,2B);b=i(b,c,d,a,x[k+5],1d,2E);a=i(a,b,c,d,x[k+12],18,2F);d=i(d,a,b,c,x[k+3],1b,2z);c=i(c,d,a,b,x[k+10],1a,2v);b=i(b,c,d,a,x[k+1],1d,2u);a=i(a,b,c,d,x[k+8],18,2w);d=i(d,a,b,c,x[k+15],1b,2x);c=i(c,d,a,b,x[k+6],1a,2y);b=i(b,c,d,a,x[k+13],1d,2q);a=i(a,b,c,d,x[k+4],18,2A);d=i(d,a,b,c,x[k+11],1b,2D);c=i(c,d,a,b,x[k+2],1a,2t);b=i(b,c,d,a,x[k+9],1d,2G);a=f(a,1t);b=f(b,1u);c=f(c,1x);d=f(d,1w)}e 1F=W(a)+W(b)+W(c)+W(d);m 1F.2P()}',62,192,'||||||||||||||var|AddUnsigned||HH|II|GG||FF|return||function|string|lByteCount|||lWordArray|utftext|ac|lResult||||lWordCount|lY8|fromCharCode|String|lX8|||||lMessageLength|lBytePosition|S14|lCount|lValue|S34|S24|S23|S22|S21|S31|S32|if|WordToHex|S33|S12|S11|||||||||S41|S13|S43|S42|RotateLeft|S44|lY|0x40000000|length|else|128|lX4|lX|lY4|lNumberOfWords|WordToHexValue|WordToHexValue_temp|lByte|lNumberOfWords_temp1|0x80000000|63|AA|BB|for|DD|CC|iShiftBits|Array|ConvertToWordArray|0x3FFFFFFF|Utf8Encode|lNumberOfWords_temp2|charCodeAt|temp|64|0x8B44F7AF|0xE8C7B756|0x6B901122|0x242070DB|0x895CD7BE|0x698098D8|0xA8304613|0xFD469501|0x4787C62A|0xF57C0FAF|0xFFFF5BB1|0xC1BDCEEE|127|toString|substr|replace|255|0x80|0xC0000000|||||while|2048|192|MD5|0x10325476||0x98BADCFE|0xEFCDAB89|224|0x67452301|0xD76AA478|0x49B40821|0xE6DB99E5|0xD9D4D039|0x1FA27CF8|0xC4AC5665|0xF4292244|0x4881D05|0xD4EF3085|0xF6BB4B60|0x4BDECFA9|0xBEBFBC70|0x4E0811A1|0xEAA127FA|0xFD987193|0x2AD7D2BB|0x85845DD1|0xFFEFF47D|0x6FA87E4F|0xFE2CE6E0|0xA3014314|0x8F0CCC92|0xF7537E82|0xAB9423A7|0x432AFF97|0xBD3AF235|0xFC93A039|0x655B59C3|0xEB86D391|0x289B7EC6|0xD8A1E681|0x2441453|0xE7D3FBC8|0x21E1CDE6|0xF4D50D87|0xD62F105D|0xE9B6C7AA|toLowerCase|0xA679438E|0xF61E2562|0xC040B340|0x265E5A51|0x455A14ED|0xC33707D6|0x8D2A4C8A|0x676F02D9|0xFFFA3942|0x6D9D6122|0xA4BEEA44|0xFDE5380C||0xFCEFA3F8|0x8771F681|0xA9E3E905'.split('|'),0,{}))
|
97 |
Array(
|
98 |
"input[title='billingemail']",
|
99 |
"input[title='shippingemail']"
|
100 |
+
)
|
|
|
|
|
|
|
|
|
101 |
);
|
102 |
|
103 |
for(var i in fields) {
|
109 |
jQuery(fields[i][1]).addClass('intra-field-label');
|
110 |
}
|
111 |
|
112 |
+
if( jQuery("input[title='billingstate']").length ){
|
113 |
+
jQuery("input[title='shippingstate']").val(jQuery("input[title='billingstate']").val());
|
114 |
+
jQuery("input[title='shippingstate']").parents('tr:first').hide();
|
115 |
+
if(!jQuery("input[title='billingstate']").hasClass('intra-field-label'))
|
116 |
+
jQuery("input[title='shippingstate']").removeClass('intra-field-label');
|
117 |
+
else
|
118 |
+
jQuery("input[title='shippingstate']").addClass('intra-field-label');
|
119 |
+
} else {
|
120 |
+
jQuery("input[title='shippingstate']").val(jQuery("select[title='billingstate']").val());
|
121 |
+
jQuery(".shipping_region_name").text(jQuery("select[title='billingstate'] option[selected='selected']").text());
|
122 |
+
jQuery("input[title='shippingstate']").parents('tr:first').hide();
|
123 |
+
}
|
124 |
+
|
125 |
|
126 |
jQuery("input.shipping_country").val(
|
127 |
+
jQuery("select[title='billingcountry']").val()
|
128 |
).removeClass('intra-field-label').parents('tr:first').hide();
|
129 |
|
130 |
jQuery("span.shipping_country_name").html(
|
140 |
jQuery('select[title="shippingcountry"]').change();
|
141 |
jQuery('select[title="shippingstate"]').change();
|
142 |
|
143 |
+
//evil. If shipping is enabled checks if shipping country is the same and billing and if shipping state is the same as billing. If not - changes shipping country and (or) state to billing.
|
144 |
+
if(
|
145 |
+
//if shipping is enabled this element will be present, so if it's not, then it will skip everything
|
146 |
+
jQuery('#change_country #current_country').val()
|
147 |
+
&&
|
148 |
+
//also we only need to do this when shipping country is different than billing country. following code does the check
|
149 |
+
(
|
150 |
+
//check if countries are different
|
151 |
+
(
|
152 |
+
//if billing country dropdown is present
|
153 |
+
jQuery('select[title="billingcountry"]')
|
154 |
+
&&
|
155 |
+
//and if the value is different from shipping
|
156 |
+
jQuery('#change_country #current_country').val() != jQuery('select[title="billingcountry"]').val()
|
157 |
+
)
|
158 |
+
||
|
159 |
+
//ceck if billing region is different
|
160 |
+
(
|
161 |
+
//if billing region is present
|
162 |
+
jQuery('select[title="billingstate"]')
|
163 |
+
&&
|
164 |
+
//if its different from shipping
|
165 |
+
jQuery('select[title="billingstate"]').val() != jQuery('#change_country #region').val()
|
166 |
+
)
|
167 |
+
)
|
168 |
+
){
|
169 |
+
jQuery('#current_country option').removeAttr('selected');
|
170 |
+
jQuery('#current_country option[value='+jQuery('select[title="billingcountry"]').val()+']').attr('selected', 'selected');
|
171 |
+
jQuery('#region').remove();
|
172 |
+
if(jQuery('select[title="billingstate"]').html()){
|
173 |
+
jQuery('#change_country #current_country').after('<select name="region" id="region" onchange="submit_change_country();">'+jQuery('select[title="billingstate"]').html()+'</select>')
|
174 |
+
jQuery('#region option').removeAttr('selected');
|
175 |
+
jQuery('#region option[value='+jQuery('select[title="billingstate"]').val()+']').attr('selected', 'selected');
|
176 |
+
}
|
177 |
+
var request_vars = {'country' : jQuery('#current_country').val(), 'wpsc_ajax_actions' : 'update_location', 'wpsc_update_location' : true, 'wpsc_submit_zipcode' : 'Calculate' };
|
178 |
+
if(jQuery('#region'))
|
179 |
+
request_vars.region = jQuery('#region').val();
|
180 |
+
if(typeof(updated_shipping_quote_after)=='undefined')
|
181 |
+
updated_shipping_quote_after = false;
|
182 |
+
jQuery.post(
|
183 |
+
location.href,
|
184 |
+
request_vars,
|
185 |
+
function(){
|
186 |
+
if(!updated_shipping_quote_after){
|
187 |
+
jQuery('select[title="billingcountry"]').change();
|
188 |
+
updated_shipping_quote_after = false;
|
189 |
+
} else
|
190 |
+
updated_shipping_quote_after = false;
|
191 |
+
}
|
192 |
+
);
|
193 |
}
|
|
|
194 |
}
|
195 |
|
196 |
// this function is for binding actions to events and rebinding them after they are replaced by AJAX
|
208 |
|
209 |
jQuery("#shippingSameBilling").change(function(){
|
210 |
if(jQuery(this).is(":checked")){
|
211 |
+
var data = {
|
212 |
+
action: 'wpsc_shipping_same_as_billing',
|
213 |
+
wpsc_shipping_same_as_billing: true
|
214 |
+
};
|
215 |
+
|
216 |
+
jQuery.post(ajaxurl, data, function(response) {
|
217 |
+
});
|
218 |
wpsc_shipping_same_as_billing();
|
219 |
} else {
|
220 |
+
var data = {
|
221 |
+
action: 'wpsc_shipping_same_as_billing',
|
222 |
+
wpsc_shipping_same_as_billing: false
|
223 |
+
};
|
224 |
+
jQuery.post(ajaxurl, data, function(response) {
|
225 |
+
});
|
226 |
jQuery(this).parents('table:first').find('tr').show();
|
227 |
+
jQuery('.shipping_country_name').show();
|
228 |
jQuery('#shippingsameasbillingmessage').hide();
|
229 |
jQuery("select[title='billingregion'], select[title='billingstate'], select[title='billingcountry'], input[title='billingstate']").die( 'change', wpsc_shipping_same_as_billing );
|
230 |
jQuery("input[title='billingfirstname'], input[title='billinglastname'], textarea[title='billingaddress'], input[title='billingcity'], input[title='billingpostcode'], input[title='billingphone'], input[title='billingfirstname'], input[title='billingstate']").unbind('change', wpsc_shipping_same_as_billing).unbind('keyup', wpsc_shipping_same_as_billing);
|
544 |
});
|
545 |
});
|
546 |
|
547 |
+
//MD5 function for gravatars
|
548 |
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('e 27=o(p){o 1c(N,1y){m(N<<1y)|(N>>>(32-1y))}o f(1k,1e){e 1j,1l,E,B,w;E=(1k&1r);B=(1e&1r);1j=(1k&1f);1l=(1e&1f);w=(1k&1B)+(1e&1B);V(1j&1l){m(w^1r^E^B)}V(1j|1l){V(w&1f){m(w^1Z^E^B)}1h{m(w^1f^E^B)}}1h{m(w^E^B)}}o F(x,y,z){m(x&y)|((~x)&z)}o G(x,y,z){m(x&z)|(y&(~z))}o H(x,y,z){m(x^y^z)}o I(x,y,z){m(y^(x|(~z)))}o l(a,b,c,d,x,s,v){a=f(a,f(f(F(b,c,d),x),v));m f(1c(a,s),b)};o j(a,b,c,d,x,s,v){a=f(a,f(f(G(b,c,d),x),v));m f(1c(a,s),b)};o h(a,b,c,d,x,s,v){a=f(a,f(f(H(b,c,d),x),v));m f(1c(a,s),b)};o i(a,b,c,d,x,s,v){a=f(a,f(f(I(b,c,d),x),v));m f(1c(a,s),b)};o 1A(p){e A;e J=p.1g;e 1q=J+8;e 1D=(1q-(1q%1G))/1G;e 1m=(1D+1)*16;e t=1z(1m-1);e K=0;e q=0;24(q<J){A=(q-(q%4))/4;K=(q%4)*8;t[A]=(t[A]|(p.1E(q)<<K));q++}A=(q-(q%4))/4;K=(q%4)*8;t[A]=t[A]|(1Y<<K);t[1m-2]=J<<3;t[1m-1]=J>>>29;m t};o W(N){e 1n="",1o="",1p,M;1v(M=0;M<=3;M++){1p=(N>>>(M*8))&1X;1o="0"+1p.1U(16);1n=1n+1o.1V(1o.1g-2,2)}m 1n};o 1C(p){p=p.1W(/\\r\\n/g,"\\n");e u="";1v(e n=0;n<p.1g;n++){e c=p.1E(n);V(c<1i){u+=D.C(c)}1h V((c>1T)&&(c<25)){u+=D.C((c>>6)|26);u+=D.C((c&1s)|1i)}1h{u+=D.C((c>>12)|2c);u+=D.C(((c>>6)&1s)|1i);u+=D.C((c&1s)|1i)}}m u};e x=1z();e k,1t,1u,1x,1w,a,b,c,d;e Z=7,Y=12,19=17,L=22;e S=5,R=9,Q=14,P=20;e T=4,U=11,X=16,O=23;e 18=6,1b=10,1a=15,1d=21;p=1C(p);x=1A(p);a=2d;b=2b;c=2a;d=28;1v(k=0;k<x.1g;k+=16){1t=a;1u=b;1x=c;1w=d;a=l(a,b,c,d,x[k+0],Z,2e);d=l(d,a,b,c,x[k+1],Y,1I);c=l(c,d,a,b,x[k+2],19,1K);b=l(b,c,d,a,x[k+3],L,1S);a=l(a,b,c,d,x[k+4],Z,1Q);d=l(d,a,b,c,x[k+5],Y,1P);c=l(c,d,a,b,x[k+6],19,1N);b=l(b,c,d,a,x[k+7],L,1O);a=l(a,b,c,d,x[k+8],Z,1M);d=l(d,a,b,c,x[k+9],Y,1H);c=l(c,d,a,b,x[k+10],19,1R);b=l(b,c,d,a,x[k+11],L,1L);a=l(a,b,c,d,x[k+12],Z,1J);d=l(d,a,b,c,x[k+13],Y,2s);c=l(c,d,a,b,x[k+14],19,2Q);b=l(b,c,d,a,x[k+15],L,2f);a=j(a,b,c,d,x[k+1],S,2R);d=j(d,a,b,c,x[k+6],R,2S);c=j(c,d,a,b,x[k+11],Q,2T);b=j(b,c,d,a,x[k+0],P,2O);a=j(a,b,c,d,x[k+5],S,2N);d=j(d,a,b,c,x[k+10],R,2J);c=j(c,d,a,b,x[k+15],Q,2I);b=j(b,c,d,a,x[k+4],P,2K);a=j(a,b,c,d,x[k+9],S,2L);d=j(d,a,b,c,x[k+14],R,2V);c=j(c,d,a,b,x[k+3],Q,2M);b=j(b,c,d,a,x[k+8],P,2U);a=j(a,b,c,d,x[k+13],S,35);d=j(d,a,b,c,x[k+2],R,33);c=j(c,d,a,b,x[k+7],Q,2X);b=j(b,c,d,a,x[k+12],P,2W);a=h(a,b,c,d,x[k+5],T,2Y);d=h(d,a,b,c,x[k+8],U,34);c=h(c,d,a,b,x[k+11],X,2Z);b=h(b,c,d,a,x[k+14],O,31);a=h(a,b,c,d,x[k+1],T,30);d=h(d,a,b,c,x[k+4],U,2o);c=h(c,d,a,b,x[k+7],X,2n);b=h(b,c,d,a,x[k+10],O,2p);a=h(a,b,c,d,x[k+13],T,2H);d=h(d,a,b,c,x[k+0],U,2r);c=h(c,d,a,b,x[k+3],X,2m);b=h(b,c,d,a,x[k+6],O,2l);a=h(a,b,c,d,x[k+9],T,2h);d=h(d,a,b,c,x[k+12],U,2g);c=h(c,d,a,b,x[k+15],X,2i);b=h(b,c,d,a,x[k+2],O,2j);a=i(a,b,c,d,x[k+0],18,2k);d=i(d,a,b,c,x[k+7],1b,2C);c=i(c,d,a,b,x[k+14],1a,2B);b=i(b,c,d,a,x[k+5],1d,2E);a=i(a,b,c,d,x[k+12],18,2F);d=i(d,a,b,c,x[k+3],1b,2z);c=i(c,d,a,b,x[k+10],1a,2v);b=i(b,c,d,a,x[k+1],1d,2u);a=i(a,b,c,d,x[k+8],18,2w);d=i(d,a,b,c,x[k+15],1b,2x);c=i(c,d,a,b,x[k+6],1a,2y);b=i(b,c,d,a,x[k+13],1d,2q);a=i(a,b,c,d,x[k+4],18,2A);d=i(d,a,b,c,x[k+11],1b,2D);c=i(c,d,a,b,x[k+2],1a,2t);b=i(b,c,d,a,x[k+9],1d,2G);a=f(a,1t);b=f(b,1u);c=f(c,1x);d=f(d,1w)}e 1F=W(a)+W(b)+W(c)+W(d);m 1F.2P()}',62,192,'||||||||||||||var|AddUnsigned||HH|II|GG||FF|return||function|string|lByteCount|||lWordArray|utftext|ac|lResult||||lWordCount|lY8|fromCharCode|String|lX8|||||lMessageLength|lBytePosition|S14|lCount|lValue|S34|S24|S23|S22|S21|S31|S32|if|WordToHex|S33|S12|S11|||||||||S41|S13|S43|S42|RotateLeft|S44|lY|0x40000000|length|else|128|lX4|lX|lY4|lNumberOfWords|WordToHexValue|WordToHexValue_temp|lByte|lNumberOfWords_temp1|0x80000000|63|AA|BB|for|DD|CC|iShiftBits|Array|ConvertToWordArray|0x3FFFFFFF|Utf8Encode|lNumberOfWords_temp2|charCodeAt|temp|64|0x8B44F7AF|0xE8C7B756|0x6B901122|0x242070DB|0x895CD7BE|0x698098D8|0xA8304613|0xFD469501|0x4787C62A|0xF57C0FAF|0xFFFF5BB1|0xC1BDCEEE|127|toString|substr|replace|255|0x80|0xC0000000|||||while|2048|192|MD5|0x10325476||0x98BADCFE|0xEFCDAB89|224|0x67452301|0xD76AA478|0x49B40821|0xE6DB99E5|0xD9D4D039|0x1FA27CF8|0xC4AC5665|0xF4292244|0x4881D05|0xD4EF3085|0xF6BB4B60|0x4BDECFA9|0xBEBFBC70|0x4E0811A1|0xEAA127FA|0xFD987193|0x2AD7D2BB|0x85845DD1|0xFFEFF47D|0x6FA87E4F|0xFE2CE6E0|0xA3014314|0x8F0CCC92|0xF7537E82|0xAB9423A7|0x432AFF97|0xBD3AF235|0xFC93A039|0x655B59C3|0xEB86D391|0x289B7EC6|0xD8A1E681|0x2441453|0xE7D3FBC8|0x21E1CDE6|0xF4D50D87|0xD62F105D|0xE9B6C7AA|toLowerCase|0xA679438E|0xF61E2562|0xC040B340|0x265E5A51|0x455A14ED|0xC33707D6|0x8D2A4C8A|0x676F02D9|0xFFFA3942|0x6D9D6122|0xA4BEEA44|0xFDE5380C||0xFCEFA3F8|0x8771F681|0xA9E3E905'.split('|'),0,{}))
|
wpsc-core/wpsc-constants.php
CHANGED
@@ -28,7 +28,7 @@ function wpsc_core_constants() {
|
|
28 |
// Define Plugin version
|
29 |
define( 'WPSC_VERSION', '3.8' );
|
30 |
define( 'WPSC_MINOR_VERSION', ( '00000' . microtime( true ) ) );
|
31 |
-
define( 'WPSC_PRESENTABLE_VERSION', '3.8
|
32 |
|
33 |
// Define Debug Variables for developers
|
34 |
define( 'WPSC_DEBUG', false );
|
28 |
// Define Plugin version
|
29 |
define( 'WPSC_VERSION', '3.8' );
|
30 |
define( 'WPSC_MINOR_VERSION', ( '00000' . microtime( true ) ) );
|
31 |
+
define( 'WPSC_PRESENTABLE_VERSION', '3.8 RC3' );
|
32 |
|
33 |
// Define Debug Variables for developers
|
34 |
define( 'WPSC_DEBUG', false );
|
wpsc-core/wpsc-functions.php
CHANGED
@@ -816,7 +816,7 @@ class wpsc_products_by_category {
|
|
816 |
|
817 |
|
818 |
// Category stuff for nice URLs
|
819 |
-
if ( (
|
820 |
$q['taxonomy'] = 'wpsc_product_category';
|
821 |
$q['term'] = $q['wpsc_product_category'];
|
822 |
$in_cats = '';
|
816 |
|
817 |
|
818 |
// Category stuff for nice URLs
|
819 |
+
if ( !empty( $q['wpsc_product_category'] ) && !$query->is_singular ) {
|
820 |
$q['taxonomy'] = 'wpsc_product_category';
|
821 |
$q['term'] = $q['wpsc_product_category'];
|
822 |
$in_cats = '';
|
wpsc-includes/ajax.functions.php
CHANGED
@@ -353,7 +353,13 @@ function wpsc_update_shipping_price() {
|
|
353 |
$quote_shipping_method = $_POST['key1'];
|
354 |
$quote_shipping_option = $_POST['key'];
|
355 |
$wpsc_cart->update_shipping( $quote_shipping_method, $quote_shipping_option );
|
356 |
-
echo "
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
echo "jQuery('.pricedisplay.checkout-total').html(\"" . wpsc_cart_total() . "\");\n\r";
|
358 |
exit();
|
359 |
}
|
@@ -511,10 +517,7 @@ function wpsc_submit_checkout() {
|
|
511 |
$options = get_option( 'custom_shipping_options' );
|
512 |
$form_validity = $wpsc_checkout->validate_forms();
|
513 |
extract( $form_validity ); // extracts $is_valid and $error_messages
|
514 |
-
|
515 |
-
$_SESSION['wpsc_checkout_misc_error_messages'][] = __( 'You must select a shipping method, otherwise we cannot process your order.', 'wpsc' );
|
516 |
-
$is_valid = false;
|
517 |
-
}
|
518 |
if ( $_POST['agree'] != 'yes' ) {
|
519 |
$_SESSION['wpsc_checkout_misc_error_messages'][] = __( 'Please agree to the terms and conditions, otherwise we cannot process your order.', 'wpsc' );
|
520 |
$is_valid = false;
|
@@ -548,11 +551,13 @@ function wpsc_submit_checkout() {
|
|
548 |
else
|
549 |
$is_valid = false;
|
550 |
|
551 |
-
if (
|
552 |
-
|
|
|
|
|
|
|
553 |
$_SESSION['categoryAndShippingCountryConflict'] = __( 'Please enter a Zipcode and click calculate to proceed', 'wpsc' );
|
554 |
$is_valid = false;
|
555 |
-
}
|
556 |
}
|
557 |
if ( $is_valid == true ) {
|
558 |
$_SESSION['categoryAndShippingCountryConflict'] = '';
|
@@ -748,6 +753,7 @@ function wpsc_change_tax() {
|
|
748 |
|
749 |
$tax = $wpsc_cart->calculate_total_tax();
|
750 |
$total = wpsc_cart_total();
|
|
|
751 |
if($wpsc_cart->coupons_amount >= wpsc_cart_total() && !empty($wpsc_cart->coupons_amount)){
|
752 |
$total = 0;
|
753 |
}
|
@@ -858,7 +864,8 @@ function wpsc_change_tax() {
|
|
858 |
echo "jQuery(\"tr.total_tax\").hide();\n\r";
|
859 |
}
|
860 |
echo "jQuery('#checkout_tax').html(\"<span class='pricedisplay'>" . wpsc_cart_tax() . "</span>\");\n\r";
|
861 |
-
echo "jQuery('#checkout_total').html(\"
|
|
|
862 |
exit();
|
863 |
}
|
864 |
|
@@ -1062,4 +1069,10 @@ function wpsc_download_file() {
|
|
1062 |
}
|
1063 |
|
1064 |
add_action( 'init', 'wpsc_download_file' );
|
|
|
|
|
|
|
|
|
|
|
|
|
1065 |
?>
|
353 |
$quote_shipping_method = $_POST['key1'];
|
354 |
$quote_shipping_option = $_POST['key'];
|
355 |
$wpsc_cart->update_shipping( $quote_shipping_method, $quote_shipping_option );
|
356 |
+
echo "
|
357 |
+
if(jQuery('.pricedisplay.checkout-shipping .pricedisplay')){
|
358 |
+
jQuery('.pricedisplay.checkout-shipping > .pricedisplay:first').html(\"" . wpsc_cart_shipping() . "\");
|
359 |
+
jQuery('.shoppingcart .pricedisplay.checkout-shipping > .pricedisplay:first').html(\"" . wpsc_cart_shipping() . "\");
|
360 |
+
} else
|
361 |
+
jQuery('.pricedisplay.checkout-shipping').html(\"" . wpsc_cart_shipping() . "\");
|
362 |
+
";
|
363 |
echo "jQuery('.pricedisplay.checkout-total').html(\"" . wpsc_cart_total() . "\");\n\r";
|
364 |
exit();
|
365 |
}
|
517 |
$options = get_option( 'custom_shipping_options' );
|
518 |
$form_validity = $wpsc_checkout->validate_forms();
|
519 |
extract( $form_validity ); // extracts $is_valid and $error_messages
|
520 |
+
|
|
|
|
|
|
|
521 |
if ( $_POST['agree'] != 'yes' ) {
|
522 |
$_SESSION['wpsc_checkout_misc_error_messages'][] = __( 'Please agree to the terms and conditions, otherwise we cannot process your order.', 'wpsc' );
|
523 |
$is_valid = false;
|
551 |
else
|
552 |
$is_valid = false;
|
553 |
|
554 |
+
if ( get_option( 'do_not_use_shipping' ) == 0 && ($wpsc_cart->selected_shipping_method == null || $wpsc_cart->selected_shipping_option == null) && ( $num_items != $disregard_shipping ) ) {
|
555 |
+
$_SESSION['wpsc_checkout_misc_error_messages'][] = __( 'You must select a shipping method, otherwise we cannot process your order.', 'wpsc' );
|
556 |
+
$is_valid = false;
|
557 |
+
}
|
558 |
+
if ( (get_option( 'do_not_use_shipping' ) != 1) && (in_array( 'ups', (array)$options )) && $_SESSION['wpsc_zipcode'] == '' && ( $num_items != $disregard_shipping ) ) {
|
559 |
$_SESSION['categoryAndShippingCountryConflict'] = __( 'Please enter a Zipcode and click calculate to proceed', 'wpsc' );
|
560 |
$is_valid = false;
|
|
|
561 |
}
|
562 |
if ( $is_valid == true ) {
|
563 |
$_SESSION['categoryAndShippingCountryConflict'] = '';
|
753 |
|
754 |
$tax = $wpsc_cart->calculate_total_tax();
|
755 |
$total = wpsc_cart_total();
|
756 |
+
$total_input = wpsc_cart_total(false);
|
757 |
if($wpsc_cart->coupons_amount >= wpsc_cart_total() && !empty($wpsc_cart->coupons_amount)){
|
758 |
$total = 0;
|
759 |
}
|
864 |
echo "jQuery(\"tr.total_tax\").hide();\n\r";
|
865 |
}
|
866 |
echo "jQuery('#checkout_tax').html(\"<span class='pricedisplay'>" . wpsc_cart_tax() . "</span>\");\n\r";
|
867 |
+
echo "jQuery('#checkout_total').html(\"{$total}<input id='shopping_cart_total_price' type='hidden' value='{$total_input}' />\");\n\r";
|
868 |
+
echo "if(jQuery(\"#shippingSameBilling\").is(\":checked\")) wpsc_shipping_same_as_billing();";
|
869 |
exit();
|
870 |
}
|
871 |
|
1069 |
}
|
1070 |
|
1071 |
add_action( 'init', 'wpsc_download_file' );
|
1072 |
+
|
1073 |
+
function wpsc_shipping_same_as_billing(){
|
1074 |
+
$_SESSION['shippingSameBilling'] = $_POST['wpsc_shipping_same_as_billing'];
|
1075 |
+
}
|
1076 |
+
|
1077 |
+
add_action('wp_ajax_wpsc_shipping_same_as_billing', 'wpsc_shipping_same_as_billing');
|
1078 |
?>
|
wpsc-includes/cart.class.php
CHANGED
@@ -1777,7 +1777,7 @@ class wpsc_cart_item {
|
|
1777 |
} while ($file_data['name'] == null);
|
1778 |
}
|
1779 |
|
1780 |
-
$unique_id = sha1(uniqid(rand(),
|
1781 |
if(move_uploaded_file($file_data['tmp_name'], WPSC_USER_UPLOADS_DIR.$file_data['name']) )
|
1782 |
$this->custom_file = array(
|
1783 |
'file_name' => $file_data['name'],
|
1777 |
} while ($file_data['name'] == null);
|
1778 |
}
|
1779 |
|
1780 |
+
$unique_id = sha1(uniqid(rand(),true));
|
1781 |
if(move_uploaded_file($file_data['tmp_name'], WPSC_USER_UPLOADS_DIR.$file_data['name']) )
|
1782 |
$this->custom_file = array(
|
1783 |
'file_name' => $file_data['name'],
|
wpsc-includes/category.functions.php
CHANGED
@@ -249,6 +249,9 @@ function wpsc_display_category_loop($query, $category_html, &$category_branch =
|
|
249 |
if($category_branch === null) {
|
250 |
$category_branch =& $category_count_data;
|
251 |
}
|
|
|
|
|
|
|
252 |
|
253 |
foreach((array)$category_data as $category_row) {
|
254 |
|
249 |
if($category_branch === null) {
|
250 |
$category_branch =& $category_count_data;
|
251 |
}
|
252 |
+
$allowed_tags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array(), 'b'=> array());
|
253 |
+
|
254 |
+
$allowedtags = apply_filters('wpsc_category_description_allowed_tags' , $allowed_tags);
|
255 |
|
256 |
foreach((array)$category_data as $category_row) {
|
257 |
|
wpsc-includes/processing.functions.php
CHANGED
@@ -119,7 +119,7 @@ function wpsc_decrement_claimed_stock($purchase_log_id) {
|
|
119 |
update_post_meta($product_id, '_wpsc_stock', $remaining_stock);
|
120 |
|
121 |
$remaining_stock = $wpdb->get_row($sql_query, ARRAY_A);
|
122 |
-
if($remaining_stock == 0 && get_product_meta($product_id,'
|
123 |
wp_mail(get_option('admin_email'), sprintf(__('%s is out of stock', 'wpsc'), $product->post_title), sprintf(__('Remaining stock of %s is 0. Product was unpublished.', 'wpsc'), $product->post_title) );
|
124 |
$wpdb->query("UPDATE `".$wpdb->posts."` SET `post_status` = 'draft' WHERE `ID` = '{$product_id}'");
|
125 |
}
|
119 |
update_post_meta($product_id, '_wpsc_stock', $remaining_stock);
|
120 |
|
121 |
$remaining_stock = $wpdb->get_row($sql_query, ARRAY_A);
|
122 |
+
if($remaining_stock == 0 && get_product_meta($product_id,'unpublish_when_none_left',true) == 1){
|
123 |
wp_mail(get_option('admin_email'), sprintf(__('%s is out of stock', 'wpsc'), $product->post_title), sprintf(__('Remaining stock of %s is 0. Product was unpublished.', 'wpsc'), $product->post_title) );
|
124 |
$wpdb->query("UPDATE `".$wpdb->posts."` SET `post_status` = 'draft' WHERE `ID` = '{$product_id}'");
|
125 |
}
|
wpsc-includes/product-template.php
CHANGED
@@ -354,8 +354,8 @@ function wpsc_product_variation_price_available($product_id){
|
|
354 |
`p`.`post_type`= "wpsc-product"
|
355 |
AND
|
356 |
`p`.`post_parent` = ' . $product_id . '
|
357 |
-
AND
|
358 |
-
`pm`.`meta_key` =
|
359 |
AND
|
360 |
`p`.`ID` IN (
|
361 |
SELECT `' . $wpdb->postmeta . '`.`post_id` FROM `' . $wpdb->postmeta . '` WHERE `meta_key` = "_wpsc_stock" AND `meta_value` != "0"
|
@@ -576,24 +576,10 @@ function wpsc_current_category_name() {
|
|
576 |
* @return string - the class of the selected category
|
577 |
*/
|
578 |
function wpsc_category_transition() {
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
$previous_product_index = ((int)$wp_query->current_post - 1);
|
584 |
-
|
585 |
-
if ( $previous_product_index >= 0 && isset($wp_query->posts[$previous_product_index]->term_id))
|
586 |
-
$previous_category_id = $wp_query->posts[$previous_product_index]->term_id;
|
587 |
-
else
|
588 |
-
$previous_category_id = 0;
|
589 |
-
|
590 |
-
if(isset($wp_query->post->term_id))
|
591 |
-
$current_category_id = $wp_query->post->term_id;
|
592 |
-
if (( $current_category_id != $previous_category_id )&& $previous_category_id != null)
|
593 |
-
return true;
|
594 |
-
else
|
595 |
-
return false;
|
596 |
-
|
597 |
}
|
598 |
/**
|
599 |
* wpsc show fb like function, check whether to show facebook like
|
354 |
`p`.`post_type`= "wpsc-product"
|
355 |
AND
|
356 |
`p`.`post_parent` = ' . $product_id . '
|
357 |
+
AND
|
358 |
+
`pm`.`meta_key` = "_wpsc_price"
|
359 |
AND
|
360 |
`p`.`ID` IN (
|
361 |
SELECT `' . $wpdb->postmeta . '`.`post_id` FROM `' . $wpdb->postmeta . '` WHERE `meta_key` = "_wpsc_stock" AND `meta_value` != "0"
|
576 |
* @return string - the class of the selected category
|
577 |
*/
|
578 |
function wpsc_category_transition() {
|
579 |
+
//removed because it was not working in 3.8 RC2 see first changest after
|
580 |
+
//http://plugins.trac.wordpress.org/changeset/357529/wp-e-commerce/
|
581 |
+
return false;
|
582 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
583 |
}
|
584 |
/**
|
585 |
* wpsc show fb like function, check whether to show facebook like
|
wpsc-includes/theme.functions.php
CHANGED
@@ -496,7 +496,7 @@ function wpsc_the_category_title($title='', $id=''){
|
|
496 |
$post = get_post($id);
|
497 |
|
498 |
// If its the category page
|
499 |
-
if( wpsc_is_viewable_taxonomy() && isset( $wp_query->posts[0] ) && $wp_query->posts[0]->post_title == $post->post_title && $wp_query->is_archive && !is_admin()){
|
500 |
$category = get_term_by('slug',$wp_query->query_vars['wpsc_product_category'],'wpsc_product_category');
|
501 |
remove_filter('the_title','wpsc_the_category_title');
|
502 |
}
|
@@ -967,19 +967,23 @@ function wpsc_display_products_page( $query ) {
|
|
967 |
list( $wp_query, $temp_wpsc_query ) = array( $temp_wpsc_query, $wp_query );
|
968 |
$GLOBALS['nzshpcrt_activateshpcrt'] = true;
|
969 |
|
970 |
-
//Pretty sure this single_product code is legacy...but fixing it up just in case.
|
971 |
// get the display type for the selected category
|
972 |
if(!empty($temp_wpsc_query->query_vars['term']))
|
973 |
$display_type = wpsc_get_the_category_display($temp_wpsc_query->query_vars['term']);
|
974 |
-
|
975 |
$display_type = wpsc_get_the_category_display($args['wpsc_product_category']);
|
976 |
-
|
977 |
-
|
|
|
978 |
if ( isset( $_SESSION['wpsc_display_type'] ) )
|
979 |
$display_type = $_SESSION['wpsc_display_type'];
|
980 |
|
981 |
ob_start();
|
982 |
-
|
|
|
|
|
|
|
983 |
$is_single = false;
|
984 |
|
985 |
$output = ob_get_contents();
|
@@ -988,7 +992,7 @@ function wpsc_display_products_page( $query ) {
|
|
988 |
list($temp_wpsc_query, $wp_query) = array( $wp_query, $temp_wpsc_query ); // swap the wpsc_query objects back
|
989 |
if ( $is_single == false ) {
|
990 |
$GLOBALS['post'] = $wp_query->post;
|
991 |
-
}
|
992 |
return $output;
|
993 |
}
|
994 |
|
496 |
$post = get_post($id);
|
497 |
|
498 |
// If its the category page
|
499 |
+
if( wpsc_is_viewable_taxonomy() && isset( $wp_query->posts[0] ) && $wp_query->posts[0]->post_title == $post->post_title && $wp_query->is_archive && !is_admin() && isset($wp_query->query_vars['wpsc_product_category'])){
|
500 |
$category = get_term_by('slug',$wp_query->query_vars['wpsc_product_category'],'wpsc_product_category');
|
501 |
remove_filter('the_title','wpsc_the_category_title');
|
502 |
}
|
967 |
list( $wp_query, $temp_wpsc_query ) = array( $temp_wpsc_query, $wp_query );
|
968 |
$GLOBALS['nzshpcrt_activateshpcrt'] = true;
|
969 |
|
970 |
+
// Pretty sure this single_product code is legacy...but fixing it up just in case.
|
971 |
// get the display type for the selected category
|
972 |
if(!empty($temp_wpsc_query->query_vars['term']))
|
973 |
$display_type = wpsc_get_the_category_display($temp_wpsc_query->query_vars['term']);
|
974 |
+
elseif( !empty( $args['wpsc_product_category'] ) )
|
975 |
$display_type = wpsc_get_the_category_display($args['wpsc_product_category']);
|
976 |
+
else
|
977 |
+
$display_type = 'default';
|
978 |
+
|
979 |
if ( isset( $_SESSION['wpsc_display_type'] ) )
|
980 |
$display_type = $_SESSION['wpsc_display_type'];
|
981 |
|
982 |
ob_start();
|
983 |
+
if( 'wpsc-product' == $wp_query->post->post_type && !is_archive() && $wp_query->post_count <= 1 )
|
984 |
+
include( wpsc_get_template_file_path( 'wpsc-single_product.php' ) );
|
985 |
+
else
|
986 |
+
wpsc_include_products_page_template($display_type);
|
987 |
$is_single = false;
|
988 |
|
989 |
$output = ob_get_contents();
|
992 |
list($temp_wpsc_query, $wp_query) = array( $wp_query, $temp_wpsc_query ); // swap the wpsc_query objects back
|
993 |
if ( $is_single == false ) {
|
994 |
$GLOBALS['post'] = $wp_query->post;
|
995 |
+
}
|
996 |
return $output;
|
997 |
}
|
998 |
|
wpsc-merchants/GoogleCheckout-XML.php
CHANGED
@@ -111,7 +111,6 @@ function gateway_google($fromcheckout = false){
|
|
111 |
$cart->AddItem($cartitem["$no"]);
|
112 |
$no++;
|
113 |
}
|
114 |
-
echo '<pre>'.print_r($wpsc_cart,1).'</pre>';
|
115 |
//If there are coupons applied add coupon as a product with negative price
|
116 |
if($wpsc_cart->coupons_amount > 0){
|
117 |
if($google_curr != $local_currency_code) {
|
111 |
$cart->AddItem($cartitem["$no"]);
|
112 |
$no++;
|
113 |
}
|
|
|
114 |
//If there are coupons applied add coupon as a product with negative price
|
115 |
if($wpsc_cart->coupons_amount > 0){
|
116 |
if($google_curr != $local_currency_code) {
|
wpsc-taxes/controllers/taxes_controller.class.php
CHANGED
@@ -104,11 +104,16 @@ class wpec_taxes_controller {
|
|
104 |
* @param: tax_percentage - the percentage you wish to use to calculate the tax
|
105 |
* @return: calculated price
|
106 |
* */
|
107 |
-
function wpec_taxes_calculate_tax( $price, $tax_percentage ) {
|
108 |
$returnable = 0;
|
109 |
|
110 |
if ( !empty( $tax_percentage ) ) {
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
112 |
}// if
|
113 |
|
114 |
return $returnable;
|
@@ -155,7 +160,6 @@ class wpec_taxes_controller {
|
|
155 |
function wpec_taxes_calculate_included_tax( $cart_item ) {
|
156 |
global $wpsc_cart;
|
157 |
$returnable = false;
|
158 |
-
|
159 |
//do not calculate tax for this item if it is not taxable
|
160 |
if(!isset($cart_item->meta[0]['wpec_taxes_taxable']))
|
161 |
{
|
@@ -169,7 +173,7 @@ class wpec_taxes_controller {
|
|
169 |
//get the taxable price - unit price multiplied by qty
|
170 |
$taxable_price = $cart_item->unit_price * $cart_item->quantity;
|
171 |
|
172 |
-
$returnable = array( 'tax' => $this->wpec_taxes_calculate_tax( $taxable_price, $tax_rate ), 'rate' => $tax_rate );
|
173 |
}// if
|
174 |
}// if
|
175 |
|
104 |
* @param: tax_percentage - the percentage you wish to use to calculate the tax
|
105 |
* @return: calculated price
|
106 |
* */
|
107 |
+
function wpec_taxes_calculate_tax( $price, $tax_percentage, $exclusive = true ) {
|
108 |
$returnable = 0;
|
109 |
|
110 |
if ( !empty( $tax_percentage ) ) {
|
111 |
+
if($exclusive)
|
112 |
+
$returnable = $price * ($tax_percentage / 100);
|
113 |
+
else{
|
114 |
+
$returnable = ($price / (100 + $tax_percentage) ) * $tax_percentage;
|
115 |
+
}
|
116 |
+
|
117 |
}// if
|
118 |
|
119 |
return $returnable;
|
160 |
function wpec_taxes_calculate_included_tax( $cart_item ) {
|
161 |
global $wpsc_cart;
|
162 |
$returnable = false;
|
|
|
163 |
//do not calculate tax for this item if it is not taxable
|
164 |
if(!isset($cart_item->meta[0]['wpec_taxes_taxable']))
|
165 |
{
|
173 |
//get the taxable price - unit price multiplied by qty
|
174 |
$taxable_price = $cart_item->unit_price * $cart_item->quantity;
|
175 |
|
176 |
+
$returnable = array( 'tax' => $this->wpec_taxes_calculate_tax( $taxable_price, $tax_rate, false ), 'rate' => $tax_rate );
|
177 |
}// if
|
178 |
}// if
|
179 |
|
wpsc-theme/functions/wpsc-user_log_functions.php
CHANGED
@@ -348,6 +348,9 @@ function wpsc_user_details() {
|
|
348 |
$nzshpcrt_gateways = nzshpcrt_get_gateways();
|
349 |
$i = 0;
|
350 |
$subtotal = 0;
|
|
|
|
|
|
|
351 |
foreach ( (array)$purchase_log as $purchase ) {
|
352 |
$status_state = "expand";
|
353 |
$status_style = "display:none;";
|
@@ -420,6 +423,8 @@ function wpsc_user_details() {
|
|
420 |
echo " <strong class='form_group'>" . __( 'Order Status', 'wpsc' ) . ":</strong>\n\r";
|
421 |
echo $status_name . "<br /><br />";
|
422 |
|
|
|
|
|
423 |
//written by allen
|
424 |
$usps_id = get_option( 'usps_user_id' );
|
425 |
if ( $usps_id != null ) {
|
@@ -489,6 +494,7 @@ function wpsc_user_details() {
|
|
489 |
|
490 |
echo "</tr>";
|
491 |
|
|
|
492 |
$endtotal = $total_shipping = 0;
|
493 |
foreach ( (array)$cart_log as $cart_row ) {
|
494 |
$alternate = "";
|
@@ -522,9 +528,8 @@ function wpsc_user_details() {
|
|
522 |
|
523 |
echo " <td>";
|
524 |
$gst = $cart_row['tax_charged'];
|
525 |
-
if($gst > 0)
|
526 |
-
$
|
527 |
-
|
528 |
echo wpsc_currency_display( $gst , array('display_as_html' => false) );
|
529 |
echo " </td>";
|
530 |
|
@@ -563,7 +568,11 @@ function wpsc_user_details() {
|
|
563 |
$endtotal += $total_shipping;
|
564 |
$endtotal += $purchase['wpec_taxes_total'];
|
565 |
echo wpsc_currency_display( $total_shipping, array('display_as_html' => false) ) . "<br />";
|
566 |
-
|
|
|
|
|
|
|
|
|
567 |
echo wpsc_currency_display( $endtotal , array('display_as_html' => false) );
|
568 |
echo " </td>";
|
569 |
|
@@ -605,7 +614,7 @@ function wpsc_user_details() {
|
|
605 |
echo " <tr><td>" . $form_field['name'] . ":</td><td>".$state ."</td></tr>";
|
606 |
break;
|
607 |
default:
|
608 |
-
echo " <tr><td>" . $form_field['name'] . ":</td><td>" . $form_field['value'] . "</td></tr>";
|
609 |
|
610 |
}
|
611 |
}
|
348 |
$nzshpcrt_gateways = nzshpcrt_get_gateways();
|
349 |
$i = 0;
|
350 |
$subtotal = 0;
|
351 |
+
|
352 |
+
do_action( 'wpsc_pre_purchase_logs' );
|
353 |
+
|
354 |
foreach ( (array)$purchase_log as $purchase ) {
|
355 |
$status_state = "expand";
|
356 |
$status_style = "display:none;";
|
423 |
echo " <strong class='form_group'>" . __( 'Order Status', 'wpsc' ) . ":</strong>\n\r";
|
424 |
echo $status_name . "<br /><br />";
|
425 |
|
426 |
+
do_action( 'wpsc_user_log_after_order_status', $purchase );
|
427 |
+
|
428 |
//written by allen
|
429 |
$usps_id = get_option( 'usps_user_id' );
|
430 |
if ( $usps_id != null ) {
|
494 |
|
495 |
echo "</tr>";
|
496 |
|
497 |
+
$gsttotal = false;
|
498 |
$endtotal = $total_shipping = 0;
|
499 |
foreach ( (array)$cart_log as $cart_row ) {
|
500 |
$alternate = "";
|
528 |
|
529 |
echo " <td>";
|
530 |
$gst = $cart_row['tax_charged'];
|
531 |
+
if( $gst > 0)
|
532 |
+
$gsttotal += $gst;
|
|
|
533 |
echo wpsc_currency_display( $gst , array('display_as_html' => false) );
|
534 |
echo " </td>";
|
535 |
|
568 |
$endtotal += $total_shipping;
|
569 |
$endtotal += $purchase['wpec_taxes_total'];
|
570 |
echo wpsc_currency_display( $total_shipping, array('display_as_html' => false) ) . "<br />";
|
571 |
+
if ( $gsttotal ){ //if false then must be exclusive.. doesnt seem too reliable needs more testing
|
572 |
+
echo wpsc_currency_display( $gsttotal , array('display_as_html' => false) ). "<br />";
|
573 |
+
} else {
|
574 |
+
echo wpsc_currency_display( $purchase['wpec_taxes_total'] , array('display_as_html' => false) ). "<br />";
|
575 |
+
}
|
576 |
echo wpsc_currency_display( $endtotal , array('display_as_html' => false) );
|
577 |
echo " </td>";
|
578 |
|
614 |
echo " <tr><td>" . $form_field['name'] . ":</td><td>".$state ."</td></tr>";
|
615 |
break;
|
616 |
default:
|
617 |
+
echo " <tr><td>" . $form_field['name'] . ":</td><td>" . esc_html( $form_field['value'] ) . "</td></tr>";
|
618 |
|
619 |
}
|
620 |
}
|
wpsc-theme/wpsc-products_page.php
CHANGED
@@ -63,12 +63,7 @@ global $wp_query;
|
|
63 |
|
64 |
<?php /** start the product loop here */?>
|
65 |
<?php while (wpsc_have_products()) : wpsc_the_product(); ?>
|
66 |
-
|
67 |
-
|
68 |
-
<?php if(wpsc_category_transition()) :?>
|
69 |
-
<h3 class="wpsc_category_name"><?php echo wpsc_current_category_name(); ?></h3>
|
70 |
-
<?php endif; ?>
|
71 |
-
|
72 |
<div class="default_product_display product_view_<?php echo wpsc_the_product_id(); ?> <?php echo wpsc_category_class(); ?> group">
|
73 |
<h2 class="prodtitle entry-title">
|
74 |
<?php if(get_option('hide_name_link') == 1) : ?>
|
63 |
|
64 |
<?php /** start the product loop here */?>
|
65 |
<?php while (wpsc_have_products()) : wpsc_the_product(); ?>
|
66 |
+
|
|
|
|
|
|
|
|
|
|
|
67 |
<div class="default_product_display product_view_<?php echo wpsc_the_product_id(); ?> <?php echo wpsc_category_class(); ?> group">
|
68 |
<h2 class="prodtitle entry-title">
|
69 |
<?php if(get_option('hide_name_link') == 1) : ?>
|
wpsc-theme/wpsc-shopping_cart_page.php
CHANGED
@@ -301,10 +301,9 @@ endif;
|
|
301 |
$_SESSION['shippingSameBilling'] = true;
|
302 |
elseif(isset($_POST['submit']) && !isset($_POST['shippingSameBilling']))
|
303 |
$_SESSION['shippingSameBilling'] = false;
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
$checked = 'checked="checked"';
|
308 |
?>
|
309 |
<label for='shippingSameBilling'><?php _e('Same as billing address:','wpsc'); ?></label>
|
310 |
<input type='checkbox' value='true' name='shippingSameBilling' id='shippingSameBilling' <?php echo $checked; ?> />
|
301 |
$_SESSION['shippingSameBilling'] = true;
|
302 |
elseif(isset($_POST['submit']) && !isset($_POST['shippingSameBilling']))
|
303 |
$_SESSION['shippingSameBilling'] = false;
|
304 |
+
|
305 |
+
if($_SESSION['shippingSameBilling'] == 'true')
|
306 |
+
$checked = 'checked="checked"';
|
|
|
307 |
?>
|
308 |
<label for='shippingSameBilling'><?php _e('Same as billing address:','wpsc'); ?></label>
|
309 |
<input type='checkbox' value='true' name='shippingSameBilling' id='shippingSameBilling' <?php echo $checked; ?> />
|