Version Description
Download this release
Release Info
Developer | valentinas |
Plugin | WP eCommerce |
Version | 3.8.RC.1 |
Comparing to | |
See all releases |
Code changes from version 3.8.Public.Beta.3 to 3.8.RC.1
- wpsc-admin/admin-form-functions.php +4 -4
- wpsc-admin/admin.php +44 -12
- wpsc-admin/ajax-and-init.php +61 -46
- wpsc-admin/css/admin.css +7 -1
- wpsc-admin/display-items.page.php +22 -10
- wpsc-admin/display-sales-logs.php +20 -17
- wpsc-admin/display-update.page.php +7 -7
- wpsc-admin/display-variations.page.php +1 -1
- wpsc-admin/includes/display-items-functions.php +457 -443
- wpsc-admin/includes/product-functions.php +24 -15
- wpsc-admin/includes/products.php +12 -9
- wpsc-admin/includes/settings-pages/general.php +1 -2
- wpsc-admin/includes/settings-pages/import.php +5 -5
- wpsc-admin/includes/settings-pages/marketing.php +1 -1
- wpsc-admin/includes/settings-pages/presentation.php +12 -7
- wpsc-admin/includes/settings-pages/taxes.php +4 -4
- wpsc-admin/includes/updating-functions.php +2 -2
- wpsc-admin/js/admin.js +56 -30
- wpsc-core/js/tinymce3/window.php +1 -1
- wpsc-core/js/wp-e-commerce.js +92 -60
- wpsc-core/wpsc-constants.php +2 -1
- wpsc-core/wpsc-deprecated.php +51 -87
- wpsc-core/wpsc-functions.php +106 -62
- wpsc-core/wpsc-installer.php +83 -51
- wpsc-includes/ajax.functions.php +5 -5
- wpsc-includes/breadcrumbs.class.php +11 -8
- wpsc-includes/cart.class.php +3 -4
- wpsc-includes/category.functions.php +68 -24
- wpsc-includes/checkout.class.php +17 -17
- wpsc-includes/display.functions.php +14 -7
- wpsc-includes/processing.functions.php +3 -2
- wpsc-includes/product-template.php +19 -43
- wpsc-includes/purchaselogs.class.php +14 -10
- wpsc-includes/shopping_cart_functions.php +2 -2
- wpsc-includes/theme.functions.php +45 -47
- wpsc-includes/theming.class.php +5 -3
- wpsc-merchants/library/googlerequest.php +15 -15
- wpsc-merchants/library/xml-processing/gc_xmlbuilder.php +4 -4
- wpsc-merchants/paypal-pro.merchant.php +1 -1
- wpsc-merchants/paypal-standard.merchant.php +13 -7
- wpsc-shipping/australiapost.php +10 -8
- wpsc-shipping/weightrate.php +1 -1
- wpsc-taxes/controllers/taxes_controller.class.php +22 -10
- wpsc-taxes/models/taxes.class.php +28 -4
- wpsc-taxes/taxes_module.php +5 -0
- wpsc-theme/functions/wpsc-transaction_results_functions.php +23 -15
- wpsc-theme/functions/wpsc-user_log_functions.php +4 -17
- wpsc-theme/wpsc-cart_widget.php +1 -1
- wpsc-theme/wpsc-category-list.php +19 -0
- wpsc-theme/wpsc-category_widget.php +1 -1
- wpsc-theme/wpsc-default.css +34 -170
- wpsc-theme/wpsc-grid_view.php +3 -3
- wpsc-theme/wpsc-list_view.php +2 -2
- wpsc-theme/wpsc-products_page.php +18 -15
- wpsc-theme/wpsc-shopping_cart_page.php +37 -15
- wpsc-theme/wpsc-single_product.php +5 -21
- wpsc-theme/wpsc-transaction_results.php +1 -1
- wpsc-updates/currency_list.php +153 -153
- wpsc-widgets/category_widget.php +1 -1
wpsc-admin/admin-form-functions.php
CHANGED
@@ -327,7 +327,7 @@ function wpsc_packing_slip($purchase_id) {
|
|
327 |
if(is_numeric($purch_data['billing_region']) && ($delivery_region_count > 0))
|
328 |
echo " <tr><td>".__('State', 'wpsc').":</td><td>".wpsc_get_region($purch_data['billing_region'])."</td></tr>\n\r";
|
329 |
|
330 |
-
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($rekeyed_input[$form_field['id']]['value']), ENT_QUOTES)."</td></tr>\n\r";
|
331 |
break;
|
332 |
|
333 |
case 'delivery_country':
|
@@ -335,7 +335,7 @@ function wpsc_packing_slip($purchase_id) {
|
|
335 |
if(is_numeric($purch_data['shipping_region']) && ($delivery_region_count > 0))
|
336 |
echo " <tr><td>".__('State', 'wpsc').":</td><td>".wpsc_get_region($purch_data['shipping_region'])."</td></tr>\n\r";
|
337 |
|
338 |
-
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($rekeyed_input[$form_field['id']]['value']), ENT_QUOTES)."</td></tr>\n\r";
|
339 |
break;
|
340 |
|
341 |
case 'heading':
|
@@ -358,14 +358,14 @@ function wpsc_packing_slip($purchase_id) {
|
|
358 |
|
359 |
}
|
360 |
$string = rtrim($string, ", ");
|
361 |
-
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($string), ENT_QUOTES)."</td></tr>\n\r";
|
362 |
|
363 |
} else {
|
364 |
|
365 |
if ($form_field['name']=="State" && !empty($purch_data['billing_region']) || $form_field['name']=="State" && !empty($purch_data['billing_region']))
|
366 |
echo "";
|
367 |
else
|
368 |
-
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($rekeyed_input[$form_field['id']]['value']), ENT_QUOTES)."</td></tr>\n\r";
|
369 |
|
370 |
}
|
371 |
|
327 |
if(is_numeric($purch_data['billing_region']) && ($delivery_region_count > 0))
|
328 |
echo " <tr><td>".__('State', 'wpsc').":</td><td>".wpsc_get_region($purch_data['billing_region'])."</td></tr>\n\r";
|
329 |
|
330 |
+
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($rekeyed_input[$form_field['id']]['value']), ENT_QUOTES, 'UTF-8')."</td></tr>\n\r";
|
331 |
break;
|
332 |
|
333 |
case 'delivery_country':
|
335 |
if(is_numeric($purch_data['shipping_region']) && ($delivery_region_count > 0))
|
336 |
echo " <tr><td>".__('State', 'wpsc').":</td><td>".wpsc_get_region($purch_data['shipping_region'])."</td></tr>\n\r";
|
337 |
|
338 |
+
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($rekeyed_input[$form_field['id']]['value']), ENT_QUOTES, 'UTF-8')."</td></tr>\n\r";
|
339 |
break;
|
340 |
|
341 |
case 'heading':
|
358 |
|
359 |
}
|
360 |
$string = rtrim($string, ", ");
|
361 |
+
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($string), ENT_QUOTES, 'UTF-8')."</td></tr>\n\r";
|
362 |
|
363 |
} else {
|
364 |
|
365 |
if ($form_field['name']=="State" && !empty($purch_data['billing_region']) || $form_field['name']=="State" && !empty($purch_data['billing_region']))
|
366 |
echo "";
|
367 |
else
|
368 |
+
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($rekeyed_input[$form_field['id']]['value'], 'UTF-8'), ENT_QUOTES)."</td></tr>\n\r";
|
369 |
|
370 |
}
|
371 |
|
wpsc-admin/admin.php
CHANGED
@@ -34,7 +34,39 @@ if ( !get_option( 'wpsc_checkout_form_sets' ) ) {
|
|
34 |
$form_sets = array( 'Default Checkout Forms' );
|
35 |
update_option( 'wpsc_checkout_form_sets', $form_sets );
|
36 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
/**
|
39 |
* Checks whether to display or hide the update wp-e-commerce link
|
40 |
*
|
@@ -224,23 +256,23 @@ function wpsc_meta_boxes() {
|
|
224 |
remove_meta_box( 'wpsc-variationdiv', 'wpsc-product', 'core' );
|
225 |
|
226 |
//if a variation page do not show these metaboxes
|
227 |
-
if ( $post->post_parent == 0 ) {
|
228 |
-
add_meta_box( 'wpsc_product_variation_forms', 'Variations', 'wpsc_product_variation_forms', $pagename, 'normal', 'high' );
|
229 |
-
add_meta_box( 'wpsc_product_external_link_forms', 'Off Site Product link', 'wpsc_product_external_link_forms', $pagename, 'normal', 'high' );
|
230 |
}else {
|
231 |
remove_meta_box( 'tagsdiv-product_tag', 'wpsc-product', 'core' );
|
232 |
remove_meta_box( 'wpsc_product_external_link_forms', 'wpsc-product', 'core' );
|
233 |
remove_meta_box( 'wpsc_product_categorydiv', 'wpsc-product', 'core' );
|
234 |
}
|
235 |
|
236 |
-
add_meta_box( 'wpsc_price_control_forms', 'Price Control', 'wpsc_price_control_forms', $pagename, 'side', 'low' );
|
237 |
-
add_meta_box( 'wpsc_stock_control_forms', 'Stock Control', 'wpsc_stock_control_forms', $pagename, 'side', 'low' );
|
238 |
-
add_meta_box( 'wpsc_product_taxes_forms', 'Taxes', 'wpsc_product_taxes_forms', $pagename, 'side', 'low' );
|
239 |
-
add_meta_box( 'wpsc_additional_desc', 'Additional Description', 'wpsc_additional_desc', $pagename, 'normal', 'high' );
|
240 |
-
add_meta_box( 'wpsc_product_download_forms', 'Product Download', 'wpsc_product_download_forms', $pagename, 'normal', 'high' );
|
241 |
-
add_meta_box( 'wpsc_product_image_forms', 'Product Images', 'wpsc_product_image_forms', $pagename, 'normal', 'high' );
|
242 |
-
add_meta_box( 'wpsc_product_shipping_forms', 'Shipping', 'wpsc_product_shipping_forms', $pagename, 'normal', 'high' );
|
243 |
-
add_meta_box( 'wpsc_product_advanced_forms', 'Advanced Settings', 'wpsc_product_advanced_forms', $pagename, 'normal', 'high' );
|
244 |
|
245 |
}
|
246 |
|
@@ -734,7 +766,7 @@ function wpec_two_columns( $columns, $screen ) {
|
|
734 |
add_filter( 'screen_layout_columns', 'wpec_two_columns', 10, 2 );
|
735 |
|
736 |
function wpsc_fav_action( $actions ) {
|
737 |
-
$actions['
|
738 |
return $actions;
|
739 |
}
|
740 |
add_filter( 'favorite_actions', 'wpsc_fav_action' );
|
34 |
$form_sets = array( 'Default Checkout Forms' );
|
35 |
update_option( 'wpsc_checkout_form_sets', $form_sets );
|
36 |
}
|
37 |
+
/**
|
38 |
+
* wpsc_query_vars_product_list sets the ordering for the edit-products page list
|
39 |
+
* @access public
|
40 |
+
*
|
41 |
+
* @since 3.8
|
42 |
+
* @param $vars (array) - default query arguments
|
43 |
+
* @return $vars (array) - modified query arguments
|
44 |
+
*/
|
45 |
+
function wpsc_query_vars_product_list($vars){
|
46 |
|
47 |
+
if(is_admin() && isset($vars['post_type']) && 'wpsc-product' == $vars['post_type'] && isset($vars['orderby'])){
|
48 |
+
$vars['orderby'] = 'date';
|
49 |
+
$vars['order'] = 'desc';
|
50 |
+
}
|
51 |
+
if( 'dragndrop' == get_option('wpsc_sort_by') ){
|
52 |
+
$vars['orderby'] = 'menu_order title';
|
53 |
+
$vars['order'] = 'desc';
|
54 |
+
$vars['nopaging'] = true;
|
55 |
+
}
|
56 |
+
return $vars;
|
57 |
+
}
|
58 |
+
function wpsc_drag_and_drop_ordering($per_page, $post_type){
|
59 |
+
global $wpdb;
|
60 |
+
if('wpsc-product' == $post_type && 'dragndrop' == get_option('wpsc_sort_by') ){
|
61 |
+
$per_page = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->posts} WHERE `post_type`='wpsc-product' AND `post_parent`=0");
|
62 |
+
return $per_page;
|
63 |
+
}else{
|
64 |
+
return $per_page;
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
68 |
+
add_filter( 'request', 'wpsc_query_vars_product_list' );
|
69 |
+
add_filter('edit_posts_per_page' , 'wpsc_drag_and_drop_ordering', 10, 2 );
|
70 |
/**
|
71 |
* Checks whether to display or hide the update wp-e-commerce link
|
72 |
*
|
256 |
remove_meta_box( 'wpsc-variationdiv', 'wpsc-product', 'core' );
|
257 |
|
258 |
//if a variation page do not show these metaboxes
|
259 |
+
if (is_object($post) && $post->post_parent == 0 ) {
|
260 |
+
add_meta_box( 'wpsc_product_variation_forms', __('Variations', 'wpsc'), 'wpsc_product_variation_forms', $pagename, 'normal', 'high' );
|
261 |
+
add_meta_box( 'wpsc_product_external_link_forms', __('Off Site Product link', 'wpsc'), 'wpsc_product_external_link_forms', $pagename, 'normal', 'high' );
|
262 |
}else {
|
263 |
remove_meta_box( 'tagsdiv-product_tag', 'wpsc-product', 'core' );
|
264 |
remove_meta_box( 'wpsc_product_external_link_forms', 'wpsc-product', 'core' );
|
265 |
remove_meta_box( 'wpsc_product_categorydiv', 'wpsc-product', 'core' );
|
266 |
}
|
267 |
|
268 |
+
add_meta_box( 'wpsc_price_control_forms', __('Price Control', 'wpsc'), 'wpsc_price_control_forms', $pagename, 'side', 'low' );
|
269 |
+
add_meta_box( 'wpsc_stock_control_forms', __('Stock Control', 'wpsc'), 'wpsc_stock_control_forms', $pagename, 'side', 'low' );
|
270 |
+
add_meta_box( 'wpsc_product_taxes_forms', __('Taxes', 'wpsc'), 'wpsc_product_taxes_forms', $pagename, 'side', 'low' );
|
271 |
+
add_meta_box( 'wpsc_additional_desc', __('Additional Description', 'wpsc'), 'wpsc_additional_desc', $pagename, 'normal', 'high' );
|
272 |
+
add_meta_box( 'wpsc_product_download_forms', __('Product Download', 'wpsc'), 'wpsc_product_download_forms', $pagename, 'normal', 'high' );
|
273 |
+
add_meta_box( 'wpsc_product_image_forms', __('Product Images', 'wpsc'), 'wpsc_product_image_forms', $pagename, 'normal', 'high' );
|
274 |
+
add_meta_box( 'wpsc_product_shipping_forms', __('Shipping', 'wpsc'), 'wpsc_product_shipping_forms', $pagename, 'normal', 'high' );
|
275 |
+
add_meta_box( 'wpsc_product_advanced_forms', __('Advanced Settings', 'wpsc'), 'wpsc_product_advanced_forms', $pagename, 'normal', 'high' );
|
276 |
|
277 |
}
|
278 |
|
766 |
add_filter( 'screen_layout_columns', 'wpec_two_columns', 10, 2 );
|
767 |
|
768 |
function wpsc_fav_action( $actions ) {
|
769 |
+
$actions['post-new.php?post_type=wpsc-product'] = array( 'New Product', 'manage_options' );
|
770 |
return $actions;
|
771 |
}
|
772 |
add_filter( 'favorite_actions', 'wpsc_fav_action' );
|
wpsc-admin/ajax-and-init.php
CHANGED
@@ -219,7 +219,7 @@ function wpsc_modify_weight() {
|
|
219 |
$old_array = get_product_meta( $product_id, 'product_metadata' );
|
220 |
$old_array = array_pop( $old_array );
|
221 |
|
222 |
-
$weight = wpsc_convert_weight( $product_data['weight'], $old_array["weight_unit"], "
|
223 |
|
224 |
foreach ( $old_array as $key => $value ) {
|
225 |
if ( $key == 'weight' ) {
|
@@ -229,7 +229,7 @@ function wpsc_modify_weight() {
|
|
229 |
|
230 |
if ( update_product_meta( $product_id, 'product_metadata', $old_array ) ) {
|
231 |
echo "success = 1;\n\r";
|
232 |
-
echo "new_price = '" . wpsc_convert_weight( $weight, "
|
233 |
} else {
|
234 |
echo "success = 0;\n\r";
|
235 |
}
|
@@ -452,71 +452,71 @@ if ( isset( $_GET['wpsc_admin_action'] ) && ($_GET['wpsc_admin_action'] == 'dupl
|
|
452 |
}
|
453 |
|
454 |
function wpsc_purchase_log_csv() {
|
455 |
-
global $wpdb, $user_level, $wp_rewrite, $wpsc_purchlog_statuses;
|
456 |
get_currentuserinfo();
|
457 |
-
|
458 |
-
|
|
|
459 |
$form_data = $wpdb->get_results( $form_sql, ARRAY_A );
|
460 |
|
461 |
$start_timestamp = $_GET['start_timestamp'];
|
462 |
$end_timestamp = $_GET['end_timestamp'];
|
463 |
$data = $wpdb->get_results( "SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `date` BETWEEN '$start_timestamp' AND '$end_timestamp' ORDER BY `date` DESC", ARRAY_A );
|
464 |
-
|
465 |
header( 'Content-Type: text/csv' );
|
466 |
header( 'Content-Disposition: inline; filename="Purchase Log ' . date( "M-d-Y", $start_timestamp ) . ' to ' . date( "M-d-Y", $end_timestamp ) . '.csv"' );
|
|
|
|
|
|
|
|
|
|
|
467 |
|
468 |
foreach ( (array)$data as $purchase ) {
|
|
|
469 |
$country_sql = "SELECT * FROM `" . WPSC_TABLE_SUBMITED_FORM_DATA . "` WHERE `log_id` = '" . $purchase['id'] . "' AND `form_id` = '" . get_option( 'country_form_field' ) . "' LIMIT 1";
|
470 |
$country_data = $wpdb->get_results( $country_sql, ARRAY_A );
|
471 |
$country = $country_data[0]['value'];
|
472 |
-
|
473 |
-
$output .= "\"" . $purchase['totalprice'] . "\",";
|
474 |
-
|
475 |
foreach ( (array)$form_data as $form_field ) {
|
|
|
476 |
$collected_data_sql = "SELECT * FROM `" . WPSC_TABLE_SUBMITED_FORM_DATA . "` WHERE `log_id` = '" . $purchase['id'] . "' AND `form_id` = '" . $form_field['id'] . "' LIMIT 1";
|
477 |
$collected_data = $wpdb->get_results( $collected_data_sql, ARRAY_A );
|
478 |
$collected_data = $collected_data[0];
|
479 |
-
$output .= "\"" . $collected_data['value'] . "\",";
|
480 |
-
}
|
481 |
-
|
482 |
-
if ( get_option( 'payment_method' ) == 2 ) {
|
483 |
-
$gateway_name = '';
|
484 |
-
$nzshpcrt_gateways = nzshpcrt_get_gateways();
|
485 |
-
|
486 |
-
foreach ( $nzshpcrt_gateways as $gateway ) {
|
487 |
-
if ( $purchase['gateway'] != 'testmode' ) {
|
488 |
-
if ( $gateway['internalname'] == $purchase['gateway'] ) {
|
489 |
-
$gateway_name = $gateway['name'];
|
490 |
-
}
|
491 |
-
} else {
|
492 |
-
$gateway_name = "Manual Payment";
|
493 |
-
}
|
494 |
-
}
|
495 |
-
$output .= "\"" . $gateway_name . "\",";
|
496 |
-
}
|
497 |
-
|
498 |
-
if ( $purchase['processed'] < 1 ) {
|
499 |
-
$purchase['processed'] = 1;
|
500 |
}
|
|
|
|
|
501 |
|
|
|
502 |
$status_name = wpsc_find_purchlog_status_name( $purchase['processed'] );
|
503 |
-
|
504 |
-
|
505 |
-
$output .= "\"" . date( "jS M Y", $purchase['date'] ) . "\"";
|
506 |
|
507 |
-
$cartsql = "SELECT
|
508 |
$cart = $wpdb->get_results( $cartsql, ARRAY_A );
|
509 |
|
|
|
|
|
|
|
510 |
foreach ( (array)$cart as $item ) {
|
511 |
-
$output .= ",";
|
512 |
-
$product = $wpdb->get_row( "SELECT * FROM `" . $wpdb->posts . "` WHERE `id`=" . $item['prodid'] . " LIMIT 1", ARRAY_A );
|
513 |
$skuvalue = get_product_meta($item['prodid'], 'sku', true);
|
514 |
-
$
|
515 |
-
$output .= "," .
|
|
|
516 |
}
|
517 |
$output .= "\n"; // terminates the row/line in the CSV file
|
518 |
}
|
519 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
520 |
exit();
|
521 |
}
|
522 |
}
|
@@ -863,8 +863,7 @@ function wpsc_save_product_order() {
|
|
863 |
global $wpdb;
|
864 |
|
865 |
$products = array( );
|
866 |
-
|
867 |
-
foreach ( $_POST['post'] as $product ) {
|
868 |
$products[] = absint( $product );
|
869 |
}
|
870 |
|
@@ -1685,21 +1684,29 @@ if ( isset( $_REQUEST['wpsc_admin_action'] ) && ($_REQUEST['wpsc_admin_action']
|
|
1685 |
add_action( 'admin_init', 'wpsc_settings_page_ajax' );
|
1686 |
|
1687 |
function wpsc_update_variations() {
|
|
|
|
|
|
|
|
|
|
|
1688 |
//Setup postdata
|
1689 |
$post_data = array( );
|
1690 |
$post_data['edit_var_val'] = $_POST["edit_var_val"];
|
1691 |
$post_data['description'] = $_POST["description"];
|
1692 |
$post_data['additional_description'] = $_POST['additional_description'];
|
1693 |
-
$post_data['name'] = $_POST[
|
1694 |
-
$product_id = absint( $_POST["product_id"] );
|
1695 |
|
1696 |
//Add or delete variations
|
1697 |
wpsc_edit_product_variations( $product_id, $post_data );
|
1698 |
-
|
1699 |
-
|
|
|
|
|
1700 |
}
|
1701 |
-
|
|
|
1702 |
add_action( 'admin_init', 'wpsc_update_variations', 50 );
|
|
|
1703 |
|
1704 |
function wpsc_delete_variation_set() {
|
1705 |
global $wpdb;
|
@@ -1892,6 +1899,14 @@ function variation_price_field( $variation ) {
|
|
1892 |
<input type="text" name="variation_price" id="variation_price" style="width:50px;" value="<?php echo $price; ?>"><br />
|
1893 |
<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>
|
1894 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1895 |
<?php
|
1896 |
} else{
|
1897 |
?>
|
219 |
$old_array = get_product_meta( $product_id, 'product_metadata' );
|
220 |
$old_array = array_pop( $old_array );
|
221 |
|
222 |
+
$weight = wpsc_convert_weight( $product_data['weight'], $old_array["weight_unit"], "pound" );
|
223 |
|
224 |
foreach ( $old_array as $key => $value ) {
|
225 |
if ( $key == 'weight' ) {
|
229 |
|
230 |
if ( update_product_meta( $product_id, 'product_metadata', $old_array ) ) {
|
231 |
echo "success = 1;\n\r";
|
232 |
+
echo "new_price = '" . wpsc_convert_weight( $weight, "pound", $old_array["weight_unit"] ) . "';\n\r";
|
233 |
} else {
|
234 |
echo "success = 0;\n\r";
|
235 |
}
|
452 |
}
|
453 |
|
454 |
function wpsc_purchase_log_csv() {
|
455 |
+
global $wpdb, $user_level, $wp_rewrite, $wpsc_purchlog_statuses, $wpsc_gateways;
|
456 |
get_currentuserinfo();
|
457 |
+
$count = 0;
|
458 |
+
if ( ($_GET['rss_key'] == 'key') && is_numeric( $_GET['start_timestamp'] ) && is_numeric( $_GET['end_timestamp'] ) && (current_user_can('edit_post')) ) {
|
459 |
+
$form_sql = "SELECT * FROM `" . WPSC_TABLE_CHECKOUT_FORMS . "` WHERE `active` = '1' AND `type` != 'heading' ORDER BY `checkout_order` DESC;";
|
460 |
$form_data = $wpdb->get_results( $form_sql, ARRAY_A );
|
461 |
|
462 |
$start_timestamp = $_GET['start_timestamp'];
|
463 |
$end_timestamp = $_GET['end_timestamp'];
|
464 |
$data = $wpdb->get_results( "SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `date` BETWEEN '$start_timestamp' AND '$end_timestamp' ORDER BY `date` DESC", ARRAY_A );
|
465 |
+
$csv = 'Purchase ID, Price, Firstname, Lastname, Email, Order Status, Data, ';
|
466 |
header( 'Content-Type: text/csv' );
|
467 |
header( 'Content-Disposition: inline; filename="Purchase Log ' . date( "M-d-Y", $start_timestamp ) . ' to ' . date( "M-d-Y", $end_timestamp ) . '.csv"' );
|
468 |
+
$headers = "\"Purchase ID\",\"Purchase Total\","; //capture the headers
|
469 |
+
|
470 |
+
$headers2 ="\"Payment Gateway\",";
|
471 |
+
$headers2 .="\"Payment Status\",\"Purchase Date\",";
|
472 |
+
|
473 |
|
474 |
foreach ( (array)$data as $purchase ) {
|
475 |
+
$form_headers = '';
|
476 |
$country_sql = "SELECT * FROM `" . WPSC_TABLE_SUBMITED_FORM_DATA . "` WHERE `log_id` = '" . $purchase['id'] . "' AND `form_id` = '" . get_option( 'country_form_field' ) . "' LIMIT 1";
|
477 |
$country_data = $wpdb->get_results( $country_sql, ARRAY_A );
|
478 |
$country = $country_data[0]['value'];
|
479 |
+
$output .= "\"" . $purchase['id'] . "\","; //Purchase ID
|
480 |
+
$output .= "\"" . $purchase['totalprice'] . "\","; //Purchase Total
|
|
|
481 |
foreach ( (array)$form_data as $form_field ) {
|
482 |
+
$form_headers .="\"".$form_field['unique_name']."\",";
|
483 |
$collected_data_sql = "SELECT * FROM `" . WPSC_TABLE_SUBMITED_FORM_DATA . "` WHERE `log_id` = '" . $purchase['id'] . "' AND `form_id` = '" . $form_field['id'] . "' LIMIT 1";
|
484 |
$collected_data = $wpdb->get_results( $collected_data_sql, ARRAY_A );
|
485 |
$collected_data = $collected_data[0];
|
486 |
+
$output .= "\"" . $collected_data['value'] . "\","; // get form fields
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
487 |
}
|
488 |
+
|
489 |
+
$output .= "\"" . $wpsc_gateways[$purchase['gateway']]['display_name'] . "\","; //get gateway name
|
490 |
|
491 |
+
|
492 |
$status_name = wpsc_find_purchlog_status_name( $purchase['processed'] );
|
493 |
+
|
494 |
+
$output .= "\"" . $status_name . "\","; //get purchase status
|
495 |
+
$output .= "\"" . date( "jS M Y", $purchase['date'] ) . "\","; //date
|
496 |
|
497 |
+
$cartsql = "SELECT `prodid`, `quantity`, `name` FROM `" . WPSC_TABLE_CART_CONTENTS . "` WHERE `purchaseid`=" . $purchase['id'] . "";
|
498 |
$cart = $wpdb->get_results( $cartsql, ARRAY_A );
|
499 |
|
500 |
+
if($count < count($cart))
|
501 |
+
$count = count($cart);
|
502 |
+
// Go through all products in cart and display quantity and sku
|
503 |
foreach ( (array)$cart as $item ) {
|
|
|
|
|
504 |
$skuvalue = get_product_meta($item['prodid'], 'sku', true);
|
505 |
+
if(empty($skuvalue)) $skuvalue = 'N/A';
|
506 |
+
$output .= "\"" . $item['quantity'] . " x " . str_replace( '"', '\"', $item['name'] ) . "\"";
|
507 |
+
$output .= "," . $skuvalue."," ;
|
508 |
}
|
509 |
$output .= "\n"; // terminates the row/line in the CSV file
|
510 |
}
|
511 |
+
// Get the most number of products and create a header for them
|
512 |
+
$headers3 = "";
|
513 |
+
for($i = 0; $i < $count ;$i++){
|
514 |
+
$headers3 .= "\"Quantity - Product Name \", \" SKU \"";
|
515 |
+
if($i < ($count-1))
|
516 |
+
$headers3 .= ",";
|
517 |
+
}
|
518 |
+
|
519 |
+
echo $headers . $form_headers . $headers2 . $headers3 . "\n". $output;
|
520 |
exit();
|
521 |
}
|
522 |
}
|
863 |
global $wpdb;
|
864 |
|
865 |
$products = array( );
|
866 |
+
foreach ( $_POST['page'] as $product ) {
|
|
|
867 |
$products[] = absint( $product );
|
868 |
}
|
869 |
|
1684 |
add_action( 'admin_init', 'wpsc_settings_page_ajax' );
|
1685 |
|
1686 |
function wpsc_update_variations() {
|
1687 |
+
$product_id = absint( $_POST["product_id"] );
|
1688 |
+
$product_type_object = get_post_type_object('wpsc-product');
|
1689 |
+
if (!current_user_can($product_type_object->cap->edit_post, $product_id))
|
1690 |
+
return;
|
1691 |
+
|
1692 |
//Setup postdata
|
1693 |
$post_data = array( );
|
1694 |
$post_data['edit_var_val'] = $_POST["edit_var_val"];
|
1695 |
$post_data['description'] = $_POST["description"];
|
1696 |
$post_data['additional_description'] = $_POST['additional_description'];
|
1697 |
+
$post_data['name'] = (!empty($_POST['name']))?$_POST['name']:$_POST["post_title"];
|
|
|
1698 |
|
1699 |
//Add or delete variations
|
1700 |
wpsc_edit_product_variations( $product_id, $post_data );
|
1701 |
+
if (defined('DOING_AJAX') && DOING_AJAX) {
|
1702 |
+
wpsc_admin_product_listing( $product_id );
|
1703 |
+
die();
|
1704 |
+
}
|
1705 |
}
|
1706 |
+
|
1707 |
+
if ( isset($_POST["edit_var_val"]) )
|
1708 |
add_action( 'admin_init', 'wpsc_update_variations', 50 );
|
1709 |
+
add_action('wp_ajax_wpsc_update_variations', 'wpsc_update_variations', 50 );
|
1710 |
|
1711 |
function wpsc_delete_variation_set() {
|
1712 |
global $wpdb;
|
1899 |
<input type="text" name="variation_price" id="variation_price" style="width:50px;" value="<?php echo $price; ?>"><br />
|
1900 |
<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>
|
1901 |
</div>
|
1902 |
+
<style type="text/css">
|
1903 |
+
.form-field #parent option{
|
1904 |
+
display:none;
|
1905 |
+
}
|
1906 |
+
.form-field #parent option.level-0{
|
1907 |
+
display:block;
|
1908 |
+
}
|
1909 |
+
</style>
|
1910 |
<?php
|
1911 |
} else{
|
1912 |
?>
|
wpsc-admin/css/admin.css
CHANGED
@@ -1726,7 +1726,7 @@ float:left !important;
|
|
1726 |
}
|
1727 |
|
1728 |
.inline-edit-col-left {
|
1729 |
-
width:
|
1730 |
}
|
1731 |
|
1732 |
.wpsc-quick-edit {
|
@@ -1748,3 +1748,9 @@ width:75px;
|
|
1748 |
display: block;
|
1749 |
float: left;
|
1750 |
}
|
|
|
|
|
|
|
|
|
|
|
|
1726 |
}
|
1727 |
|
1728 |
.inline-edit-col-left {
|
1729 |
+
width:35% !important;
|
1730 |
}
|
1731 |
|
1732 |
.wpsc-quick-edit {
|
1748 |
display: block;
|
1749 |
float: left;
|
1750 |
}
|
1751 |
+
.wpsc_var_description{
|
1752 |
+
margin:20px 0 0 20px !important;
|
1753 |
+
color:red;
|
1754 |
+
|
1755 |
+
|
1756 |
+
}
|
wpsc-admin/display-items.page.php
CHANGED
@@ -65,7 +65,8 @@ function wpsc_additional_sortable_column_names( $columns ){
|
|
65 |
}
|
66 |
function wpsc_additional_column_name_variations( $columns ){
|
67 |
global $post;
|
68 |
-
|
|
|
69 |
remove_meta_box( 'wpsc_product_variation_forms', 'wpsc-product', 'normal' );
|
70 |
|
71 |
$columns['image'] = '';
|
@@ -142,7 +143,7 @@ function wpsc_additional_column_data( $column ) {
|
|
142 |
if( !isset( $product_data['meta']['_wpsc_product_metadata']['weight_unit'] ) )
|
143 |
$product_data['meta']['_wpsc_product_metadata']['weight_unit'] = "";
|
144 |
|
145 |
-
$product_data['transformed']['weight'] = wpsc_convert_weight( $product_data['meta']['_wpsc_product_metadata']['weight'], "
|
146 |
|
147 |
$weight = $product_data['transformed']['weight'];
|
148 |
if( $weight == '' )
|
@@ -152,17 +153,17 @@ function wpsc_additional_column_data( $column ) {
|
|
152 |
|
153 |
switch( $unit ) {
|
154 |
case "pound":
|
155 |
-
$unit = " lbs.";
|
156 |
break;
|
157 |
case "ounce":
|
158 |
-
$unit = " oz.";
|
159 |
break;
|
160 |
case "gram":
|
161 |
-
$unit = " g";
|
162 |
break;
|
163 |
case "kilograms":
|
164 |
case "kilogram":
|
165 |
-
$unit = " kgs.";
|
166 |
break;
|
167 |
}
|
168 |
echo $weight.$unit;
|
@@ -183,12 +184,23 @@ function wpsc_additional_column_data( $column ) {
|
|
183 |
break;
|
184 |
case 'price' :
|
185 |
$price = get_post_meta( $post->ID, '_wpsc_price', true );
|
|
|
186 |
if( !$is_parent ) {
|
187 |
-
|
188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
}
|
190 |
else
|
191 |
echo wpsc_product_variation_price_available( $post->ID ).'+';
|
|
|
|
|
192 |
break;
|
193 |
case 'sale_price' :
|
194 |
$price = get_post_meta( $post->ID, '_wpsc_special_price', true );
|
@@ -214,7 +226,7 @@ function wpsc_additional_column_data( $column ) {
|
|
214 |
$out[] = "<a href='?post_type=wpsc-product&wpsc_product_category={$c->slug}'> " . esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'category', 'display' ) ) . "</a>";
|
215 |
echo join( ', ', $out );
|
216 |
} else {
|
217 |
-
_e('Uncategorized');
|
218 |
}
|
219 |
break;
|
220 |
case 'featured' :
|
@@ -286,7 +298,7 @@ function wpsc_cats_restrict_manage_posts() {
|
|
286 |
|
287 |
// output html for taxonomy dropdown filter
|
288 |
echo "<select name='$tax_slug' id='$tax_slug' class='postform'>";
|
289 |
-
echo "<option value=''>Show All $tax_name</option>";
|
290 |
foreach ( $terms as $term )
|
291 |
echo '<option value='. $term->slug, $_GET[$tax_slug] == $term->slug ? ' selected="selected"' : '','>' . $term->name .' (' . $term->count .')</option>';
|
292 |
echo "</select>";
|
65 |
}
|
66 |
function wpsc_additional_column_name_variations( $columns ){
|
67 |
global $post;
|
68 |
+
|
69 |
+
if(isset($post) && $post->post_parent != '0' )
|
70 |
remove_meta_box( 'wpsc_product_variation_forms', 'wpsc-product', 'normal' );
|
71 |
|
72 |
$columns['image'] = '';
|
143 |
if( !isset( $product_data['meta']['_wpsc_product_metadata']['weight_unit'] ) )
|
144 |
$product_data['meta']['_wpsc_product_metadata']['weight_unit'] = "";
|
145 |
|
146 |
+
$product_data['transformed']['weight'] = wpsc_convert_weight( $product_data['meta']['_wpsc_product_metadata']['weight'], "pound", $product_data['meta']['_wpsc_product_metadata']['weight_unit'] );
|
147 |
|
148 |
$weight = $product_data['transformed']['weight'];
|
149 |
if( $weight == '' )
|
153 |
|
154 |
switch( $unit ) {
|
155 |
case "pound":
|
156 |
+
$unit = __(" lbs.", "wpsc");
|
157 |
break;
|
158 |
case "ounce":
|
159 |
+
$unit = __(" oz.", "wpsc");
|
160 |
break;
|
161 |
case "gram":
|
162 |
+
$unit = __(" g", "wpsc");
|
163 |
break;
|
164 |
case "kilograms":
|
165 |
case "kilogram":
|
166 |
+
$unit = __(" kgs.", "wpsc");
|
167 |
break;
|
168 |
}
|
169 |
echo $weight.$unit;
|
184 |
break;
|
185 |
case 'price' :
|
186 |
$price = get_post_meta( $post->ID, '_wpsc_price', true );
|
187 |
+
$has_var = '1';
|
188 |
if( !$is_parent ) {
|
189 |
+
echo wpsc_currency_display( $price );
|
190 |
+
$args = array(
|
191 |
+
'display_currency_symbol' => false,
|
192 |
+
'display_decimal_point' => true,
|
193 |
+
'display_currency_code' => false,
|
194 |
+
'display_as_html' => false
|
195 |
+
);
|
196 |
+
$price = wpsc_currency_display( $price, $args );
|
197 |
+
echo '<div id="inline_' . $post->ID . '_price" class="hidden">' . trim($price) . '</div>';
|
198 |
+
$has_var = '0';
|
199 |
}
|
200 |
else
|
201 |
echo wpsc_product_variation_price_available( $post->ID ).'+';
|
202 |
+
echo '<input type="hidden" value="'.$has_var.'" name=""inline_' . $post->ID . '_has_var"" id="inline_' . $post->ID . '_has_var" />';
|
203 |
+
|
204 |
break;
|
205 |
case 'sale_price' :
|
206 |
$price = get_post_meta( $post->ID, '_wpsc_special_price', true );
|
226 |
$out[] = "<a href='?post_type=wpsc-product&wpsc_product_category={$c->slug}'> " . esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'category', 'display' ) ) . "</a>";
|
227 |
echo join( ', ', $out );
|
228 |
} else {
|
229 |
+
_e('Uncategorized', 'wpsc');
|
230 |
}
|
231 |
break;
|
232 |
case 'featured' :
|
298 |
|
299 |
// output html for taxonomy dropdown filter
|
300 |
echo "<select name='$tax_slug' id='$tax_slug' class='postform'>";
|
301 |
+
echo "<option value=''>" . sprintf(_x('Show All %s', 'Show all [category name]', 'wpsc'), $tax_name) . "</option>";
|
302 |
foreach ( $terms as $term )
|
303 |
echo '<option value='. $term->slug, $_GET[$tax_slug] == $term->slug ? ' selected="selected"' : '','>' . $term->name .' (' . $term->count .')</option>';
|
304 |
echo "</select>";
|
wpsc-admin/display-sales-logs.php
CHANGED
@@ -150,7 +150,7 @@ function wpsc_display_sales_logs() {
|
|
150 |
<div id='post-body' class='has-sidebar' style='width:95%;'>
|
151 |
<?php if(wpsc_has_purchlog_shipping()) { ?>
|
152 |
<div id='wpsc_shipping_details_box'>
|
153 |
-
<h3><?php _e('Shipping
|
154 |
<p><strong><?php echo wpsc_display_purchlog_shipping_name(); ?></strong></p>
|
155 |
<p>
|
156 |
<?php echo wpsc_display_purchlog_shipping_address(); ?><br />
|
@@ -395,18 +395,21 @@ function wpsc_display_sales_logs() {
|
|
395 |
<label for='view_purchlogs_by'><?php _e('View:'); ?></label>
|
396 |
|
397 |
<select id='view_purchlogs_by' name='view_purchlogs_by'>
|
398 |
-
|
399 |
-
|
400 |
-
|
|
|
|
|
401 |
switch($_GET['view_purchlogs_by']) {
|
402 |
-
case '3mnths':
|
403 |
-
$date_is_selected['3mnths'] = 'selected="selected"';
|
404 |
-
break;
|
405 |
-
|
406 |
-
case '':
|
407 |
case 'all':
|
408 |
$date_is_selected['all'] = 'selected="selected"';
|
409 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
}
|
411 |
|
412 |
?>
|
@@ -470,7 +473,7 @@ function wpsc_display_sales_logs() {
|
|
470 |
'end_timestamp' => $purchlogs->current_end_timestamp);
|
471 |
?>
|
472 |
<br />
|
473 |
-
<p><a class='admin_download' href='<?php echo htmlentities(add_query_arg($arr_params)) ; ?>' ><img class='wpsc_pushdown_img' src='<?php echo WPSC_CORE_IMAGES_URL; ?>/download.gif' alt='' title='' /> <span> <?php _e('Download CSV', 'wpsc'); ?></span></a></p>
|
474 |
</form>
|
475 |
<br />
|
476 |
<script type="text/javascript">
|
@@ -503,7 +506,7 @@ function wpsc_display_sales_logs() {
|
|
503 |
<td><?php echo wpsc_the_purch_item_date(); ?></td> <!--Date -->
|
504 |
<td><?php echo wpsc_the_purch_item_name(); ?></td> <!--Name/email -->
|
505 |
<td><?php echo wpsc_currency_display( wpsc_the_purch_item_price() ); ?></td><!-- Amount -->
|
506 |
-
<td><a href='<?php echo htmlentities(add_query_arg('purchaselog_id', wpsc_the_purch_item_id())) ; ?>'><?php echo wpsc_the_purch_item_details();?> Items</a></td><!-- Details -->
|
507 |
<td>
|
508 |
<?php if(!wpsc_purchlogs_is_google_checkout()){ ?>
|
509 |
<select class='selector' name='<?php echo wpsc_the_purch_item_id(); ?>' title='<?php echo wpsc_the_purch_item_id(); ?>' >
|
@@ -567,19 +570,19 @@ function wpsc_purchlogs_custom_fields(){
|
|
567 |
if(wpsc_purchlogs_has_customfields()){?>
|
568 |
<div class='metabox-holder'>
|
569 |
<div id='purchlogs_customfields' class='postbox'>
|
570 |
-
<h3 class='hndle'
|
571 |
<div class='inside'>
|
572 |
<?php $messages = wpsc_purchlogs_custommessages(); ?>
|
573 |
<?php $files = wpsc_purchlogs_customfiles(); ?>
|
574 |
<?php if(count($files) > 0){ ?>
|
575 |
-
<h4
|
576 |
<?php
|
577 |
foreach($files as $file){
|
578 |
echo $file;
|
579 |
}
|
580 |
}?>
|
581 |
<?php if(count($messages) > 0){ ?>
|
582 |
-
<h4
|
583 |
<?php
|
584 |
foreach($messages as $message){
|
585 |
echo $message;
|
@@ -599,7 +602,7 @@ function wpsc_purchlogs_notes() {
|
|
599 |
if ( true ) { // Need to check if notes column exists in DB and plugin version? ?>
|
600 |
<div class="metabox-holder">
|
601 |
<div id="purchlogs_notes" class="postbox">
|
602 |
-
<h3 class='hndle'
|
603 |
<div class='inside'>
|
604 |
<form method="post" action="">
|
605 |
<input type='hidden' name='wpsc_admin_action' value='purchlogs_update_notes' />
|
@@ -621,7 +624,7 @@ function wpsc_custom_checkout_fields(){
|
|
621 |
?>
|
622 |
<div class="metabox-holder">
|
623 |
<div id="custom_checkout_fields" class="postbox">
|
624 |
-
<h3 class='hndle'
|
625 |
<div class='inside'>
|
626 |
<?php
|
627 |
foreach((array)$purchlogitem->customcheckoutfields as $key=>$value){
|
@@ -659,4 +662,4 @@ function wpec_display_product_tax()
|
|
659 |
function wpsc_upgrade_purchase_logs() {
|
660 |
include(WPSC_FILE_PATH.'/wpsc-admin/includes/purchlogs_upgrade.php');
|
661 |
}
|
662 |
-
?>
|
150 |
<div id='post-body' class='has-sidebar' style='width:95%;'>
|
151 |
<?php if(wpsc_has_purchlog_shipping()) { ?>
|
152 |
<div id='wpsc_shipping_details_box'>
|
153 |
+
<h3><?php _e('Shipping Address','wpsc'); ?></h3>
|
154 |
<p><strong><?php echo wpsc_display_purchlog_shipping_name(); ?></strong></p>
|
155 |
<p>
|
156 |
<?php echo wpsc_display_purchlog_shipping_address(); ?><br />
|
395 |
<label for='view_purchlogs_by'><?php _e('View:'); ?></label>
|
396 |
|
397 |
<select id='view_purchlogs_by' name='view_purchlogs_by'>
|
398 |
+
<?php
|
399 |
+
$date_is_selected['3mnths'] = '';
|
400 |
+
$date_is_selected['all'] = '';
|
401 |
+
if( !isset($_GET['view_purchlogs_by']) )
|
402 |
+
$_GET['view_purchlogs_by'] = '';
|
403 |
switch($_GET['view_purchlogs_by']) {
|
|
|
|
|
|
|
|
|
|
|
404 |
case 'all':
|
405 |
$date_is_selected['all'] = 'selected="selected"';
|
406 |
break;
|
407 |
+
|
408 |
+
default:
|
409 |
+
case '3mnths':
|
410 |
+
case '':
|
411 |
+
$date_is_selected['3mnths'] = 'selected="selected"';
|
412 |
+
break;
|
413 |
}
|
414 |
|
415 |
?>
|
473 |
'end_timestamp' => $purchlogs->current_end_timestamp);
|
474 |
?>
|
475 |
<br />
|
476 |
+
<p><a class='admin_download' href='<?php echo htmlentities(add_query_arg($arr_params), ENT_QUOTES, 'UTF-8') ; ?>' ><img class='wpsc_pushdown_img' src='<?php echo WPSC_CORE_IMAGES_URL; ?>/download.gif' alt='' title='' /> <span> <?php _e('Download CSV', 'wpsc'); ?></span></a></p>
|
477 |
</form>
|
478 |
<br />
|
479 |
<script type="text/javascript">
|
506 |
<td><?php echo wpsc_the_purch_item_date(); ?></td> <!--Date -->
|
507 |
<td><?php echo wpsc_the_purch_item_name(); ?></td> <!--Name/email -->
|
508 |
<td><?php echo wpsc_currency_display( wpsc_the_purch_item_price() ); ?></td><!-- Amount -->
|
509 |
+
<td><a href='<?php echo htmlentities(add_query_arg('purchaselog_id', wpsc_the_purch_item_id()), ENT_QUOTES, 'UTF-8') ; ?>'><?php echo wpsc_the_purch_item_details();?> Items</a></td><!-- Details -->
|
510 |
<td>
|
511 |
<?php if(!wpsc_purchlogs_is_google_checkout()){ ?>
|
512 |
<select class='selector' name='<?php echo wpsc_the_purch_item_id(); ?>' title='<?php echo wpsc_the_purch_item_id(); ?>' >
|
570 |
if(wpsc_purchlogs_has_customfields()){?>
|
571 |
<div class='metabox-holder'>
|
572 |
<div id='purchlogs_customfields' class='postbox'>
|
573 |
+
<h3 class='hndle'><?php _e( 'Users Custom Fields' , 'wpsc' ); ?></h3>
|
574 |
<div class='inside'>
|
575 |
<?php $messages = wpsc_purchlogs_custommessages(); ?>
|
576 |
<?php $files = wpsc_purchlogs_customfiles(); ?>
|
577 |
<?php if(count($files) > 0){ ?>
|
578 |
+
<h4><?php _e( 'Cart Items with Custom Files' , 'wpsc' ); ?>:</h4>
|
579 |
<?php
|
580 |
foreach($files as $file){
|
581 |
echo $file;
|
582 |
}
|
583 |
}?>
|
584 |
<?php if(count($messages) > 0){ ?>
|
585 |
+
<h4><?php _e( 'Cart Items with Custom Messages' , 'wpsc' ); ?>:</h4>
|
586 |
<?php
|
587 |
foreach($messages as $message){
|
588 |
echo $message;
|
602 |
if ( true ) { // Need to check if notes column exists in DB and plugin version? ?>
|
603 |
<div class="metabox-holder">
|
604 |
<div id="purchlogs_notes" class="postbox">
|
605 |
+
<h3 class='hndle'><?php _e( 'Order Notes' , 'wpsc' ); ?></h3>
|
606 |
<div class='inside'>
|
607 |
<form method="post" action="">
|
608 |
<input type='hidden' name='wpsc_admin_action' value='purchlogs_update_notes' />
|
624 |
?>
|
625 |
<div class="metabox-holder">
|
626 |
<div id="custom_checkout_fields" class="postbox">
|
627 |
+
<h3 class='hndle'><?php _e( 'Additional Checkout Fields' , 'wpsc' ); ?></h3>
|
628 |
<div class='inside'>
|
629 |
<?php
|
630 |
foreach((array)$purchlogitem->customcheckoutfields as $key=>$value){
|
662 |
function wpsc_upgrade_purchase_logs() {
|
663 |
include(WPSC_FILE_PATH.'/wpsc-admin/includes/purchlogs_upgrade.php');
|
664 |
}
|
665 |
+
?>
|
wpsc-admin/display-update.page.php
CHANGED
@@ -57,20 +57,20 @@ function wpsc_display_update_page() { ?>
|
|
57 |
|
58 |
<?php
|
59 |
if ( isset( $_POST['run_updates'] ) ) :
|
60 |
-
echo 'Updating Categories...';
|
61 |
wpsc_convert_category_groups();
|
62 |
-
echo '<br />Updating Variations...';
|
63 |
wpsc_convert_variation_sets();
|
64 |
-
echo '<br />Updating Products...';
|
65 |
wpsc_convert_products_to_posts();
|
66 |
-
echo '<br />Updating Child Products...';
|
67 |
wpsc_convert_variation_combinations();
|
68 |
-
echo '<br />Updating Product Files...';
|
69 |
wpsc_update_files();
|
70 |
-
echo '<br />Updating Database...';
|
71 |
wpsc_create_or_update_tables();
|
72 |
wpsc_update_database();
|
73 |
-
echo '<br /><br /><strong>WP e-Commerce updated successfully
|
74 |
update_option('wpsc_version', 3.8);
|
75 |
update_option('wpsc_hide_update', true);
|
76 |
else:
|
57 |
|
58 |
<?php
|
59 |
if ( isset( $_POST['run_updates'] ) ) :
|
60 |
+
echo __('Updating Categories...', 'wpsc');
|
61 |
wpsc_convert_category_groups();
|
62 |
+
echo '<br />' . __('Updating Variations...', 'wpsc');
|
63 |
wpsc_convert_variation_sets();
|
64 |
+
echo '<br />' . __('Updating Products...', 'wpsc');
|
65 |
wpsc_convert_products_to_posts();
|
66 |
+
echo '<br />' . __('Updating Child Products...', 'wpsc');
|
67 |
wpsc_convert_variation_combinations();
|
68 |
+
echo '<br />' . __('Updating Product Files...', 'wpsc');
|
69 |
wpsc_update_files();
|
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:
|
wpsc-admin/display-variations.page.php
CHANGED
@@ -153,7 +153,7 @@ function wpsc_admin_variation_forms($variation_id = null) {
|
|
153 |
}
|
154 |
if($variation_name != '') {
|
155 |
?>
|
156 |
-
<h3><?php _e('Edit Variation Set', 'wpsc'); ?><span> (<a href="admin.php?page=wpsc-edit-variations"
|
157 |
<?php
|
158 |
} else {
|
159 |
?>
|
153 |
}
|
154 |
if($variation_name != '') {
|
155 |
?>
|
156 |
+
<h3><?php _e('Edit Variation Set', 'wpsc'); ?><span> (<a href="admin.php?page=wpsc-edit-variations"><?php _e('Add new Variation Set', 'wpsc'); ?></a>)</span></h3>
|
157 |
<?php
|
158 |
} else {
|
159 |
?>
|
wpsc-admin/includes/display-items-functions.php
CHANGED
@@ -55,138 +55,143 @@ $wpsc_product_defaults = array(
|
|
55 |
),
|
56 |
),
|
57 |
);
|
58 |
-
add_action('admin_head', 'wpsc_css_header');
|
59 |
|
60 |
-
function wpsc_redirect_variation_update($location, $post_id){
|
61 |
global $post;
|
62 |
-
if($post->post_parent > 0)
|
63 |
-
wp_redirect(admin_url('post.php?post='.$post->post_parent.'&action=edit'));
|
64 |
else
|
65 |
-
return $location;
|
66 |
-
|
67 |
}
|
68 |
|
69 |
-
add_filter('redirect_post_location','wpsc_redirect_variation_update', 10, 2);
|
70 |
function wpsc_css_header() {
|
71 |
-
|
72 |
-
|
73 |
<style>
|
74 |
-
<?php if (($_GET['post_type'] == 'wpsc-product') || ($post_type == 'wpsc-product')) : ?>
|
75 |
#icon-edit { background:transparent url('<?php echo WPSC_CORE_IMAGES_URL.'/icon32.png';?>') no-repeat; }
|
76 |
<?php endif; ?>
|
77 |
</style>
|
78 |
<?php
|
79 |
}
|
80 |
-
function wpsc_price_control_forms(){
|
81 |
global $post, $wpdb, $variations_processor, $wpsc_product_defaults;
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
foreach( $product_data['meta'] as $meta_key => $meta_value )
|
86 |
-
$product_data['meta'][$meta_key] = $meta_value[0];
|
87 |
|
88 |
-
|
|
|
89 |
|
90 |
-
|
|
|
91 |
$product_alt_currency = maybe_unserialize( $product_data['meta']['_wpsc_currency'] );
|
92 |
-
|
93 |
-
if ( !isset( $product_data['meta']['_wpsc_table_rate_price'] ) )
|
94 |
$product_data['meta']['_wpsc_table_rate_price'] = $wpsc_product_defaults['meta']['table_rate_price'];
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
if ( !isset( $product_data['meta']['_wpsc_is_donation'] ) )
|
98 |
$product_data['meta']['_wpsc_is_donation'] = $wpsc_product_defaults['donation'];
|
99 |
-
|
100 |
if ( !isset( $product_meta['table_rate_price']['state'] ) )
|
101 |
$product_meta['table_rate_price']['state'] = null;
|
102 |
-
|
103 |
if ( !isset( $product_meta['table_rate_price']['quantity'] ) )
|
104 |
$product_meta['table_rate_price']['quantity'] = $wpsc_product_defaults['meta']['table_rate_price']['quantity'][0];
|
105 |
-
|
106 |
if ( !isset( $product_data['meta']['_wpsc_price'] ) )
|
107 |
$product_data['meta']['_wpsc_price'] = $wpsc_product_defaults['price'];
|
108 |
-
|
109 |
if ( !isset( $product_data['special'] ) )
|
110 |
$product_data['special'] = $wpsc_product_defaults['special'];
|
111 |
-
|
112 |
if ( !isset( $product_data['meta']['_wpsc_special_price'] ) )
|
113 |
-
$product_data['meta']['_wpsc_special_price'] = $wpsc_product_defaults['special_price'];
|
114 |
-
|
115 |
-
$currency_data = $wpdb->get_results( "SELECT * FROM `" . WPSC_TABLE_CURRENCY_LIST . "` ORDER BY `country` ASC", ARRAY_A );
|
116 |
-
|
117 |
<input type="hidden" id="parent_post" name="parent_post" value="<?php echo $post->post_parent; ?>" />
|
118 |
<?php /* Lots of tedious work is avoided with this little line. */ ?>
|
119 |
<input type="hidden" id="product_id" name="product_id" value="<?php echo $post->ID; ?>" />
|
120 |
|
121 |
<?php /* Check product if a product has variations (Wording doesn't make sense. If Variations box is closed, you don't go there, and it's not necessarily "below") */ ?>
|
122 |
-
<?php if( wpsc_product_has_children( $post->ID ) ) : ?>
|
123 |
<?php $price = wpsc_product_variation_price_available( $post->ID ); ?>
|
124 |
-
<p><?php
|
125 |
-
<p><?php printf( __( 'Price: %s and above.' ,'wpsc' ) , $price ); ?></p>
|
126 |
<?php else: ?>
|
127 |
-
|
128 |
<div class='wpsc_floatleft' style="width:85px;">
|
129 |
<label><?php _e( 'Price', 'wpsc' ); ?>:</label><br />
|
130 |
-
<input type='text' class='text' size='10' name='meta[_wpsc_price]' value='<?php echo number_format( $product_data['meta']['_wpsc_price'],2,'.','' ); ?>' />
|
131 |
</div>
|
132 |
-
<div class='wpsc_floatleft' style='display:<?php if ( ($product_data['special'] == 1) ? 'block' : 'none'
|
133 |
-
|
134 |
<label for='add_form_special'><?php _e( 'Sale Price', 'wpsc' ); ?>:</label>
|
135 |
<div id='add_special'>
|
136 |
-
<input type='text' size='10' value='<?php echo number_format( $product_data['meta']['_wpsc_special_price'], 2,'.','' ); ?>' name='meta[_wpsc_special_price]' />
|
137 |
</div>
|
138 |
</div>
|
139 |
<br style="clear:both" />
|
140 |
<br style="clear:both" />
|
141 |
-
<a href='#' class='wpsc_add_new_currency'
|
142 |
<br />
|
143 |
<!-- add new currency layer -->
|
144 |
<div class='new_layer'>
|
145 |
<label for='newCurrency[]'><?php _e( 'Currency type', 'wpsc' ); ?>:</label><br />
|
146 |
<select name='newCurrency[]' class='newCurrency' style='width:42%'>
|
147 |
<?php
|
148 |
-
|
149 |
<option value='<?php echo $currency['id']; ?>' >
|
150 |
<?php echo htmlspecialchars( $currency['country'] ); ?> (<?php echo $currency['currency']; ?>)
|
151 |
</option> <?php
|
152 |
-
|
153 |
</select>
|
154 |
-
<?php _e( 'Price', 'wpsc' ); ?> :
|
155 |
<input type='text' class='text' size='8' name='newCurrPrice[]' value='0.00' style='display:inline' />
|
156 |
<a href='' class='deletelayer' rel='<?php echo $isocode; ?>'><img src='<?php echo WPSC_CORE_IMAGES_URL; ?>/cross.png' /></a>
|
157 |
|
158 |
</div> <!-- close new_layer -->
|
159 |
<?php
|
160 |
-
if ( isset( $product_alt_currency ) && is_array($product_alt_currency)) :
|
161 |
$i = 0;
|
162 |
-
|
163 |
-
|
164 |
<div class='wpsc_additional_currency'>
|
165 |
<label for='newCurrency[]'><?php _e( 'Currency type', 'wpsc' ); ?>:</label><br />
|
166 |
<select name='newCurrency[]' class='newCurrency' style='width:42%'> <?php
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
<option value='<?php echo $currency['id']; ?>' <?php echo $selected; ?> >
|
173 |
<?php echo htmlspecialchars( $currency['country'] ); ?> (<?php echo $currency['currency']; ?>)
|
174 |
</option> <?php
|
175 |
-
|
176 |
</select>
|
177 |
-
<?php _e( 'Price', 'wpsc' );
|
178 |
<a href='' class='wpsc_delete_currency_layer' rel='<?php echo $iso; ?>'><img src='<?php echo WPSC_CORE_IMAGES_URL; ?>/cross.png' /></a></div>
|
179 |
-
<?php
|
180 |
-
|
181 |
-
|
182 |
|
183 |
-
|
184 |
-
<br/><input id='add_form_donation' type='checkbox' name='meta[_wpsc_is_donation]' value='yes' " . (($product_data['meta']['_wpsc_is_donation'] == 1) ? 'checked="checked"' : '') . " /> <label for='add_form_donation'>" . __( 'This is a donation, checking this box populates the donations widget.', 'wpsc' ) . "</label>";
|
185 |
?>
|
186 |
-
<br /><br /> <input type='checkbox' value='1' name='table_rate_price[state]' id='table_rate_price' <?php echo (((bool)$product_meta['table_rate_price']['state'] == true) ? 'checked=\'checked\'' : ''); ?> />
|
187 |
<label for='table_rate_price'><?php _e( 'Table Rate Price', 'wpsc' ); ?></label>
|
188 |
<div id='table_rate'>
|
189 |
-
<a class='add_level' style='cursor:pointer;'
|
190 |
<br style='clear:both' />
|
191 |
<table>
|
192 |
<tr>
|
@@ -194,14 +199,14 @@ function wpsc_price_control_forms(){
|
|
194 |
<th colspan='2'><?php _e( 'Discounted Price', 'wpsc' ); ?></th>
|
195 |
</tr>
|
196 |
<?php
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
?>
|
202 |
<tr>
|
203 |
<td>
|
204 |
-
<input type="text" size="5" value="<?php echo $quantity; ?>" name="table_rate_price[quantity][]"/><span class='description'
|
205 |
</td>
|
206 |
<td>
|
207 |
<input type="text" size="10" value="<?php echo $table_price; ?>" name="table_rate_price[table_price][]" />
|
@@ -209,12 +214,12 @@ function wpsc_price_control_forms(){
|
|
209 |
<td><img src="<?php echo WPSC_CORE_IMAGES_URL; ?>/cross.png" class="remove_line" /></td>
|
210 |
</tr>
|
211 |
<?php
|
212 |
-
}
|
213 |
-
}
|
214 |
}
|
|
|
|
|
215 |
?>
|
216 |
<tr>
|
217 |
-
<td><input type="text" size="5" value="<?php echo $quantity; ?>" name="table_rate_price[quantity][]"/><span class='description'
|
218 |
<td><input type='text' size='10' value='' name='table_rate_price[table_price][]'/></td>
|
219 |
</tr>
|
220 |
</table>
|
@@ -225,75 +230,75 @@ function wpsc_price_control_forms(){
|
|
225 |
function wpsc_stock_control_forms() {
|
226 |
global $post, $wpdb, $variations_processor, $wpsc_product_defaults;
|
227 |
|
228 |
-
|
229 |
-
|
230 |
|
231 |
-
|
232 |
-
|
233 |
|
234 |
-
|
235 |
|
236 |
if ( !isset( $product_meta['unpublish_when_none_left'] ) )
|
237 |
$product_meta['unpublish_when_none_left'] = ''; ?>
|
238 |
-
|
239 |
-
<label for="wpsc_sku"><abbr title="<?php _e( 'Stock Keeping Unit', 'wpsc' ); ?>"
|
240 |
<?php
|
241 |
-
|
242 |
-
|
243 |
<input size='32' type='text' class='text' id="wpsc_sku" name='meta[_wpsc_sku]' value='<?php echo htmlentities( stripslashes( $product_data['meta']['_wpsc_sku'] ), ENT_QUOTES, 'UTF-8' ); ?>' />
|
244 |
<br style="clear:both" />
|
245 |
<?php
|
246 |
-
|
247 |
-
|
248 |
-
<br /><input class='limited_stock_checkbox' id='add_form_quantity_limited' type='checkbox' value='yes' <?php if(is_numeric( $product_data['meta']['_wpsc_stock'] )) echo 'checked="checked"'; else echo ''; ?> name='meta[_wpsc_limited_stock]' />
|
249 |
<label for='add_form_quantity_limited' class='small'><?php _e( 'I have limited stock for this Product', 'wpsc' ); ?></label>
|
250 |
<?php
|
251 |
-
|
252 |
-
|
253 |
-
<div class='edit_stock' style='display: block;'> <?php
|
254 |
-
|
255 |
<div class='edit_stock' style='display: none;'><?php
|
256 |
-
|
257 |
-
<?php if( wpsc_product_has_children( $post->ID ) ) : ?>
|
258 |
<?php $stock = wpsc_variations_stock_remaining( $post->ID ); ?>
|
259 |
<p><?php _e( 'This Product has variations, to edit the quantity please use the Variation Controls below.' , 'wpsc' ); ?></p>
|
260 |
-
<p><?php printf(_n("%s variant item in stock.", "%s variant items in stock.", $stock), $stock); ?></p>
|
261 |
<?php else: ?>
|
262 |
<label for="stock_limit_quantity"><?php _e( 'Quantity:', 'wpsc' ); ?></label>
|
263 |
<input type='text' id="stock_limit_quantity" name='meta[_wpsc_stock]' size='3' value='<?php echo $product_data['meta']['_wpsc_stock']; ?>' class='stock_limit_quantity' />
|
264 |
<?php endif; ?>
|
265 |
<div class='unpublish_when_none_left'>
|
266 |
-
<input type='checkbox' id="inform_when_oos" name='meta[_wpsc_product_metadata][unpublish_when_none_left]' class='inform_when_oos'<?php if( $product_meta['unpublish_when_none_left'] == 1 ) echo ' checked="checked"'; ?> />
|
267 |
<label for="inform_when_oos"><?php _e( 'Notify site owner and unpublish this Product if stock runs out', 'wpsc' ); ?></label>
|
268 |
</div>
|
269 |
-
<?php _e('If stock runs out, this Product will not be available on the shop unless you untick this box or add more stock.', 'wpsc'); ?>
|
270 |
</div> <?php
|
271 |
-
|
272 |
<div style='display: none;' class='edit_stock'>
|
273 |
<?php _e( 'Stock Qty', 'wpsc' ); ?><input type='text' name='meta[_wpsc_stock]' value='0' size='10' />
|
274 |
<div style='font-size:9px; padding:5px;'>
|
275 |
<input type='checkbox' class='inform_when_oos' name='meta[_wpsc_product_metadata][unpublish_when_none_left]' /> <?php _e( 'If this Product runs out of stock set status to Unpublished & email site owner', 'wpsc' ); ?>
|
276 |
</div>
|
277 |
</div><?php
|
278 |
-
|
279 |
?>
|
280 |
-
<?php
|
281 |
}
|
282 |
-
function wpsc_product_taxes_forms(){
|
283 |
global $post, $wpdb, $wpsc_product_defaults;
|
284 |
-
|
|
|
|
|
285 |
|
286 |
-
$product_data['meta'] = $product_meta = maybe_unserialize($product_data['_wpsc_product_metadata'][0]);
|
287 |
-
|
288 |
if ( !isset( $product_data['meta']['_wpsc_custom_tax'] ) )
|
289 |
$product_data['meta']['_wpsc_custom_tax'] = '';
|
290 |
$custom_tax = $product_data['meta']['_wpsc_custom_tax'];
|
291 |
|
292 |
-
|
293 |
-
if ( !isset( $product_meta['custom_tax'] ) ){
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
//Add New WPEC-Taxes Bands Here
|
298 |
$wpec_taxes_controller = new wpec_taxes_controller();
|
299 |
|
@@ -301,60 +306,60 @@ function wpsc_product_taxes_forms(){
|
|
301 |
$band_select_settings = array(
|
302 |
'id' => 'wpec_taxes_band',
|
303 |
'name' => 'meta[_wpsc_product_metadata][wpec_taxes_band]',
|
304 |
-
'label' => __( 'Custom Tax Band' )
|
305 |
);
|
306 |
$wpec_taxes_band = '';
|
307 |
-
if(isset($product_meta['wpec_taxes_band'])){
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
|
|
322 |
//add taxable amount only for exclusive tax
|
323 |
-
if(!$wpec_taxes_controller->wpec_taxes_isincluded())
|
324 |
-
{
|
325 |
$taxable_amount_input_settings = array(
|
326 |
'id' => 'wpec_taxes_taxable_amount',
|
327 |
'name' => 'meta[_wpsc_product_metadata][wpec_taxes_taxable_amount]',
|
328 |
-
'label' => __( 'Taxable Amount' )
|
329 |
);
|
330 |
-
|
331 |
-
if(isset($product_meta['wpec_taxes_taxable_amount'])){
|
332 |
$taxable_amount_input_settings['value'] = $product_meta['wpec_taxes_taxable_amount'];
|
333 |
}
|
334 |
}// if
|
335 |
-
|
336 |
-
|
337 |
<p><?php echo $wpec_taxes_controller->wpec_taxes_display_tax_bands( $band_select_settings, $wpec_taxes_band ); ?></p>
|
338 |
<p>
|
339 |
-
<?php if(!$wpec_taxes_controller->wpec_taxes_isincluded()): ?>
|
340 |
<?php echo $wpec_taxes_controller->wpec_taxes_build_input( $taxable_amount_input_settings );?>
|
341 |
<?php endif;?>
|
342 |
</p>
|
343 |
<p><?php echo $wpec_taxes_controller->wpec_taxes_build_input( $taxable_checkbox_settings ); ?></p>
|
344 |
-
<?php
|
345 |
}
|
346 |
function wpsc_product_variation_forms() {
|
347 |
global $post, $wpdb, $wp_query, $variations_processor, $wpsc_product_defaults;
|
348 |
|
349 |
-
|
350 |
|
351 |
-
|
352 |
-
|
353 |
|
354 |
-
|
355 |
-
|
356 |
|
357 |
-
|
358 |
|
359 |
$siteurl = get_option( 'siteurl' );
|
360 |
$output = '';
|
@@ -368,24 +373,24 @@ function wpsc_product_variation_forms() {
|
|
368 |
$product_terms = array();
|
369 |
}
|
370 |
?>
|
371 |
-
<?php if( empty( $post->post_title ) ) : ?>
|
372 |
<p><?php _e( 'You must first save this Product as a Draft before adding variations', 'wpsc' ); ?></p>
|
373 |
<?php else : ?>
|
374 |
<div id="product_variations">
|
375 |
<div class="variation_checkboxes">
|
376 |
<?php
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
<div class="variation_set">
|
390 |
|
391 |
<label class='set_label'>
|
@@ -394,18 +399,18 @@ function wpsc_product_variation_forms() {
|
|
394 |
</label>
|
395 |
|
396 |
<?php
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
|
405 |
-
|
406 |
-
|
407 |
|
408 |
-
|
409 |
|
410 |
<div class="variation">
|
411 |
<label>
|
@@ -425,34 +430,34 @@ function wpsc_product_variation_forms() {
|
|
425 |
|
426 |
</div>
|
427 |
<?php
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
|
447 |
-
|
448 |
-
|
449 |
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
|
455 |
-
<p><a name='variation_control'> </a><?php _e( 'Check or uncheck variation boxes and then click Update Variations to add or remove variations.' ) ?></p>
|
456 |
|
457 |
<table class="widefat page" id='wpsc_product_list' cellspacing="0">
|
458 |
<thead>
|
@@ -469,10 +474,10 @@ function wpsc_product_variation_forms() {
|
|
469 |
|
470 |
<tbody>
|
471 |
<?php
|
472 |
-
|
473 |
-
|
474 |
<?php
|
475 |
-
|
476 |
?>
|
477 |
<tr>
|
478 |
<td colspan="8">
|
@@ -484,28 +489,28 @@ function wpsc_product_variation_forms() {
|
|
484 |
</tbody>
|
485 |
|
486 |
</table>
|
487 |
-
|
488 |
<?php
|
489 |
-
|
490 |
}
|
491 |
function wpsc_product_shipping_forms() {
|
492 |
global $post, $wpdb, $variations_processor, $wpsc_product_defaults;
|
493 |
|
494 |
-
|
495 |
-
|
496 |
|
497 |
-
|
498 |
-
|
499 |
|
500 |
-
|
501 |
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
|
506 |
-
|
507 |
|
508 |
-
|
509 |
<table>
|
510 |
|
511 |
<!--USPS shipping changes-->
|
@@ -516,10 +521,10 @@ function wpsc_product_shipping_forms() {
|
|
516 |
<td>
|
517 |
<input type='text' size='5' name='meta[_wpsc_product_metadata][weight]' value='<?php echo $product_data['transformed']['weight']; ?>' />
|
518 |
<select name='meta[_wpsc_product_metadata][weight_unit]'>
|
519 |
-
<option value='pound' <?php echo (($product_meta['display_weight_as'] == 'pound') ? 'selected="selected"' : ''); ?>
|
520 |
-
<option value='ounce' <?php echo ((preg_match( "/o(u)?nce/", $product_meta['display_weight_as'] )) ? 'selected="selected"' : ''); ?>
|
521 |
-
<option value='gram' <?php echo (($product_meta['display_weight_as'] == 'gram') ? 'selected="selected"' : ''); ?>
|
522 |
-
<option value='kilogram' <?php echo (($product_meta['display_weight_as'] == 'kilogram' || $product_meta['display_weight_as'] == 'kilograms') ? 'selected="selected"' : ''); ?>
|
523 |
</select>
|
524 |
</td>
|
525 |
</tr>
|
@@ -531,9 +536,9 @@ function wpsc_product_shipping_forms() {
|
|
531 |
<td>
|
532 |
<input type='text' size='5' name='meta[_wpsc_product_metadata][dimensions][height]' value= '<?php echo $product_meta['dimensions']['height']; ?>'>
|
533 |
<select name='meta[_wpsc_product_metadata][dimensions][height_unit]'>
|
534 |
-
<option value='in' <?php echo (($product_meta['dimensions']['height_unit'] == 'in') ? 'selected' : ''); ?>
|
535 |
-
<option value='cm' <?php echo (($product_meta['dimensions']['height_unit'] == 'cm') ? 'selected' : ''); ?>
|
536 |
-
<option value='meter' <?php echo (($product_meta['dimensions']['height_unit'] == 'meter') ? 'selected' : ''); ?>
|
537 |
</select>
|
538 |
</td>
|
539 |
</tr>
|
@@ -544,9 +549,9 @@ function wpsc_product_shipping_forms() {
|
|
544 |
<td>
|
545 |
<input type='text' size='5' name='meta[_wpsc_product_metadata][dimensions][width]' value='<?php echo $product_meta['dimensions']['width']; ?> '>
|
546 |
<select name='meta[_wpsc_product_metadata][dimensions][width_unit]'>
|
547 |
-
<option value='in' <?php echo(($product_meta['dimensions']['width_unit'] == 'in') ? 'selected' : ''); ?>
|
548 |
-
<option value='cm' <?php echo (($product_meta['dimensions']['width_unit'] == 'cm') ? 'selected' : ''); ?>
|
549 |
-
<option value='meter' <?php echo (($product_meta['dimensions']['width_unit'] == 'meter') ? 'selected' : ''); ?>
|
550 |
</select>
|
551 |
</td>
|
552 |
</tr>
|
@@ -557,9 +562,9 @@ function wpsc_product_shipping_forms() {
|
|
557 |
<td>
|
558 |
<input type='text' size='5' name='meta[_wpsc_product_metadata][dimensions][length]' value='<?php echo $product_meta['dimensions']['length']; ?>'>
|
559 |
<select name='meta[_wpsc_product_metadata][dimensions][length_unit]'>
|
560 |
-
<option value='in' <?php echo(($product_meta['dimensions']['length_unit'] == 'in') ? 'selected' : ''); ?>
|
561 |
-
<option value='cm' <?php echo(($product_meta['dimensions']['length_unit'] == 'cm') ? 'selected' : ''); ?>
|
562 |
-
<option value='meter' <?php echo (($product_meta['dimensions']['length_unit'] == 'meter') ? 'selected' : ''); ?>
|
563 |
</select>
|
564 |
</td>
|
565 |
</tr>
|
@@ -591,17 +596,17 @@ function wpsc_product_shipping_forms() {
|
|
591 |
<tr>
|
592 |
<td>
|
593 |
<br />
|
594 |
-
<input id='add_form_no_shipping' type='checkbox' name='meta[_wpsc_product_metadata][no_shipping]' value='1' <?php echo (($product_meta['no_shipping'] == 1) ? 'checked="checked"' : ''); ?> /> <label for='add_form_no_shipping'><?php _e( 'Disregard Shipping for this Product', 'wpsc' ); ?></label>
|
595 |
</td>
|
596 |
</tr>
|
597 |
</table>
|
598 |
<?php
|
599 |
-
|
600 |
function wpsc_product_advanced_forms() {
|
601 |
global $post, $wpdb, $variations_processor, $wpsc_product_defaults;
|
602 |
-
|
603 |
|
604 |
-
|
605 |
|
606 |
$custom_fields = $wpdb->get_results( "
|
607 |
SELECT
|
@@ -624,21 +629,21 @@ function wpsc_product_advanced_forms() {
|
|
624 |
<a href='#' class='add_more_meta' onclick="return add_more_meta(this)"> + <?php _e( 'Add Custom Meta', 'wpsc' );?> </a><br /><br />
|
625 |
|
626 |
<?php
|
627 |
-
|
628 |
-
|
629 |
|
630 |
-
|
631 |
<div class='product_custom_meta' id='custom_meta_<?php echo $i; ?>'>
|
632 |
<?php _e( 'Name', 'wpsc' ); ?>
|
633 |
<input type='text' class='text' value='<?php echo $custom_field['meta_key']; ?>' name='custom_meta[<?php echo $i; ?>][name]' id='custom_meta_name_<?php echo $i; ?>'>
|
634 |
<?php _e( 'Value', 'wpsc' ); ?>
|
635 |
<textarea class='text' name='custom_meta[<?php echo $i; ?>][value]' id='custom_meta_value_<?php echo $i; ?>'><?php echo $custom_field['meta_value']; ?></textarea>
|
636 |
-
<a href='#' class='remove_meta' onclick='return remove_meta(this, <?php echo $i; ?>)'><?php _e( 'Delete' ); ?></a>
|
637 |
<br />
|
638 |
</div>
|
639 |
<?php
|
640 |
-
|
641 |
-
|
642 |
<div class='product_custom_meta'>
|
643 |
<?php _e( 'Name', 'wpsc' ); ?>: <br />
|
644 |
<input type='text' name='new_custom_meta[name][]' value='' class='text'/><br />
|
@@ -653,8 +658,8 @@ function wpsc_product_advanced_forms() {
|
|
653 |
|
654 |
<textarea cols='40' rows='3' name='meta[_wpsc_product_metadata][merchant_notes]' id='merchant_notes'>
|
655 |
<?php if ( isset( $product_meta['merchant_notes'] ) )
|
656 |
-
|
657 |
-
|
658 |
</textarea>
|
659 |
<small><?php _e( 'These notes are only available here.', 'wpsc' ); ?></small>
|
660 |
</td>
|
@@ -663,7 +668,7 @@ function wpsc_product_advanced_forms() {
|
|
663 |
<td class='itemfirstcol' colspan='2'><br />
|
664 |
<strong><?php _e( 'Personalisation Options', 'wpsc' ); ?>:</strong><br />
|
665 |
<input type='hidden' name='meta[_wpsc_product_metadata][engraved]' value='0' />
|
666 |
-
<input type='checkbox' name='meta[_wpsc_product_metadata][engraved]' <?php echo (($product_meta['engraved'] == true) ? 'checked="checked"' : ''); ?> id='add_engrave_text' />
|
667 |
<label for='add_engrave_text'><?php _e( 'Users can personalize this Product by leaving a message on single product page', 'wpsc' ); ?></label>
|
668 |
<br />
|
669 |
</td>
|
@@ -671,14 +676,14 @@ function wpsc_product_advanced_forms() {
|
|
671 |
<tr>
|
672 |
<td class='itemfirstcol' colspan='2'>
|
673 |
<input type='hidden' name='meta[_wpsc_product_metadata][can_have_uploaded_image]' value='0' />
|
674 |
-
<input type='checkbox' name='meta[_wpsc_product_metadata][can_have_uploaded_image]' <?php echo ($product_meta['can_have_uploaded_image'] == true) ? 'checked="checked"' : ''; ?> id='can_have_uploaded_image' />
|
675 |
<label for='can_have_uploaded_image'> <?php _e( 'Users can upload images on single product page to purchase logs.', 'wpsc' ); ?> </label>
|
676 |
<br />
|
677 |
</td>
|
678 |
</tr>
|
679 |
<?php
|
680 |
-
|
681 |
-
|
682 |
<tr>
|
683 |
<td class='itemfirstcol' colspan='2'>
|
684 |
|
@@ -688,42 +693,42 @@ function wpsc_product_advanced_forms() {
|
|
688 |
</td>
|
689 |
</tr>
|
690 |
<?php
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
<tr>
|
698 |
<td class='itemfirstcol' colspan='2'><br />
|
699 |
<strong><?php _e( 'Enable Comments', 'wpsc' ); ?>:</strong><br />
|
700 |
<select name='meta[_wpsc_product_metadata][enable_comments]'>
|
701 |
-
<option value='' <?php echo ((isset( $product_meta['enable_comments'] ) && $product_meta['enable_comments'] == '' ) ? 'selected' : ''); ?>
|
702 |
-
<option value='1' <?php echo ((isset( $product_meta['enable_comments'] ) && $product_meta['enable_comments'] == '1') ? 'selected' : ''); ?>
|
703 |
-
<option value='0' <?php echo ((isset( $product_meta['enable_comments'] ) && $product_meta['enable_comments'] == '0') ? 'selected' : ''); ?>
|
704 |
</select>
|
705 |
<br/><?php _e( 'Allow users to comment on this Product.', 'wpsc' ); ?>
|
706 |
</td>
|
707 |
</tr>
|
708 |
</table>
|
709 |
<?php
|
710 |
-
|
711 |
function wpsc_product_external_link_forms() {
|
712 |
|
713 |
-
|
714 |
-
|
715 |
|
716 |
-
|
717 |
|
718 |
// Get External Link Values
|
719 |
$external_link_value = isset( $product_meta['external_link'] ) ? $product_meta['external_link'] : '';
|
720 |
$external_link_text_value = isset( $product_meta['external_link_text'] ) ? $product_meta['external_link_text'] : '';
|
721 |
$external_link_target_value = isset( $product_meta['external_link_target'] ) ? $product_meta['external_link_target'] : '';
|
722 |
$external_link_target_value_selected[$external_link_target_value] = ' selected="selected"';
|
723 |
-
if( !isset($external_link_target_value_selected['_self']) ) $external_link_target_value_selected['_self'] = '';
|
724 |
-
if( !isset($external_link_target_value_selected['_blank']) ) $external_link_target_value_selected['_blank'] = '';
|
725 |
|
726 |
-
|
727 |
<p><?php _e( 'If this product is for sale on another website enter the link here. For instance if your product is an MP3 file for sale on iTunes you could put the link here. This option overrides the buy now and add to cart links and takes you to the site linked here. You can also customise the Buy Now text and choose to open the link in a new window.', 'wpsc' ); ?>
|
728 |
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
|
729 |
<tbody>
|
@@ -739,9 +744,9 @@ function wpsc_product_external_link_forms() {
|
|
739 |
<th valign="top" scope="row"><label for="external_link_target"><?php _e( 'External Link Target', 'wpsc' ); ?></label></th>
|
740 |
<td>
|
741 |
<select id="external_link_target" name="meta[_wpsc_product_metadata][external_link_target]">
|
742 |
-
<option value=""
|
743 |
-
<option value="_self" <?php echo $external_link_target_value_selected['_self'];
|
744 |
-
<option value="_blank" <?php echo $external_link_target_value_selected['_blank'];
|
745 |
</select>
|
746 |
</td>
|
747 |
</tr>
|
@@ -751,17 +756,17 @@ function wpsc_product_external_link_forms() {
|
|
751 |
}
|
752 |
function wpsc_product_image_forms() {
|
753 |
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
|
758 |
-
|
759 |
|
760 |
<p><strong <?php if ( isset( $display ) ) echo $display; ?>><a href="media-upload.php?parent_page=wpsc-edit-products&post_id=<?php echo $post->ID; ?>&type=image&tab=gallery&TB_iframe=1&width=640&height=566" class="thickbox" title="Manage Your Product Images"><?php _e( 'Manage Product Images', 'wpsc' ); ?></a></strong></p>
|
761 |
<?php
|
762 |
-
|
763 |
function wpsc_additional_desc() {
|
764 |
-
|
765 |
?>
|
766 |
<textarea name='additional_description' id='additional_description' cols='40' rows='5' ><?php echo stripslashes( $post->post_excerpt ); ?></textarea>
|
767 |
<?php
|
@@ -769,32 +774,32 @@ function wpsc_additional_desc() {
|
|
769 |
}
|
770 |
function wpsc_product_download_forms() {
|
771 |
|
772 |
-
|
773 |
-
|
774 |
|
775 |
-
|
776 |
|
777 |
$upload_max = wpsc_get_max_upload_size();
|
778 |
-
|
779 |
<?php echo wpsc_select_product_file( $post->ID ); ?>
|
780 |
<h4><?php _e( 'Upload New File', 'wpsc' ); ?>:</h4>
|
781 |
<input type='file' name='file' value='' /><br /><?php _e( 'Max Upload Size', 'wpsc' ); ?>:<span><?php echo $upload_max; ?></span><br /><br />
|
782 |
-
<h4><a href="admin.php?wpsc_admin_action=product_files_existing&product_id=<?php echo $post->ID; ?>" class="thickbox" title="<?php
|
783 |
<?php
|
784 |
-
|
785 |
-
|
786 |
<br />
|
787 |
-
<h4
|
788 |
-
<input type='file' name='preview_file' value='' /><br />
|
789 |
<br />
|
790 |
<?php
|
791 |
}
|
792 |
-
$output = apply_filters('wpsc_downloads_metabox', $output);
|
793 |
}
|
794 |
function wpsc_product_label_forms() {
|
795 |
-
|
796 |
?>
|
797 |
-
<div id='wpsc_product_label_forms' class='postbox <?php echo ((array_search( 'wpsc_product_label_forms', $product_data['closed_postboxes'] ) !== false) ? 'closed' : ''); ?>'><div class="handlediv" title="Click to toggle"><br></div>
|
798 |
<h3 class="<?php if ( function_exists( 'add_object_page' ) ) : ?>hndle<?php endif; ?>">
|
799 |
<?php if ( !function_exists( 'add_object_page' ) ) : ?>
|
800 |
|
@@ -854,17 +859,17 @@ function wpsc_product_label_forms() {
|
|
854 |
* Adding function to change text for media buttons
|
855 |
*/
|
856 |
function change_context( $context ) {
|
857 |
-
|
858 |
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
}
|
863 |
function change_link( $link ) {
|
864 |
-
|
865 |
|
866 |
-
|
867 |
-
|
868 |
|
869 |
$uploading_iframe_ID = $post_ID;
|
870 |
$media_upload_iframe_src = "media-upload.php?post_id=$uploading_iframe_ID";
|
@@ -872,7 +877,7 @@ function change_link( $link ) {
|
|
872 |
return $media_upload_iframe_src . "&type=image&parent_page=wpsc-edit-products";
|
873 |
}
|
874 |
function wpsc_form_multipart_encoding() {
|
875 |
-
|
876 |
}
|
877 |
|
878 |
add_action( 'post_edit_form_tag', 'wpsc_form_multipart_encoding' );
|
@@ -882,145 +887,149 @@ add_filter( 'image_upload_iframe_src', "change_link" );
|
|
882 |
* Modifications to Media Gallery
|
883 |
*/
|
884 |
|
885 |
-
if ( (isset( $_REQUEST['parent_page'] ) && ( $_REQUEST['parent_page'] == 'wpsc-edit-products' ) ) ) {
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
}
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
|
895 |
-
if( isset( $_REQUEST["save"] ) && isset($_REQUEST["attachments"]) && is_array($_REQUEST["attachments"]) ) {
|
896 |
-
wpsc_regenerate_thumbnails();
|
897 |
-
}
|
898 |
|
899 |
/*
|
900 |
-
* This filter translates string before it is displayed
|
901 |
* specifically for the words 'Use as featured image' with 'Use as Product Thumbnail' when the user is selecting a Product Thumbnail
|
902 |
* using media gallery.
|
903 |
-
*
|
904 |
* @param $translation The current translation
|
905 |
* @param $text The text being translated
|
906 |
* @param $domain The domain for the translation
|
907 |
* @return string The translated / filtered text.
|
908 |
*/
|
909 |
-
function wpsc_filter_feature_image_text($translation, $text, $domain) {
|
910 |
|
911 |
-
if( 'Use as featured image' == $text && isset( $_REQUEST['post_id'] ) ){
|
912 |
-
$
|
913 |
-
|
|
|
|
|
914 |
}
|
915 |
return $translation;
|
916 |
}
|
917 |
-
function wpsc_attachment_fields($form_fields, $post) {
|
|
|
|
|
|
|
|
|
918 |
|
919 |
-
|
920 |
|
921 |
-
|
922 |
-
|
923 |
-
//Unfortunate hack, as I'm not sure why the From Computer tab doesn't process filters the same way the Gallery does
|
924 |
-
|
925 |
-
echo '
|
926 |
-
<script type="text/javascript">
|
927 |
|
928 |
jQuery(function($){
|
929 |
-
|
930 |
var product_image = $("a.wp-post-thumbnail").text();
|
931 |
-
|
932 |
if (product_image == "Use as featured image") {
|
933 |
$("a.wp-post-thumbnail").text("Use as Product Thumbnail");
|
934 |
}
|
935 |
-
|
936 |
var trash = $("#media-upload a.del-link").text();
|
937 |
-
|
938 |
if (trash == "Delete") {
|
939 |
$("#media-upload a.del-link").text("Trash");
|
940 |
}
|
941 |
-
|
942 |
-
|
943 |
});
|
944 |
-
|
945 |
</script>';
|
946 |
-
|
947 |
-
|
948 |
$check = get_post_meta( $post->ID, '_wpsc_selected_image_size', true );
|
|
|
|
|
949 |
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
|
954 |
-
|
955 |
-
|
956 |
$css_id = "image-size-{$size}-{$post->ID}";
|
957 |
// if this size is the default but that's not available, don't select it
|
958 |
-
|
959 |
-
$html = "<div class='image-size-item'><input type='radio' " . disabled( $enabled, false, false ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}' ".checked($size, $check, false)." />";
|
960 |
|
961 |
-
|
962 |
-
// only show the dimensions if that choice is available
|
963 |
-
if ( $enabled )
|
964 |
-
$html .= " <label for='{$css_id}' class='help'>" . sprintf( __("(%d × %d)"), $downsize[1], $downsize[2] ). "</label>";
|
965 |
|
966 |
-
|
|
|
|
|
|
|
967 |
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
|
|
|
|
973 |
|
974 |
$form_fields["image-size"] = array(
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
);
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
$custom_thumb_size_w = get_post_meta($post->ID, "_wpsc_custom_thumb_w", true);
|
984 |
-
$custom_thumb_size_h = get_post_meta($post->ID, "_wpsc_custom_thumb_h", true);
|
985 |
$custom_thumb_html = "
|
986 |
-
|
987 |
<input style='width:50px; text-align:center' type='text' name='attachments[{$post->ID}][wpsc_custom_thumb_w]' value='{$custom_thumb_size_w}' /> X <input style='width:50px; text-align:center' type='text' name='attachments[{$post->ID}][wpsc_custom_thumb_h]' value='{$custom_thumb_size_h}' />
|
988 |
-
|
989 |
";
|
990 |
$form_fields["wpsc_custom_thumb"] = array(
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
function wpsc_save_attachment_fields($post, $attachment) {
|
1002 |
-
|
1003 |
-
if ( isset ( $attachment['wpsc_custom_thumb_w']) )
|
1004 |
-
update_post_meta($post['ID'], '_wpsc_custom_thumb_w', $attachment['wpsc_custom_thumb_w']);
|
1005 |
-
|
1006 |
-
if ( isset ( $attachment['wpsc_custom_thumb_h']) )
|
1007 |
-
update_post_meta($post['ID'], '_wpsc_custom_thumb_h', $attachment['wpsc_custom_thumb_h']);
|
1008 |
-
|
1009 |
-
if ( isset ( $attachment['image-size']) )
|
1010 |
-
update_post_meta($post['ID'], '_wpsc_selected_image_size', $attachment['image-size']);
|
1011 |
|
1012 |
return $post;
|
1013 |
}
|
1014 |
-
function wpsc_media_upload_url($form_action_url) {
|
1015 |
|
1016 |
-
$form_action_url = esc_url(add_query_arg(array('parent_page'=>'wpsc-edit-products')));
|
1017 |
|
1018 |
-
return $form_action_url;
|
1019 |
|
1020 |
}
|
1021 |
function wpsc_gallery_css_mods() {
|
1022 |
|
1023 |
-
|
1024 |
#gallery-settings *{
|
1025 |
display:none;
|
1026 |
}
|
@@ -1032,64 +1041,64 @@ function wpsc_gallery_css_mods() {
|
|
1032 |
}
|
1033 |
#media-upload a.wp-post-thumbnail {
|
1034 |
margin-left:0px;
|
1035 |
-
}
|
1036 |
td.savesend input.button {
|
1037 |
display:none;
|
1038 |
}
|
1039 |
</style>';
|
1040 |
-
print '
|
1041 |
-
<script type="text/javascript">
|
1042 |
|
1043 |
jQuery(function($){
|
1044 |
$("td.A1B1").each(function(){
|
1045 |
-
|
1046 |
var target = $(this).next();
|
1047 |
$("p > input.button", this).appendTo(target);
|
1048 |
|
1049 |
});
|
1050 |
-
|
1051 |
var title = $("div.media-item span.title").text();
|
1052 |
-
|
1053 |
if(title == "stopgap") {
|
1054 |
$("div.media-item").hide();
|
1055 |
}
|
1056 |
-
|
1057 |
var product_image = $("a.wp-post-thumbnail").text();
|
1058 |
-
|
1059 |
if (product_image == "Use as featured image") {
|
1060 |
$("a.wp-post-thumbnail").text("Use as Product Thumbnail");
|
1061 |
}
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
});
|
1066 |
-
|
1067 |
</script>';
|
1068 |
}
|
1069 |
-
function wpsc_media_upload_tab_gallery($tabs) {
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
|
1074 |
return $tabs;
|
1075 |
}
|
1076 |
-
function wpsc_filter_delete_text($translation, $text, $domain){
|
1077 |
|
1078 |
-
if( 'Delete' == $text && isset( $_REQUEST['post_id'] ) && isset( $_REQUEST["parent_page"] ) ){
|
1079 |
-
$translations = &get_translations_for_domain($domain);
|
1080 |
-
return $translations->translate('Trash') ;
|
1081 |
}
|
1082 |
return $translation;
|
1083 |
}
|
1084 |
function edit_multiple_image_gallery( $post ) {
|
1085 |
global $wpdb;
|
1086 |
-
|
1087 |
$siteurl = get_option( 'siteurl' );
|
1088 |
-
|
1089 |
if ( $post->ID > 0 ) {
|
1090 |
if ( has_post_thumbnail( $post->ID ) )
|
1091 |
echo get_the_post_thumbnail( $post->ID, 'admin-product-thumbnails' );
|
1092 |
-
|
1093 |
$args = array(
|
1094 |
'post_type' => 'attachment',
|
1095 |
'numberposts' => -1,
|
@@ -1100,111 +1109,116 @@ function edit_multiple_image_gallery( $post ) {
|
|
1100 |
);
|
1101 |
|
1102 |
$attached_images = (array)get_posts( $args );
|
1103 |
-
|
1104 |
-
if(count($attached_images) > 0){
|
1105 |
-
foreach($attached_images as $images){
|
1106 |
$attached_image = wp_get_attachment_image( $images->ID, 'admin-product-thumbnails' );
|
1107 |
echo $attached_image. ' ';
|
1108 |
}
|
1109 |
}
|
1110 |
-
|
1111 |
}
|
1112 |
}
|
1113 |
|
1114 |
/**
|
1115 |
-
* wpsc_save_quickedit_box function
|
1116 |
-
* Saves input for the various meta in the quick edit boxes
|
1117 |
-
*
|
1118 |
-
* @todo UI
|
1119 |
-
* @todo Data validation / sanitization / security
|
1120 |
-
* @todo AJAX should probably return weight unit
|
1121 |
-
* @return $post_id (int) Post ID
|
1122 |
-
*/
|
1123 |
|
1124 |
function wpsc_save_quickedit_box( $post_id ) {
|
1125 |
|
1126 |
-
|
1127 |
-
|
1128 |
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
|
1134 |
-
|
1135 |
-
|
1136 |
|
1137 |
-
|
1138 |
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
|
1147 |
-
|
1148 |
}
|
1149 |
|
1150 |
/**
|
1151 |
-
* wpsc_quick_edit_boxes function
|
1152 |
-
* Creates inputs for the various meta in the quick edit boxes.
|
1153 |
-
*
|
1154 |
* @todo UI
|
1155 |
-
* @internal
|
1156 |
-
|
|
|
1157 |
|
1158 |
-
function wpsc_quick_edit_boxes( $col_name ) {
|
1159 |
-
|
|
|
|
|
|
|
|
|
1160 |
|
1161 |
<fieldset class="inline-edit-col-left wpsc-cols">
|
1162 |
<div class="inline-edit-col">
|
1163 |
<div class="inline-edit-group">
|
1164 |
<?php
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
<label class="alignleft">
|
1169 |
-
<span class="checkbox-title wpsc-quick-edit"><?php _e('SKU:', 'wpsc'); ?> </span>
|
1170 |
-
<input type="text" name="sku"
|
1171 |
</label>
|
1172 |
<?php
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
<label class="alignleft">
|
1177 |
-
<span class="checkbox-title wpsc-quick-edit"><?php _e('Weight:', 'wpsc'); ?> </span>
|
1178 |
-
<input type="text" name="weight"
|
1179 |
</label>
|
1180 |
<?php
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
<label class="alignleft">
|
1185 |
-
<span class="checkbox-title wpsc-quick-edit"><?php _e('Stock:', 'wpsc'); ?> </span>
|
1186 |
-
<input type="text" name="stock"
|
1187 |
</label>
|
1188 |
<?php
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
<label class="alignleft">
|
1193 |
-
<span class="checkbox-title wpsc-quick-edit"><?php _e('Price:', 'wpsc'); ?> </span>
|
1194 |
-
<input type="text" name="price"
|
1195 |
</label>
|
1196 |
<?php
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
<label class="alignleft">
|
1201 |
-
<span class="checkbox-title wpsc-quick-edit"><?php _e('Sale Price:', 'wpsc'); ?> </span>
|
1202 |
-
<input type="text" name="sale_price"
|
1203 |
</label>
|
1204 |
<?php
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
</div>
|
1209 |
</div>
|
1210 |
</fieldset>
|
@@ -1212,7 +1226,7 @@ function wpsc_quick_edit_boxes( $col_name ) {
|
|
1212 |
}
|
1213 |
|
1214 |
add_action( 'bulk_edit_custom_box', 'wpsc_quick_edit_boxes', 10 );
|
1215 |
-
add_action( 'quick_edit_custom_box', 'wpsc_quick_edit_boxes', 10 );
|
1216 |
add_action( 'save_post', 'wpsc_save_quickedit_box' );
|
1217 |
|
1218 |
?>
|
55 |
),
|
56 |
),
|
57 |
);
|
58 |
+
add_action( 'admin_head', 'wpsc_css_header' );
|
59 |
|
60 |
+
function wpsc_redirect_variation_update( $location, $post_id ) {
|
61 |
global $post;
|
62 |
+
if ( $post->post_parent > 0 )
|
63 |
+
wp_redirect( admin_url( 'post.php?post='.$post->post_parent.'&action=edit' ) );
|
64 |
else
|
65 |
+
return $location;
|
66 |
+
|
67 |
}
|
68 |
|
69 |
+
add_filter( 'redirect_post_location', 'wpsc_redirect_variation_update', 10, 2 );
|
70 |
function wpsc_css_header() {
|
71 |
+
global $post_type;
|
72 |
+
?>
|
73 |
<style>
|
74 |
+
<?php if ( ( $_GET['post_type'] == 'wpsc-product' ) || ( $post_type == 'wpsc-product' ) ) : ?>
|
75 |
#icon-edit { background:transparent url('<?php echo WPSC_CORE_IMAGES_URL.'/icon32.png';?>') no-repeat; }
|
76 |
<?php endif; ?>
|
77 |
</style>
|
78 |
<?php
|
79 |
}
|
80 |
+
function wpsc_price_control_forms() {
|
81 |
global $post, $wpdb, $variations_processor, $wpsc_product_defaults;
|
82 |
+
$product_data = get_post_custom( $post->ID );
|
83 |
+
$product_data['meta'] = maybe_unserialize( $product_data );
|
|
|
|
|
|
|
84 |
|
85 |
+
foreach ( $product_data['meta'] as $meta_key => $meta_value )
|
86 |
+
$product_data['meta'][$meta_key] = $meta_value[0];
|
87 |
|
88 |
+
$product_meta = maybe_unserialize( $product_data["_wpsc_product_metadata"][0] );
|
89 |
+
if ( isset( $product_data['meta']['_wpsc_currency'] ) )
|
90 |
$product_alt_currency = maybe_unserialize( $product_data['meta']['_wpsc_currency'] );
|
91 |
+
|
92 |
+
if ( !isset( $product_data['meta']['_wpsc_table_rate_price'] ) ) {
|
93 |
$product_data['meta']['_wpsc_table_rate_price'] = $wpsc_product_defaults['meta']['table_rate_price'];
|
94 |
+
}
|
95 |
+
if ( isset( $product_meta['_wpsc_table_rate_price'] ) ) {
|
96 |
+
$product_meta['table_rate_price']['state'] = 1;
|
97 |
+
$product_meta['table_rate_price'] += $product_meta['_wpsc_table_rate_price'];
|
98 |
+
$product_data['meta']['_wpsc_table_rate_price'] = $product_meta['_wpsc_table_rate_price'];
|
99 |
+
}
|
100 |
+
|
101 |
+
|
102 |
if ( !isset( $product_data['meta']['_wpsc_is_donation'] ) )
|
103 |
$product_data['meta']['_wpsc_is_donation'] = $wpsc_product_defaults['donation'];
|
104 |
+
|
105 |
if ( !isset( $product_meta['table_rate_price']['state'] ) )
|
106 |
$product_meta['table_rate_price']['state'] = null;
|
107 |
+
|
108 |
if ( !isset( $product_meta['table_rate_price']['quantity'] ) )
|
109 |
$product_meta['table_rate_price']['quantity'] = $wpsc_product_defaults['meta']['table_rate_price']['quantity'][0];
|
110 |
+
|
111 |
if ( !isset( $product_data['meta']['_wpsc_price'] ) )
|
112 |
$product_data['meta']['_wpsc_price'] = $wpsc_product_defaults['price'];
|
113 |
+
|
114 |
if ( !isset( $product_data['special'] ) )
|
115 |
$product_data['special'] = $wpsc_product_defaults['special'];
|
116 |
+
|
117 |
if ( !isset( $product_data['meta']['_wpsc_special_price'] ) )
|
118 |
+
$product_data['meta']['_wpsc_special_price'] = $wpsc_product_defaults['special_price'];
|
119 |
+
|
120 |
+
$currency_data = $wpdb->get_results( "SELECT * FROM `" . WPSC_TABLE_CURRENCY_LIST . "` ORDER BY `country` ASC", ARRAY_A );
|
121 |
+
?>
|
122 |
<input type="hidden" id="parent_post" name="parent_post" value="<?php echo $post->post_parent; ?>" />
|
123 |
<?php /* Lots of tedious work is avoided with this little line. */ ?>
|
124 |
<input type="hidden" id="product_id" name="product_id" value="<?php echo $post->ID; ?>" />
|
125 |
|
126 |
<?php /* Check product if a product has variations (Wording doesn't make sense. If Variations box is closed, you don't go there, and it's not necessarily "below") */ ?>
|
127 |
+
<?php if ( wpsc_product_has_children( $post->ID ) ) : ?>
|
128 |
<?php $price = wpsc_product_variation_price_available( $post->ID ); ?>
|
129 |
+
<p><?php _e( 'This Product has variations, to edit the price please use the <a href="#variation_control">Variation Controls</a> below.' , 'wpsc' ); ?></p>
|
130 |
+
<p><?php printf( __( 'Price: %s and above.' , 'wpsc' ) , $price ); ?></p>
|
131 |
<?php else: ?>
|
132 |
+
|
133 |
<div class='wpsc_floatleft' style="width:85px;">
|
134 |
<label><?php _e( 'Price', 'wpsc' ); ?>:</label><br />
|
135 |
+
<input type='text' class='text' size='10' name='meta[_wpsc_price]' value='<?php echo number_format( $product_data['meta']['_wpsc_price'], 2, '.', '' ); ?>' />
|
136 |
</div>
|
137 |
+
<div class='wpsc_floatleft' style='display:<?php if ( ( $product_data['special'] == 1 ) ? 'block' : 'none'
|
138 |
+
); ?>; width:85px; margin-left:30px;'>
|
139 |
<label for='add_form_special'><?php _e( 'Sale Price', 'wpsc' ); ?>:</label>
|
140 |
<div id='add_special'>
|
141 |
+
<input type='text' size='10' value='<?php echo number_format( $product_data['meta']['_wpsc_special_price'], 2, '.', '' ); ?>' name='meta[_wpsc_special_price]' />
|
142 |
</div>
|
143 |
</div>
|
144 |
<br style="clear:both" />
|
145 |
<br style="clear:both" />
|
146 |
+
<a href='#' class='wpsc_add_new_currency'><?php _e( '+ New Currency', 'wpsc' ); ?></a>
|
147 |
<br />
|
148 |
<!-- add new currency layer -->
|
149 |
<div class='new_layer'>
|
150 |
<label for='newCurrency[]'><?php _e( 'Currency type', 'wpsc' ); ?>:</label><br />
|
151 |
<select name='newCurrency[]' class='newCurrency' style='width:42%'>
|
152 |
<?php
|
153 |
+
foreach ( (array)$currency_data as $currency ) {?>
|
154 |
<option value='<?php echo $currency['id']; ?>' >
|
155 |
<?php echo htmlspecialchars( $currency['country'] ); ?> (<?php echo $currency['currency']; ?>)
|
156 |
</option> <?php
|
157 |
+
} ?>
|
158 |
</select>
|
159 |
+
<?php _e( 'Price', 'wpsc' ); ?> :
|
160 |
<input type='text' class='text' size='8' name='newCurrPrice[]' value='0.00' style='display:inline' />
|
161 |
<a href='' class='deletelayer' rel='<?php echo $isocode; ?>'><img src='<?php echo WPSC_CORE_IMAGES_URL; ?>/cross.png' /></a>
|
162 |
|
163 |
</div> <!-- close new_layer -->
|
164 |
<?php
|
165 |
+
if ( isset( $product_alt_currency ) && is_array( $product_alt_currency ) ) :
|
166 |
$i = 0;
|
167 |
+
foreach ( $product_alt_currency as $iso => $alt_price ) {
|
168 |
+
$i++; ?>
|
169 |
<div class='wpsc_additional_currency'>
|
170 |
<label for='newCurrency[]'><?php _e( 'Currency type', 'wpsc' ); ?>:</label><br />
|
171 |
<select name='newCurrency[]' class='newCurrency' style='width:42%'> <?php
|
172 |
+
foreach ( $currency_data as $currency ) {
|
173 |
+
if ( $iso == $currency['isocode'] )
|
174 |
+
$selected = "selected='selected'";
|
175 |
+
else
|
176 |
+
$selected = ""; ?>
|
177 |
<option value='<?php echo $currency['id']; ?>' <?php echo $selected; ?> >
|
178 |
<?php echo htmlspecialchars( $currency['country'] ); ?> (<?php echo $currency['currency']; ?>)
|
179 |
</option> <?php
|
180 |
+
} ?>
|
181 |
</select>
|
182 |
+
<?php _e( 'Price:', 'wpsc' ); ?> <input type='text' class='text' size='8' name='newCurrPrice[]' value='<?php echo $alt_price; ?>' style=' display:inline' />
|
183 |
<a href='' class='wpsc_delete_currency_layer' rel='<?php echo $iso; ?>'><img src='<?php echo WPSC_CORE_IMAGES_URL; ?>/cross.png' /></a></div>
|
184 |
+
<?php }
|
185 |
+
|
186 |
+
endif;
|
187 |
|
188 |
+
echo "<br style='clear:both' />
|
189 |
+
<br/><input id='add_form_donation' type='checkbox' name='meta[_wpsc_is_donation]' value='yes' " . ( ( $product_data['meta']['_wpsc_is_donation'] == 1 ) ? 'checked="checked"' : '' ) . " /> <label for='add_form_donation'>" . __( 'This is a donation, checking this box populates the donations widget.', 'wpsc' ) . "</label>";
|
190 |
?>
|
191 |
+
<br /><br /> <input type='checkbox' value='1' name='table_rate_price[state]' id='table_rate_price' <?php echo ( ( (bool)$product_meta['table_rate_price']['state'] == true ) ? 'checked=\'checked\'' : '' ); ?> />
|
192 |
<label for='table_rate_price'><?php _e( 'Table Rate Price', 'wpsc' ); ?></label>
|
193 |
<div id='table_rate'>
|
194 |
+
<a class='add_level' style='cursor:pointer;'><?php _e( '+ Add level', 'wpsc' ); ?></a><br />
|
195 |
<br style='clear:both' />
|
196 |
<table>
|
197 |
<tr>
|
199 |
<th colspan='2'><?php _e( 'Discounted Price', 'wpsc' ); ?></th>
|
200 |
</tr>
|
201 |
<?php
|
202 |
+
if ( count( $product_meta['table_rate_price']['quantity'] ) > 0 ) {
|
203 |
+
foreach ( (array)$product_meta['table_rate_price']['quantity'] as $key => $quantity ) {
|
204 |
+
if ( $quantity != '' ) {
|
205 |
+
$table_price = number_format( $product_meta['table_rate_price']['table_price'][$key], 2, '.', '' );
|
206 |
?>
|
207 |
<tr>
|
208 |
<td>
|
209 |
+
<input type="text" size="5" value="<?php echo $quantity; ?>" name="table_rate_price[quantity][]"/><span class='description'><?php _e( 'and above', 'wpsc' ); ?></span>
|
210 |
</td>
|
211 |
<td>
|
212 |
<input type="text" size="10" value="<?php echo $table_price; ?>" name="table_rate_price[table_price][]" />
|
214 |
<td><img src="<?php echo WPSC_CORE_IMAGES_URL; ?>/cross.png" class="remove_line" /></td>
|
215 |
</tr>
|
216 |
<?php
|
|
|
|
|
217 |
}
|
218 |
+
}
|
219 |
+
}
|
220 |
?>
|
221 |
<tr>
|
222 |
+
<td><input type="text" size="5" value="<?php echo $quantity; ?>" name="table_rate_price[quantity][]"/><span class='description'><?php _e( 'and above', 'wpsc' ); ?></span> </td>
|
223 |
<td><input type='text' size='10' value='' name='table_rate_price[table_price][]'/></td>
|
224 |
</tr>
|
225 |
</table>
|
230 |
function wpsc_stock_control_forms() {
|
231 |
global $post, $wpdb, $variations_processor, $wpsc_product_defaults;
|
232 |
|
233 |
+
$product_data = get_post_custom( $post->ID );
|
234 |
+
$product_data['meta'] = maybe_unserialize( $product_data );
|
235 |
|
236 |
+
foreach ( $product_data['meta'] as $meta_key => $meta_value )
|
237 |
+
$product_data['meta'][$meta_key] = $meta_value[0];
|
238 |
|
239 |
+
$product_meta = maybe_unserialize( $product_data["_wpsc_product_metadata"][0] );
|
240 |
|
241 |
if ( !isset( $product_meta['unpublish_when_none_left'] ) )
|
242 |
$product_meta['unpublish_when_none_left'] = ''; ?>
|
243 |
+
|
244 |
+
<label for="wpsc_sku"><abbr title="<?php _e( 'Stock Keeping Unit', 'wpsc' ); ?>"><?php _e( 'SKU:', 'wpsc' ); ?></abbr></label>
|
245 |
<?php
|
246 |
+
if ( !isset( $product_data['meta']['_wpsc_sku'] ) )
|
247 |
+
$product_data['meta']['_wpsc_sku'] = $wpsc_product_defaults['meta']['sku']; ?><br />
|
248 |
<input size='32' type='text' class='text' id="wpsc_sku" name='meta[_wpsc_sku]' value='<?php echo htmlentities( stripslashes( $product_data['meta']['_wpsc_sku'] ), ENT_QUOTES, 'UTF-8' ); ?>' />
|
249 |
<br style="clear:both" />
|
250 |
<?php
|
251 |
+
if ( !isset( $product_data['meta']['_wpsc_stock'] ) )
|
252 |
+
$product_data['meta']['_wpsc_stock'] = ''; ?>
|
253 |
+
<br /><input class='limited_stock_checkbox' id='add_form_quantity_limited' type='checkbox' value='yes' <?php if ( is_numeric( $product_data['meta']['_wpsc_stock'] ) ) echo 'checked="checked"'; else echo ''; ?> name='meta[_wpsc_limited_stock]' />
|
254 |
<label for='add_form_quantity_limited' class='small'><?php _e( 'I have limited stock for this Product', 'wpsc' ); ?></label>
|
255 |
<?php
|
256 |
+
if ( $post->ID > 0 ) {
|
257 |
+
if ( is_numeric( $product_data['meta']['_wpsc_stock'] ) ) {?>
|
258 |
+
<div class='edit_stock' style='display: block;'> <?php
|
259 |
+
} else { ?>
|
260 |
<div class='edit_stock' style='display: none;'><?php
|
261 |
+
} ?>
|
262 |
+
<?php if ( wpsc_product_has_children( $post->ID ) ) : ?>
|
263 |
<?php $stock = wpsc_variations_stock_remaining( $post->ID ); ?>
|
264 |
<p><?php _e( 'This Product has variations, to edit the quantity please use the Variation Controls below.' , 'wpsc' ); ?></p>
|
265 |
+
<p><?php printf( _n( "%s variant item in stock.", "%s variant items in stock.", $stock ), $stock ); ?></p>
|
266 |
<?php else: ?>
|
267 |
<label for="stock_limit_quantity"><?php _e( 'Quantity:', 'wpsc' ); ?></label>
|
268 |
<input type='text' id="stock_limit_quantity" name='meta[_wpsc_stock]' size='3' value='<?php echo $product_data['meta']['_wpsc_stock']; ?>' class='stock_limit_quantity' />
|
269 |
<?php endif; ?>
|
270 |
<div class='unpublish_when_none_left'>
|
271 |
+
<input type='checkbox' id="inform_when_oos" name='meta[_wpsc_product_metadata][unpublish_when_none_left]' class='inform_when_oos'<?php if ( $product_meta['unpublish_when_none_left'] == 1 ) echo ' checked="checked"'; ?> />
|
272 |
<label for="inform_when_oos"><?php _e( 'Notify site owner and unpublish this Product if stock runs out', 'wpsc' ); ?></label>
|
273 |
</div>
|
274 |
+
<?php _e( 'If stock runs out, this Product will not be available on the shop unless you untick this box or add more stock.', 'wpsc' ); ?>
|
275 |
</div> <?php
|
276 |
+
} else { ?>
|
277 |
<div style='display: none;' class='edit_stock'>
|
278 |
<?php _e( 'Stock Qty', 'wpsc' ); ?><input type='text' name='meta[_wpsc_stock]' value='0' size='10' />
|
279 |
<div style='font-size:9px; padding:5px;'>
|
280 |
<input type='checkbox' class='inform_when_oos' name='meta[_wpsc_product_metadata][unpublish_when_none_left]' /> <?php _e( 'If this Product runs out of stock set status to Unpublished & email site owner', 'wpsc' ); ?>
|
281 |
</div>
|
282 |
</div><?php
|
283 |
+
}
|
284 |
?>
|
285 |
+
<?php
|
286 |
}
|
287 |
+
function wpsc_product_taxes_forms() {
|
288 |
global $post, $wpdb, $wpsc_product_defaults;
|
289 |
+
$product_data = get_post_custom( $post->ID );
|
290 |
+
|
291 |
+
$product_data['meta'] = $product_meta = maybe_unserialize( $product_data['_wpsc_product_metadata'][0] );
|
292 |
|
|
|
|
|
293 |
if ( !isset( $product_data['meta']['_wpsc_custom_tax'] ) )
|
294 |
$product_data['meta']['_wpsc_custom_tax'] = '';
|
295 |
$custom_tax = $product_data['meta']['_wpsc_custom_tax'];
|
296 |
|
297 |
+
|
298 |
+
if ( !isset( $product_meta['custom_tax'] ) ) {
|
299 |
+
$product_meta['custom_tax'] = 0.00;
|
300 |
+
}
|
301 |
+
|
302 |
//Add New WPEC-Taxes Bands Here
|
303 |
$wpec_taxes_controller = new wpec_taxes_controller();
|
304 |
|
306 |
$band_select_settings = array(
|
307 |
'id' => 'wpec_taxes_band',
|
308 |
'name' => 'meta[_wpsc_product_metadata][wpec_taxes_band]',
|
309 |
+
'label' => __( 'Custom Tax Band', 'wpsc' )
|
310 |
);
|
311 |
$wpec_taxes_band = '';
|
312 |
+
if ( isset( $product_meta['wpec_taxes_band'] ) ) {
|
313 |
+
$band = $wpec_taxes_controller->wpec_taxes->wpec_taxes_get_band_from_index( $product_meta['wpec_taxes_band'] );
|
314 |
+
$wpec_taxes_band = array( 'index'=>$band['index'], 'name'=>$band['name'] );
|
315 |
+
}
|
316 |
+
|
317 |
+
$taxable_checkbox_settings = array(
|
318 |
+
'type' => 'checkbox',
|
319 |
+
'id' => 'wpec_taxes_taxable',
|
320 |
+
'name' => 'meta[_wpsc_product_metadata][wpec_taxes_taxable]',
|
321 |
+
'label' => __( 'This product is not taxable.', 'wpsc' )
|
322 |
+
);
|
323 |
+
|
324 |
+
if ( isset( $product_meta['wpec_taxes_taxable'] ) && 'on' == $product_meta['wpec_taxes_taxable'] ) {
|
325 |
+
$taxable_checkbox_settings['checked'] = 'checked';
|
326 |
+
}
|
327 |
+
|
328 |
//add taxable amount only for exclusive tax
|
329 |
+
if ( !$wpec_taxes_controller->wpec_taxes_isincluded() ) {
|
|
|
330 |
$taxable_amount_input_settings = array(
|
331 |
'id' => 'wpec_taxes_taxable_amount',
|
332 |
'name' => 'meta[_wpsc_product_metadata][wpec_taxes_taxable_amount]',
|
333 |
+
'label' => __( 'Taxable Amount', 'wpsc' )
|
334 |
);
|
335 |
+
|
336 |
+
if ( isset( $product_meta['wpec_taxes_taxable_amount'] ) ) {
|
337 |
$taxable_amount_input_settings['value'] = $product_meta['wpec_taxes_taxable_amount'];
|
338 |
}
|
339 |
}// if
|
340 |
+
|
341 |
+
?>
|
342 |
<p><?php echo $wpec_taxes_controller->wpec_taxes_display_tax_bands( $band_select_settings, $wpec_taxes_band ); ?></p>
|
343 |
<p>
|
344 |
+
<?php if ( !$wpec_taxes_controller->wpec_taxes_isincluded() ): ?>
|
345 |
<?php echo $wpec_taxes_controller->wpec_taxes_build_input( $taxable_amount_input_settings );?>
|
346 |
<?php endif;?>
|
347 |
</p>
|
348 |
<p><?php echo $wpec_taxes_controller->wpec_taxes_build_input( $taxable_checkbox_settings ); ?></p>
|
349 |
+
<?php
|
350 |
}
|
351 |
function wpsc_product_variation_forms() {
|
352 |
global $post, $wpdb, $wp_query, $variations_processor, $wpsc_product_defaults;
|
353 |
|
354 |
+
$db_version = get_option( 'db_version' );
|
355 |
|
356 |
+
$product_data = get_post_custom( $post->ID );
|
357 |
+
$product_data['meta'] = maybe_unserialize( $product_data );
|
358 |
|
359 |
+
foreach ( $product_data['meta'] as $meta_key => $meta_value )
|
360 |
+
$product_data['meta'][$meta_key] = $meta_value[0];
|
361 |
|
362 |
+
$product_meta = maybe_unserialize( $product_data["_wpsc_product_metadata"][0] );
|
363 |
|
364 |
$siteurl = get_option( 'siteurl' );
|
365 |
$output = '';
|
373 |
$product_terms = array();
|
374 |
}
|
375 |
?>
|
376 |
+
<?php if ( empty( $post->post_title ) ) : ?>
|
377 |
<p><?php _e( 'You must first save this Product as a Draft before adding variations', 'wpsc' ); ?></p>
|
378 |
<?php else : ?>
|
379 |
<div id="product_variations">
|
380 |
<div class="variation_checkboxes">
|
381 |
<?php
|
382 |
+
// Get the terms from variations
|
383 |
+
$variation_sets = get_terms( 'wpsc-variation', array (
|
384 |
+
'hide_empty' => 0,
|
385 |
+
'parent' => 0
|
386 |
+
) );
|
387 |
+
// Loop through each variation set
|
388 |
+
foreach ( (array)$variation_sets as $variation_set ) :
|
389 |
+
$set_checked_state = '';
|
390 |
+
|
391 |
+
// If this Product includes this variation, check it
|
392 |
+
if ( in_array( $variation_set->term_id, $product_terms ) )
|
393 |
+
$set_checked_state = "checked='checked'"; ?>
|
394 |
<div class="variation_set">
|
395 |
|
396 |
<label class='set_label'>
|
399 |
</label>
|
400 |
|
401 |
<?php
|
402 |
+
$variations = get_terms( 'wpsc-variation', array (
|
403 |
+
'hide_empty' => 0,
|
404 |
+
'parent' => $variation_set->term_id
|
405 |
+
) );
|
406 |
+
// Loop through the variations
|
407 |
+
foreach ( (array)$variations as $variation ) :
|
408 |
+
$checked_state = '';
|
409 |
|
410 |
+
if ( in_array( $variation->term_id, $product_terms ) )
|
411 |
+
$checked_state = "checked='checked'";
|
412 |
|
413 |
+
?>
|
414 |
|
415 |
<div class="variation">
|
416 |
<label>
|
430 |
|
431 |
</div>
|
432 |
<?php
|
433 |
+
$parent_product = $post->ID;
|
434 |
+
|
435 |
+
$query = array(
|
436 |
+
'post_type' => 'wpsc-product',
|
437 |
+
'orderby' => 'menu_order post_title',
|
438 |
+
'post_parent' => $parent_product,
|
439 |
+
'post_status' => 'publish, inherit',
|
440 |
+
'order' => "ASC"
|
441 |
+
);
|
442 |
+
|
443 |
+
$args = array(
|
444 |
+
'post_type' => 'attachment',
|
445 |
+
'numberposts' => 1,
|
446 |
+
'post_status' => null,
|
447 |
+
'post_parent' => $parent_product,
|
448 |
+
'orderby' => 'menu_order',
|
449 |
+
'order' => 'ASC'
|
450 |
+
);
|
451 |
|
452 |
+
$image_data = (array)get_posts( $args );
|
453 |
+
$parent_product_data['image'] = array_shift( $image_data );
|
454 |
|
455 |
+
$wp_query = new WP_Query( $query );
|
456 |
+
if ( !isset( $parent_product_data ) )
|
457 |
+
$parent_product_data = null;
|
458 |
+
?>
|
459 |
|
460 |
+
<p><a name='variation_control'> </a><?php _e( 'Check or uncheck variation boxes and then click Update Variations to add or remove variations.', 'wpsc' ) ?></p>
|
461 |
|
462 |
<table class="widefat page" id='wpsc_product_list' cellspacing="0">
|
463 |
<thead>
|
474 |
|
475 |
<tbody>
|
476 |
<?php
|
477 |
+
wpsc_admin_product_listing( $parent_product_data );
|
478 |
+
?>
|
479 |
<?php
|
480 |
+
if ( count( $wp_query->posts ) < 1 ) :
|
481 |
?>
|
482 |
<tr>
|
483 |
<td colspan="8">
|
489 |
</tbody>
|
490 |
|
491 |
</table>
|
492 |
+
|
493 |
<?php
|
494 |
+
endif;
|
495 |
}
|
496 |
function wpsc_product_shipping_forms() {
|
497 |
global $post, $wpdb, $variations_processor, $wpsc_product_defaults;
|
498 |
|
499 |
+
$product_data = get_post_custom( $post->ID );
|
500 |
+
$product_data['meta'] = maybe_unserialize( $product_data );
|
501 |
|
502 |
+
foreach ( $product_data['meta'] as $meta_key => $meta_value )
|
503 |
+
$product_data['meta'][$meta_key] = $meta_value[0];
|
504 |
|
505 |
+
$product_meta = maybe_unserialize( $product_data["_wpsc_product_metadata"][0] );
|
506 |
|
507 |
+
$product_data['transformed'] = array();
|
508 |
+
if ( !isset( $product_meta['weight'] ) )
|
509 |
+
$product_meta['weight'] = "";
|
510 |
|
511 |
+
$product_data['transformed']['weight'] = wpsc_convert_weight( $product_meta['weight'], "pound", $product_meta['weight_unit'] );
|
512 |
|
513 |
+
?>
|
514 |
<table>
|
515 |
|
516 |
<!--USPS shipping changes-->
|
521 |
<td>
|
522 |
<input type='text' size='5' name='meta[_wpsc_product_metadata][weight]' value='<?php echo $product_data['transformed']['weight']; ?>' />
|
523 |
<select name='meta[_wpsc_product_metadata][weight_unit]'>
|
524 |
+
<option value='pound' <?php echo ( ( $product_meta['display_weight_as'] == 'pound' ) ? 'selected="selected"' : '' ); ?> ><?php _e( 'Pounds', 'wpsc' ); ?></option>
|
525 |
+
<option value='ounce' <?php echo ( ( preg_match( "/o(u)?nce/", $product_meta['display_weight_as'] ) ) ? 'selected="selected"' : '' ); ?> ><?php _e( 'Ounces', 'wpsc' ); ?></option>
|
526 |
+
<option value='gram' <?php echo ( ( $product_meta['display_weight_as'] == 'gram' ) ? 'selected="selected"' : '' ); ?> ><?php _e( 'Grams', 'wpsc' ); ?></option>
|
527 |
+
<option value='kilogram' <?php echo ( ( $product_meta['display_weight_as'] == 'kilogram' || $product_meta['display_weight_as'] == 'kilograms' ) ? 'selected="selected"' : '' ); ?> ><?php _e( 'Kilograms', 'wpsc' ); ?></option>
|
528 |
</select>
|
529 |
</td>
|
530 |
</tr>
|
536 |
<td>
|
537 |
<input type='text' size='5' name='meta[_wpsc_product_metadata][dimensions][height]' value= '<?php echo $product_meta['dimensions']['height']; ?>'>
|
538 |
<select name='meta[_wpsc_product_metadata][dimensions][height_unit]'>
|
539 |
+
<option value='in' <?php echo ( ( $product_meta['dimensions']['height_unit'] == 'in' ) ? 'selected' : '' ); ?> ><?php _e( 'inches', 'wpsc' ); ?></option>
|
540 |
+
<option value='cm' <?php echo ( ( $product_meta['dimensions']['height_unit'] == 'cm' ) ? 'selected' : '' ); ?> ><?php _e( 'cm', 'wpsc' ); ?></option>
|
541 |
+
<option value='meter' <?php echo ( ( $product_meta['dimensions']['height_unit'] == 'meter' ) ? 'selected' : '' ); ?> ><?php _e( 'meter', 'wpsc' ); ?></option>
|
542 |
</select>
|
543 |
</td>
|
544 |
</tr>
|
549 |
<td>
|
550 |
<input type='text' size='5' name='meta[_wpsc_product_metadata][dimensions][width]' value='<?php echo $product_meta['dimensions']['width']; ?> '>
|
551 |
<select name='meta[_wpsc_product_metadata][dimensions][width_unit]'>
|
552 |
+
<option value='in' <?php echo( ( $product_meta['dimensions']['width_unit'] == 'in' ) ? 'selected' : '' ); ?> ><?php _e( 'inches', 'wpsc' ); ?></option>
|
553 |
+
<option value='cm' <?php echo ( ( $product_meta['dimensions']['width_unit'] == 'cm' ) ? 'selected' : '' ); ?> ><?php _e( 'cm', 'wpsc' ); ?></option>
|
554 |
+
<option value='meter' <?php echo ( ( $product_meta['dimensions']['width_unit'] == 'meter' ) ? 'selected' : '' ); ?> ><?php _e( 'meter', 'wpsc' ); ?></option>
|
555 |
</select>
|
556 |
</td>
|
557 |
</tr>
|
562 |
<td>
|
563 |
<input type='text' size='5' name='meta[_wpsc_product_metadata][dimensions][length]' value='<?php echo $product_meta['dimensions']['length']; ?>'>
|
564 |
<select name='meta[_wpsc_product_metadata][dimensions][length_unit]'>
|
565 |
+
<option value='in' <?php echo( ( $product_meta['dimensions']['length_unit'] == 'in' ) ? 'selected' : '' ); ?> ><?php _e( 'inches', 'wpsc' ); ?></option>
|
566 |
+
<option value='cm' <?php echo( ( $product_meta['dimensions']['length_unit'] == 'cm' ) ? 'selected' : '' ); ?> ><?php _e( 'cm', 'wpsc' ); ?></option>
|
567 |
+
<option value='meter' <?php echo ( ( $product_meta['dimensions']['length_unit'] == 'meter' ) ? 'selected' : '' ); ?> ><?php _e( 'meter', 'wpsc' ); ?></option>
|
568 |
</select>
|
569 |
</td>
|
570 |
</tr>
|
596 |
<tr>
|
597 |
<td>
|
598 |
<br />
|
599 |
+
<input id='add_form_no_shipping' type='checkbox' name='meta[_wpsc_product_metadata][no_shipping]' value='1' <?php echo ( ( $product_meta['no_shipping'] == 1 ) ? 'checked="checked"' : '' ); ?> /> <label for='add_form_no_shipping'><?php _e( 'Disregard Shipping for this Product', 'wpsc' ); ?></label>
|
600 |
</td>
|
601 |
</tr>
|
602 |
</table>
|
603 |
<?php
|
604 |
+
}
|
605 |
function wpsc_product_advanced_forms() {
|
606 |
global $post, $wpdb, $variations_processor, $wpsc_product_defaults;
|
607 |
+
$product_data = get_post_custom( $post->ID );
|
608 |
|
609 |
+
$product_data['meta'] = $product_meta = maybe_unserialize( $product_data['_wpsc_product_metadata'][0] );
|
610 |
|
611 |
$custom_fields = $wpdb->get_results( "
|
612 |
SELECT
|
629 |
<a href='#' class='add_more_meta' onclick="return add_more_meta(this)"> + <?php _e( 'Add Custom Meta', 'wpsc' );?> </a><br /><br />
|
630 |
|
631 |
<?php
|
632 |
+
foreach ( (array)$custom_fields as $custom_field ) {
|
633 |
+
$i = $custom_field['meta_id'];
|
634 |
|
635 |
+
?>
|
636 |
<div class='product_custom_meta' id='custom_meta_<?php echo $i; ?>'>
|
637 |
<?php _e( 'Name', 'wpsc' ); ?>
|
638 |
<input type='text' class='text' value='<?php echo $custom_field['meta_key']; ?>' name='custom_meta[<?php echo $i; ?>][name]' id='custom_meta_name_<?php echo $i; ?>'>
|
639 |
<?php _e( 'Value', 'wpsc' ); ?>
|
640 |
<textarea class='text' name='custom_meta[<?php echo $i; ?>][value]' id='custom_meta_value_<?php echo $i; ?>'><?php echo $custom_field['meta_value']; ?></textarea>
|
641 |
+
<a href='#' class='remove_meta' onclick='return remove_meta(this, <?php echo $i; ?>)'><?php _e( 'Delete', 'wpsc' ); ?></a>
|
642 |
<br />
|
643 |
</div>
|
644 |
<?php
|
645 |
+
}
|
646 |
+
?>
|
647 |
<div class='product_custom_meta'>
|
648 |
<?php _e( 'Name', 'wpsc' ); ?>: <br />
|
649 |
<input type='text' name='new_custom_meta[name][]' value='' class='text'/><br />
|
658 |
|
659 |
<textarea cols='40' rows='3' name='meta[_wpsc_product_metadata][merchant_notes]' id='merchant_notes'>
|
660 |
<?php if ( isset( $product_meta['merchant_notes'] ) )
|
661 |
+
echo stripslashes( trim( $product_meta['merchant_notes'] ) );
|
662 |
+
?>
|
663 |
</textarea>
|
664 |
<small><?php _e( 'These notes are only available here.', 'wpsc' ); ?></small>
|
665 |
</td>
|
668 |
<td class='itemfirstcol' colspan='2'><br />
|
669 |
<strong><?php _e( 'Personalisation Options', 'wpsc' ); ?>:</strong><br />
|
670 |
<input type='hidden' name='meta[_wpsc_product_metadata][engraved]' value='0' />
|
671 |
+
<input type='checkbox' name='meta[_wpsc_product_metadata][engraved]' <?php echo ( ( $product_meta['engraved'] == true ) ? 'checked="checked"' : '' ); ?> id='add_engrave_text' />
|
672 |
<label for='add_engrave_text'><?php _e( 'Users can personalize this Product by leaving a message on single product page', 'wpsc' ); ?></label>
|
673 |
<br />
|
674 |
</td>
|
676 |
<tr>
|
677 |
<td class='itemfirstcol' colspan='2'>
|
678 |
<input type='hidden' name='meta[_wpsc_product_metadata][can_have_uploaded_image]' value='0' />
|
679 |
+
<input type='checkbox' name='meta[_wpsc_product_metadata][can_have_uploaded_image]' <?php echo ( $product_meta['can_have_uploaded_image'] == true ) ? 'checked="checked"' : ''; ?> id='can_have_uploaded_image' />
|
680 |
<label for='can_have_uploaded_image'> <?php _e( 'Users can upload images on single product page to purchase logs.', 'wpsc' ); ?> </label>
|
681 |
<br />
|
682 |
</td>
|
683 |
</tr>
|
684 |
<?php
|
685 |
+
if ( get_option( 'payment_gateway' ) == 'google' ) {
|
686 |
+
?>
|
687 |
<tr>
|
688 |
<td class='itemfirstcol' colspan='2'>
|
689 |
|
693 |
</td>
|
694 |
</tr>
|
695 |
<?php
|
696 |
+
}
|
697 |
+
ob_start();
|
698 |
+
do_action( 'wpsc_add_advanced_options', $post->ID );
|
699 |
+
ob_get_contents();
|
700 |
+
ob_end_clean();
|
701 |
+
?>
|
702 |
<tr>
|
703 |
<td class='itemfirstcol' colspan='2'><br />
|
704 |
<strong><?php _e( 'Enable Comments', 'wpsc' ); ?>:</strong><br />
|
705 |
<select name='meta[_wpsc_product_metadata][enable_comments]'>
|
706 |
+
<option value='' <?php echo ( ( isset( $product_meta['enable_comments'] ) && $product_meta['enable_comments'] == '' ) ? 'selected' : '' ); ?> ><?php _e( 'Use Default', 'wpsc' ); ?></option>
|
707 |
+
<option value='1' <?php echo ( ( isset( $product_meta['enable_comments'] ) && $product_meta['enable_comments'] == '1' ) ? 'selected' : '' ); ?> ><?php _e( 'Yes', 'wpsc' ); ?></option>
|
708 |
+
<option value='0' <?php echo ( ( isset( $product_meta['enable_comments'] ) && $product_meta['enable_comments'] == '0' ) ? 'selected' : '' ); ?> ><?php _e( 'No', 'wpsc' ); ?></option>
|
709 |
</select>
|
710 |
<br/><?php _e( 'Allow users to comment on this Product.', 'wpsc' ); ?>
|
711 |
</td>
|
712 |
</tr>
|
713 |
</table>
|
714 |
<?php
|
715 |
+
}
|
716 |
function wpsc_product_external_link_forms() {
|
717 |
|
718 |
+
global $post, $wpdb, $variations_processor, $wpsc_product_defaults;
|
719 |
+
$product_data = get_post_custom( $post->ID );
|
720 |
|
721 |
+
$product_data['meta'] = $product_meta = maybe_unserialize( $product_data['_wpsc_product_metadata'][0] );
|
722 |
|
723 |
// Get External Link Values
|
724 |
$external_link_value = isset( $product_meta['external_link'] ) ? $product_meta['external_link'] : '';
|
725 |
$external_link_text_value = isset( $product_meta['external_link_text'] ) ? $product_meta['external_link_text'] : '';
|
726 |
$external_link_target_value = isset( $product_meta['external_link_target'] ) ? $product_meta['external_link_target'] : '';
|
727 |
$external_link_target_value_selected[$external_link_target_value] = ' selected="selected"';
|
728 |
+
if ( !isset( $external_link_target_value_selected['_self'] ) ) $external_link_target_value_selected['_self'] = '';
|
729 |
+
if ( !isset( $external_link_target_value_selected['_blank'] ) ) $external_link_target_value_selected['_blank'] = '';
|
730 |
|
731 |
+
?>
|
732 |
<p><?php _e( 'If this product is for sale on another website enter the link here. For instance if your product is an MP3 file for sale on iTunes you could put the link here. This option overrides the buy now and add to cart links and takes you to the site linked here. You can also customise the Buy Now text and choose to open the link in a new window.', 'wpsc' ); ?>
|
733 |
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
|
734 |
<tbody>
|
744 |
<th valign="top" scope="row"><label for="external_link_target"><?php _e( 'External Link Target', 'wpsc' ); ?></label></th>
|
745 |
<td>
|
746 |
<select id="external_link_target" name="meta[_wpsc_product_metadata][external_link_target]">
|
747 |
+
<option value=""><?php _ex( 'Default (set by theme)', 'External product link target', 'wpsc' ); ?></option>
|
748 |
+
<option value="_self" <?php echo $external_link_target_value_selected['_self']; ?>><?php _e( 'Open link in the same window', 'wpsc' ); ?></option>
|
749 |
+
<option value="_blank" <?php echo $external_link_target_value_selected['_blank']; ?>><?php _e( 'Open link in a new window', 'wpsc' ); ?></option>
|
750 |
</select>
|
751 |
</td>
|
752 |
</tr>
|
756 |
}
|
757 |
function wpsc_product_image_forms() {
|
758 |
|
759 |
+
global $post;
|
760 |
+
|
761 |
+
edit_multiple_image_gallery( $post );
|
762 |
|
763 |
+
?>
|
764 |
|
765 |
<p><strong <?php if ( isset( $display ) ) echo $display; ?>><a href="media-upload.php?parent_page=wpsc-edit-products&post_id=<?php echo $post->ID; ?>&type=image&tab=gallery&TB_iframe=1&width=640&height=566" class="thickbox" title="Manage Your Product Images"><?php _e( 'Manage Product Images', 'wpsc' ); ?></a></strong></p>
|
766 |
<?php
|
767 |
+
}
|
768 |
function wpsc_additional_desc() {
|
769 |
+
global $post;
|
770 |
?>
|
771 |
<textarea name='additional_description' id='additional_description' cols='40' rows='5' ><?php echo stripslashes( $post->post_excerpt ); ?></textarea>
|
772 |
<?php
|
774 |
}
|
775 |
function wpsc_product_download_forms() {
|
776 |
|
777 |
+
global $post, $wpdb, $wpsc_product_defaults;
|
778 |
+
$product_data = get_post_custom( $post->ID );
|
779 |
|
780 |
+
$product_data['meta'] = $product_meta = maybe_unserialize( $product_data['_wpsc_product_metadata'][0] );
|
781 |
|
782 |
$upload_max = wpsc_get_max_upload_size();
|
783 |
+
?>
|
784 |
<?php echo wpsc_select_product_file( $post->ID ); ?>
|
785 |
<h4><?php _e( 'Upload New File', 'wpsc' ); ?>:</h4>
|
786 |
<input type='file' name='file' value='' /><br /><?php _e( 'Max Upload Size', 'wpsc' ); ?>:<span><?php echo $upload_max; ?></span><br /><br />
|
787 |
+
<h4><a href="admin.php?wpsc_admin_action=product_files_existing&product_id=<?php echo $post->ID; ?>" class="thickbox" title="<?php printf( __( 'Select all downloadable files for %s', 'wpsc' ), $post->post_title ); ?>"><?php _e( 'Select from existing files', 'wpsc' ); ?></a></h4>
|
788 |
<?php
|
789 |
+
if ( function_exists( "make_mp3_preview" ) || function_exists( "wpsc_media_player" ) ) {
|
790 |
+
?>
|
791 |
<br />
|
792 |
+
<h4><?php _e( "Select an MP3 file to upload as a preview", 'wpsc' ) ?></h4>
|
793 |
+
<input type='file' name='preview_file' value='' /><br />
|
794 |
<br />
|
795 |
<?php
|
796 |
}
|
797 |
+
$output = apply_filters( 'wpsc_downloads_metabox', $output );
|
798 |
}
|
799 |
function wpsc_product_label_forms() {
|
800 |
+
//This is new to me...not sure why this is even here
|
801 |
?>
|
802 |
+
<div id='wpsc_product_label_forms' class='postbox <?php echo ( ( array_search( 'wpsc_product_label_forms', $product_data['closed_postboxes'] ) !== false ) ? 'closed' : '' ); ?>'><div class="handlediv" title="<?php _e( 'Click to toggle', 'wpsc' ); ?>"><br></div>
|
803 |
<h3 class="<?php if ( function_exists( 'add_object_page' ) ) : ?>hndle<?php endif; ?>">
|
804 |
<?php if ( !function_exists( 'add_object_page' ) ) : ?>
|
805 |
|
859 |
* Adding function to change text for media buttons
|
860 |
*/
|
861 |
function change_context( $context ) {
|
862 |
+
global $current_screen;
|
863 |
|
864 |
+
if ( $current_screen->id != 'wpsc-product' )
|
865 |
+
return $context;
|
866 |
+
return __( 'Upload Image%s', 'wpsc' );
|
867 |
}
|
868 |
function change_link( $link ) {
|
869 |
+
global $post_ID, $current_screen;
|
870 |
|
871 |
+
if ( $current_screen->id != 'wpsc-product' )
|
872 |
+
return $link;
|
873 |
|
874 |
$uploading_iframe_ID = $post_ID;
|
875 |
$media_upload_iframe_src = "media-upload.php?post_id=$uploading_iframe_ID";
|
877 |
return $media_upload_iframe_src . "&type=image&parent_page=wpsc-edit-products";
|
878 |
}
|
879 |
function wpsc_form_multipart_encoding() {
|
880 |
+
echo ' enctype="multipart/form-data"';
|
881 |
}
|
882 |
|
883 |
add_action( 'post_edit_form_tag', 'wpsc_form_multipart_encoding' );
|
887 |
* Modifications to Media Gallery
|
888 |
*/
|
889 |
|
890 |
+
if ( ( isset( $_REQUEST['parent_page'] ) && ( $_REQUEST['parent_page'] == 'wpsc-edit-products' ) ) ) {
|
891 |
+
add_filter( 'media_upload_tabs', 'wpsc_media_upload_tab_gallery', 12 );
|
892 |
+
add_filter( 'attachment_fields_to_save', 'wpsc_save_attachment_fields', 9, 2 );
|
893 |
+
add_filter( 'media_upload_form_url', 'wpsc_media_upload_url', 9, 1 );
|
894 |
+
add_action( 'admin_head', 'wpsc_gallery_css_mods' );
|
895 |
}
|
896 |
+
add_filter( 'gettext', 'wpsc_filter_delete_text', 12 , 3 );
|
897 |
+
add_filter( 'attachment_fields_to_edit', 'wpsc_attachment_fields', 11, 2 );
|
898 |
+
add_filter( 'gettext', 'wpsc_filter_feature_image_text', 12, 3 );
|
899 |
|
900 |
+
if ( isset( $_REQUEST["save"] ) && isset( $_REQUEST["attachments"] ) && is_array( $_REQUEST["attachments"] ) ) {
|
901 |
+
//wpsc_regenerate_thumbnails();
|
902 |
+
}
|
903 |
|
904 |
/*
|
905 |
+
* This filter translates string before it is displayed
|
906 |
* specifically for the words 'Use as featured image' with 'Use as Product Thumbnail' when the user is selecting a Product Thumbnail
|
907 |
* using media gallery.
|
908 |
+
*
|
909 |
* @param $translation The current translation
|
910 |
* @param $text The text being translated
|
911 |
* @param $domain The domain for the translation
|
912 |
* @return string The translated / filtered text.
|
913 |
*/
|
914 |
+
function wpsc_filter_feature_image_text( $translation, $text, $domain ) {
|
915 |
|
916 |
+
if ( 'Use as featured image' == $text && isset( $_REQUEST['post_id'] ) ) {
|
917 |
+
$post = get_post( $_REQUEST['post_id'] );
|
918 |
+
if ( $post->post_type != 'wpsc-product' ) return $translation;
|
919 |
+
$translations = &get_translations_for_domain( $domain );
|
920 |
+
return $translations->translate( 'Use as Product Thumbnail', 'wpsc' ) ;
|
921 |
}
|
922 |
return $translation;
|
923 |
}
|
924 |
+
function wpsc_attachment_fields( $form_fields, $post ) {
|
925 |
+
|
926 |
+
$parent_post = get_post( $post->post_parent );
|
927 |
+
|
928 |
+
if ( $parent_post->post_type == "wpsc-product" || $parent_post->post_title == "stopgap" ) {
|
929 |
|
930 |
+
//Unfortunate hack, as I'm not sure why the From Computer tab doesn't process filters the same way the Gallery does
|
931 |
|
932 |
+
echo '
|
933 |
+
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
934 |
|
935 |
jQuery(function($){
|
936 |
+
|
937 |
var product_image = $("a.wp-post-thumbnail").text();
|
938 |
+
|
939 |
if (product_image == "Use as featured image") {
|
940 |
$("a.wp-post-thumbnail").text("Use as Product Thumbnail");
|
941 |
}
|
942 |
+
|
943 |
var trash = $("#media-upload a.del-link").text();
|
944 |
+
|
945 |
if (trash == "Delete") {
|
946 |
$("#media-upload a.del-link").text("Trash");
|
947 |
}
|
948 |
+
|
949 |
+
|
950 |
});
|
951 |
+
|
952 |
</script>';
|
953 |
+
$size_names = array( 'small-product-thumbnail' => __( 'Default Product Thumbnail Size', 'wpsc' ), 'medium-single-product' => __( 'Single Product Image Size', 'wpsc' ), 'full' => __( 'Full Size', 'wpsc' ) );
|
954 |
+
|
955 |
$check = get_post_meta( $post->ID, '_wpsc_selected_image_size', true );
|
956 |
+
if ( !$check )
|
957 |
+
$check = 'small-product-thumbnail';
|
958 |
|
959 |
+
//This loop attaches the custom thumbnail/single image sizes to this page
|
960 |
+
foreach ( $size_names as $size => $name ) {
|
961 |
+
$downsize = image_downsize( $post->ID, $size );
|
962 |
|
963 |
+
// is this size selectable?
|
964 |
+
$enabled = ( $downsize[3] || 'full' == $size );
|
965 |
$css_id = "image-size-{$size}-{$post->ID}";
|
966 |
// if this size is the default but that's not available, don't select it
|
|
|
|
|
967 |
|
968 |
+
$html = "<div class='image-size-item'><input type='radio' " . disabled( $enabled, false, false ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}' " . checked( $size, $check, false ) . " />";
|
|
|
|
|
|
|
969 |
|
970 |
+
$html .= "<label for='{$css_id}'>$name</label>";
|
971 |
+
// only show the dimensions if that choice is available
|
972 |
+
if ( $enabled )
|
973 |
+
$html .= " <label for='{$css_id}' class='help'>" . sprintf( __( "(%d × %d)", 'wpsc' ), $downsize[1], $downsize[2] ). "</label>";
|
974 |
|
975 |
+
$html .= '</div>';
|
976 |
+
|
977 |
+
$out .= $html;
|
978 |
+
}
|
979 |
+
|
980 |
+
unset( $form_fields['post_excerpt'], $form_fields['image_url'], $form_fields['post_content'], $form_fields['post_title'], $form_fields['url'], $form_fields['align'], $form_fields['image_alt']['helps'], $form_fields["image-size"] );
|
981 |
+
$form_fields['image_alt']['helps'] = __( 'Alt text for the product image, e.g. “Rockstar T-Shirt”', 'wpsc' );
|
982 |
|
983 |
$form_fields["image-size"] = array(
|
984 |
+
'label' => __( 'Single Product Page Thumbnail:', 'wpsc' ),
|
985 |
+
'input' => 'html',
|
986 |
+
'html' => $out,
|
987 |
+
'helps' => "<span style='text-align:left; clear:both; display:block; padding-top:3px;'>" . __( 'This is the Thumbnail size that will be displayed on the Single Product page. You can change the default sizes under your store settings', 'wpsc' ) . "</span>"
|
988 |
);
|
989 |
+
|
990 |
+
//This is for the custom thumbnail size.
|
991 |
+
|
992 |
+
$custom_thumb_size_w = get_post_meta( $post->ID, "_wpsc_custom_thumb_w", true );
|
993 |
+
$custom_thumb_size_h = get_post_meta( $post->ID, "_wpsc_custom_thumb_h", true );
|
994 |
$custom_thumb_html = "
|
995 |
+
|
996 |
<input style='width:50px; text-align:center' type='text' name='attachments[{$post->ID}][wpsc_custom_thumb_w]' value='{$custom_thumb_size_w}' /> X <input style='width:50px; text-align:center' type='text' name='attachments[{$post->ID}][wpsc_custom_thumb_h]' value='{$custom_thumb_size_h}' />
|
997 |
+
|
998 |
";
|
999 |
$form_fields["wpsc_custom_thumb"] = array(
|
1000 |
+
"label" => __( "Products Page Thumbnail Size:", 'wpsc' ),
|
1001 |
+
"input" => "html", // this is default if "input" is omitted
|
1002 |
+
"helps" => "<span style='text-align:left; clear:both; display:block; padding-top:3px;'>Custom thumbnail size for this image on the main Product Page</span>",
|
1003 |
+
"html" => $custom_thumb_html
|
1004 |
+
);
|
1005 |
+
|
1006 |
+
}
|
1007 |
+
return $form_fields;
|
1008 |
+
|
1009 |
+
}
|
1010 |
+
function wpsc_save_attachment_fields( $post, $attachment ) {
|
1011 |
+
|
1012 |
+
if ( isset ( $attachment['wpsc_custom_thumb_w'] ) )
|
1013 |
+
update_post_meta( $post['ID'], '_wpsc_custom_thumb_w', $attachment['wpsc_custom_thumb_w'] );
|
1014 |
+
|
1015 |
+
if ( isset ( $attachment['wpsc_custom_thumb_h'] ) )
|
1016 |
+
update_post_meta( $post['ID'], '_wpsc_custom_thumb_h', $attachment['wpsc_custom_thumb_h'] );
|
1017 |
+
|
1018 |
+
if ( isset ( $attachment['image-size'] ) )
|
1019 |
+
update_post_meta( $post['ID'], '_wpsc_selected_image_size', $attachment['image-size'] );
|
1020 |
|
1021 |
return $post;
|
1022 |
}
|
1023 |
+
function wpsc_media_upload_url( $form_action_url ) {
|
1024 |
|
1025 |
+
$form_action_url = esc_url( add_query_arg( array( 'parent_page'=>'wpsc-edit-products' ) ) );
|
1026 |
|
1027 |
+
return $form_action_url;
|
1028 |
|
1029 |
}
|
1030 |
function wpsc_gallery_css_mods() {
|
1031 |
|
1032 |
+
print '<style type="text/css">
|
1033 |
#gallery-settings *{
|
1034 |
display:none;
|
1035 |
}
|
1041 |
}
|
1042 |
#media-upload a.wp-post-thumbnail {
|
1043 |
margin-left:0px;
|
1044 |
+
}
|
1045 |
td.savesend input.button {
|
1046 |
display:none;
|
1047 |
}
|
1048 |
</style>';
|
1049 |
+
print '
|
1050 |
+
<script type="text/javascript">
|
1051 |
|
1052 |
jQuery(function($){
|
1053 |
$("td.A1B1").each(function(){
|
1054 |
+
|
1055 |
var target = $(this).next();
|
1056 |
$("p > input.button", this).appendTo(target);
|
1057 |
|
1058 |
});
|
1059 |
+
|
1060 |
var title = $("div.media-item span.title").text();
|
1061 |
+
|
1062 |
if(title == "stopgap") {
|
1063 |
$("div.media-item").hide();
|
1064 |
}
|
1065 |
+
|
1066 |
var product_image = $("a.wp-post-thumbnail").text();
|
1067 |
+
|
1068 |
if (product_image == "Use as featured image") {
|
1069 |
$("a.wp-post-thumbnail").text("Use as Product Thumbnail");
|
1070 |
}
|
1071 |
+
|
1072 |
+
|
1073 |
+
|
1074 |
});
|
1075 |
+
|
1076 |
</script>';
|
1077 |
}
|
1078 |
+
function wpsc_media_upload_tab_gallery( $tabs ) {
|
1079 |
+
|
1080 |
+
unset( $tabs['gallery'] );
|
1081 |
+
$tabs['gallery'] = __( 'Product Image Gallery', 'wpsc' );
|
1082 |
|
1083 |
return $tabs;
|
1084 |
}
|
1085 |
+
function wpsc_filter_delete_text( $translation, $text, $domain ) {
|
1086 |
|
1087 |
+
if ( 'Delete' == $text && isset( $_REQUEST['post_id'] ) && isset( $_REQUEST["parent_page"] ) ) {
|
1088 |
+
$translations = &get_translations_for_domain( $domain );
|
1089 |
+
return $translations->translate( 'Trash' ) ;
|
1090 |
}
|
1091 |
return $translation;
|
1092 |
}
|
1093 |
function edit_multiple_image_gallery( $post ) {
|
1094 |
global $wpdb;
|
1095 |
+
//Make sure thumbnail isn't duplicated
|
1096 |
$siteurl = get_option( 'siteurl' );
|
1097 |
+
|
1098 |
if ( $post->ID > 0 ) {
|
1099 |
if ( has_post_thumbnail( $post->ID ) )
|
1100 |
echo get_the_post_thumbnail( $post->ID, 'admin-product-thumbnails' );
|
1101 |
+
|
1102 |
$args = array(
|
1103 |
'post_type' => 'attachment',
|
1104 |
'numberposts' => -1,
|
1109 |
);
|
1110 |
|
1111 |
$attached_images = (array)get_posts( $args );
|
1112 |
+
|
1113 |
+
if ( count( $attached_images ) > 0 ) {
|
1114 |
+
foreach ( $attached_images as $images ) {
|
1115 |
$attached_image = wp_get_attachment_image( $images->ID, 'admin-product-thumbnails' );
|
1116 |
echo $attached_image. ' ';
|
1117 |
}
|
1118 |
}
|
1119 |
+
|
1120 |
}
|
1121 |
}
|
1122 |
|
1123 |
/**
|
1124 |
+
* wpsc_save_quickedit_box function
|
1125 |
+
* Saves input for the various meta in the quick edit boxes
|
1126 |
+
*
|
1127 |
+
* @todo UI
|
1128 |
+
* @todo Data validation / sanitization / security
|
1129 |
+
* @todo AJAX should probably return weight unit
|
1130 |
+
* @return $post_id (int) Post ID
|
1131 |
+
*/
|
1132 |
|
1133 |
function wpsc_save_quickedit_box( $post_id ) {
|
1134 |
|
1135 |
+
if ( !defined( 'DOING_AJAX' ) )
|
1136 |
+
return;
|
1137 |
|
1138 |
+
$is_parent = ( bool )wpsc_product_has_children( $post_id );
|
1139 |
+
$product_meta = get_post_meta( $post_id, '_wpsc_product_metadata', true );
|
1140 |
+
$weight_unit = $product_meta["weight_unit"];
|
1141 |
+
$weight = wpsc_convert_weight( $_POST["weight"], $weight_unit, "pound" );
|
1142 |
|
1143 |
+
if ( isset( $product_meta["weight"] ) )
|
1144 |
+
unset( $product_meta["weight"] );
|
1145 |
|
1146 |
+
$product_meta["weight"] = $weight;
|
1147 |
|
1148 |
+
if ( !$is_parent ) {
|
1149 |
+
update_post_meta( $post_id, '_wpsc_product_metadata', $product_meta );
|
1150 |
+
update_post_meta( $post_id, '_wpsc_stock', $_POST['stock'] );
|
1151 |
+
update_post_meta( $post_id, '_wpsc_price', $_POST['price'] );
|
1152 |
+
update_post_meta( $post_id, '_wpsc_special_price', $_POST['sale_price'] );
|
1153 |
+
}
|
1154 |
+
update_post_meta( $post_id, '_wpsc_sku', $_POST['sku'] );
|
1155 |
|
1156 |
+
return $post_id;
|
1157 |
}
|
1158 |
|
1159 |
/**
|
1160 |
+
* wpsc_quick_edit_boxes function
|
1161 |
+
* Creates inputs for the various meta in the quick edit boxes.
|
1162 |
+
*
|
1163 |
* @todo UI
|
1164 |
+
* @internal The post_id cannot be accessed here because this gets output at the very end
|
1165 |
+
* of the editor form, and injected within relevant rows using javascript.
|
1166 |
+
*/
|
1167 |
|
1168 |
+
function wpsc_quick_edit_boxes( $col_name, $_screen_post_type = null ) {
|
1169 |
+
// Avoid outputting this on term edit screens.
|
1170 |
+
// See http://core.trac.wordpress.org/ticket/16392#comment:9
|
1171 |
+
if ( current_filter() == 'quick_edit_custom_box' && $_screen_post_type == 'edit-tags' )
|
1172 |
+
return;
|
1173 |
+
?>
|
1174 |
|
1175 |
<fieldset class="inline-edit-col-left wpsc-cols">
|
1176 |
<div class="inline-edit-col">
|
1177 |
<div class="inline-edit-group">
|
1178 |
<?php
|
1179 |
+
switch ( $col_name ) :
|
1180 |
+
case 'SKU' :
|
1181 |
+
?>
|
1182 |
<label class="alignleft">
|
1183 |
+
<span class="checkbox-title wpsc-quick-edit"><?php _e( 'SKU:', 'wpsc' ); ?> </span>
|
1184 |
+
<input type="text" name="sku" class="wpsc_ie_sku">
|
1185 |
</label>
|
1186 |
<?php
|
1187 |
+
break;
|
1188 |
+
case 'weight' :
|
1189 |
+
?>
|
1190 |
<label class="alignleft">
|
1191 |
+
<span class="checkbox-title wpsc-quick-edit"><?php _e( 'Weight:', 'wpsc' ); ?> </span>
|
1192 |
+
<input type="text" name="weight" class="wpsc_ie_weight">
|
1193 |
</label>
|
1194 |
<?php
|
1195 |
+
break;
|
1196 |
+
case 'stock' :
|
1197 |
+
?>
|
1198 |
<label class="alignleft">
|
1199 |
+
<span class="checkbox-title wpsc-quick-edit"><?php _e( 'Stock:', 'wpsc' ); ?> </span>
|
1200 |
+
<input type="text" name="stock" class="wpsc_ie_stock">
|
1201 |
</label>
|
1202 |
<?php
|
1203 |
+
break;
|
1204 |
+
case 'price' :
|
1205 |
+
?>
|
1206 |
<label class="alignleft">
|
1207 |
+
<span class="checkbox-title wpsc-quick-edit"><?php _e( 'Price:', 'wpsc' ); ?> </span>
|
1208 |
+
<input type="text" name="price" class="wpsc_ie_price">
|
1209 |
</label>
|
1210 |
<?php
|
1211 |
+
break;
|
1212 |
+
case 'sale_price' :
|
1213 |
+
?>
|
1214 |
<label class="alignleft">
|
1215 |
+
<span class="checkbox-title wpsc-quick-edit"><?php _e( 'Sale Price:', 'wpsc' ); ?> </span>
|
1216 |
+
<input type="text" name="sale_price" class="wpsc_ie_sale_price">
|
1217 |
</label>
|
1218 |
<?php
|
1219 |
+
break;
|
1220 |
+
endswitch;
|
1221 |
+
?>
|
1222 |
</div>
|
1223 |
</div>
|
1224 |
</fieldset>
|
1226 |
}
|
1227 |
|
1228 |
add_action( 'bulk_edit_custom_box', 'wpsc_quick_edit_boxes', 10 );
|
1229 |
+
add_action( 'quick_edit_custom_box', 'wpsc_quick_edit_boxes', 10, 2 );
|
1230 |
add_action( 'save_post', 'wpsc_save_quickedit_box' );
|
1231 |
|
1232 |
?>
|
wpsc-admin/includes/product-functions.php
CHANGED
@@ -41,16 +41,19 @@ function wpsc_product_has_children($id){
|
|
41 |
* @return nothing
|
42 |
*/
|
43 |
function wpsc_admin_submit_product( $post_ID, $post ) {
|
|
|
44 |
global $current_screen, $wpdb;
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
50 |
$post_data['additional_description'] = isset($post_data['additional_description']) ? $post_data['additional_description'] : '';
|
51 |
-
|
52 |
-
$post_data['meta']['_wpsc_price'] = (float)str_replace( ',','',$post_data['meta']['_wpsc_price'] );
|
53 |
-
$post_data['meta']['_wpsc_special_price'] = (float)str_replace( ',','',$post_data['meta']['_wpsc_special_price'] );
|
54 |
$post_data['meta']['_wpsc_sku'] = $post_data['meta']['_wpsc_sku'];
|
55 |
if (!isset($post_data['meta']['_wpsc_is_donation'])) $post_data['meta']['_wpsc_is_donation'] = '';
|
56 |
$post_data['meta']['_wpsc_is_donation'] = (int)(bool)$post_data['meta']['_wpsc_is_donation'];
|
@@ -153,7 +156,6 @@ function wpsc_admin_submit_product( $post_ID, $post ) {
|
|
153 |
// if we succeed, we can do further editing (todo - if_wp_error)
|
154 |
|
155 |
// and the meta
|
156 |
-
|
157 |
wpsc_update_product_meta($product_id, $post_data['meta']);
|
158 |
|
159 |
// and the custom meta
|
@@ -183,16 +185,19 @@ function wpsc_admin_submit_product( $post_ID, $post ) {
|
|
183 |
return $product_id;
|
184 |
}
|
185 |
function wpsc_pre_update( $data , $postarr ) {
|
186 |
-
|
187 |
-
return;
|
188 |
-
|
189 |
if( isset( $postarr["additional_description"] ) && !empty( $postarr["additional_description"] ) )
|
190 |
$data["post_excerpt"] = $postarr["additional_description"];
|
191 |
|
192 |
if( isset( $postarr["parent_post"] ) && !empty( $postarr["parent_post"] ) )
|
193 |
$data["post_parent"] = $postarr["parent_post"];
|
194 |
|
195 |
-
|
|
|
|
|
|
|
|
|
196 |
if ( $postarr['meta']['_wpsc_product_metadata']['enable_comments'] == 0 || empty( $postarr['meta']['_wpsc_product_metadata']['enable_comments'] ) )
|
197 |
$data["comment_status"] = "closed";
|
198 |
else
|
@@ -278,7 +283,7 @@ function wpsc_sanitise_product_forms($post_data = null) {
|
|
278 |
if(!isset($post_data['meta']['_wpsc_product_metadata']['display_weight_as'])) $post_data['meta']['_wpsc_product_metadata']['display_weight_as'] = '';
|
279 |
if(!isset($post_data['meta']['_wpsc_product_metadata']['display_weight_as'])) $post_data['meta']['_wpsc_product_metadata']['display_weight_as'] = '';
|
280 |
|
281 |
-
$weight = wpsc_convert_weight($post_data['meta']['_wpsc_product_metadata']['weight'], $post_data['meta']['_wpsc_product_metadata']['weight_unit'], "
|
282 |
$post_data['meta']['_wpsc_product_metadata']['weight'] = (float)$weight;
|
283 |
$post_data['meta']['_wpsc_product_metadata']['display_weight_as'] = $post_data['meta']['_wpsc_product_metadata']['weight_unit'];
|
284 |
|
@@ -528,9 +533,13 @@ function term_id_price($term_id, $parent_price) {
|
|
528 |
*/
|
529 |
function wpsc_edit_product_variations($product_id, $post_data) {
|
530 |
global $wpdb, $user_ID;
|
|
|
|
|
|
|
531 |
$variations = array();
|
532 |
$product_children = array();
|
533 |
-
if (!isset($post_data['edit_var_val']))
|
|
|
534 |
|
535 |
$variations = (array)$post_data['edit_var_val'];
|
536 |
|
41 |
* @return nothing
|
42 |
*/
|
43 |
function wpsc_admin_submit_product( $post_ID, $post ) {
|
44 |
+
|
45 |
global $current_screen, $wpdb;
|
46 |
+
|
47 |
+
if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || $current_screen->id != 'wpsc-product' )
|
48 |
+
return $post_ID;
|
49 |
+
|
50 |
+
//Type-casting ( not so much sanitization, which would be good to do )
|
51 |
+
$post_data = $_POST;
|
52 |
+
$product_id = $post_ID;
|
53 |
$post_data['additional_description'] = isset($post_data['additional_description']) ? $post_data['additional_description'] : '';
|
54 |
+
$post_meta['meta'] = (array)$_POST['meta'];
|
55 |
+
$post_data['meta']['_wpsc_price'] = abs((float)str_replace( ',','',$post_data['meta']['_wpsc_price'] ));
|
56 |
+
$post_data['meta']['_wpsc_special_price'] = abs((float)str_replace( ',','',$post_data['meta']['_wpsc_special_price'] ));
|
57 |
$post_data['meta']['_wpsc_sku'] = $post_data['meta']['_wpsc_sku'];
|
58 |
if (!isset($post_data['meta']['_wpsc_is_donation'])) $post_data['meta']['_wpsc_is_donation'] = '';
|
59 |
$post_data['meta']['_wpsc_is_donation'] = (int)(bool)$post_data['meta']['_wpsc_is_donation'];
|
156 |
// if we succeed, we can do further editing (todo - if_wp_error)
|
157 |
|
158 |
// and the meta
|
|
|
159 |
wpsc_update_product_meta($product_id, $post_data['meta']);
|
160 |
|
161 |
// and the custom meta
|
185 |
return $product_id;
|
186 |
}
|
187 |
function wpsc_pre_update( $data , $postarr ) {
|
188 |
+
if ( (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || $postarr["post_type"] != 'wpsc-product' )
|
189 |
+
return $data;
|
|
|
190 |
if( isset( $postarr["additional_description"] ) && !empty( $postarr["additional_description"] ) )
|
191 |
$data["post_excerpt"] = $postarr["additional_description"];
|
192 |
|
193 |
if( isset( $postarr["parent_post"] ) && !empty( $postarr["parent_post"] ) )
|
194 |
$data["post_parent"] = $postarr["parent_post"];
|
195 |
|
196 |
+
// Sanitize status for variations (see #324)
|
197 |
+
if ($data['post_parent'] && $data['post_parent'] != $data['ID']) {
|
198 |
+
$data['post_status'] = 'inherit';
|
199 |
+
}
|
200 |
+
|
201 |
if ( $postarr['meta']['_wpsc_product_metadata']['enable_comments'] == 0 || empty( $postarr['meta']['_wpsc_product_metadata']['enable_comments'] ) )
|
202 |
$data["comment_status"] = "closed";
|
203 |
else
|
283 |
if(!isset($post_data['meta']['_wpsc_product_metadata']['display_weight_as'])) $post_data['meta']['_wpsc_product_metadata']['display_weight_as'] = '';
|
284 |
if(!isset($post_data['meta']['_wpsc_product_metadata']['display_weight_as'])) $post_data['meta']['_wpsc_product_metadata']['display_weight_as'] = '';
|
285 |
|
286 |
+
$weight = wpsc_convert_weight($post_data['meta']['_wpsc_product_metadata']['weight'], $post_data['meta']['_wpsc_product_metadata']['weight_unit'], "pound");
|
287 |
$post_data['meta']['_wpsc_product_metadata']['weight'] = (float)$weight;
|
288 |
$post_data['meta']['_wpsc_product_metadata']['display_weight_as'] = $post_data['meta']['_wpsc_product_metadata']['weight_unit'];
|
289 |
|
533 |
*/
|
534 |
function wpsc_edit_product_variations($product_id, $post_data) {
|
535 |
global $wpdb, $user_ID;
|
536 |
+
$parent = $wpdb->get_var('SELECT post_parent FROM ' . $wpdb->posts . ' WHERE ID = '.$product_id);
|
537 |
+
if(!empty($parent))
|
538 |
+
return;
|
539 |
$variations = array();
|
540 |
$product_children = array();
|
541 |
+
if (!isset($post_data['edit_var_val']))
|
542 |
+
$post_data['edit_var_val'] = '';
|
543 |
|
544 |
$variations = (array)$post_data['edit_var_val'];
|
545 |
|
wpsc-admin/includes/products.php
CHANGED
@@ -17,9 +17,10 @@ function wpsc_admin_product_listing($parent_product = null) {
|
|
17 |
global $wp_query, $wpsc_products;
|
18 |
|
19 |
add_filter('the_title','esc_html');
|
20 |
-
|
|
|
21 |
if ( empty($wpsc_products) )
|
22 |
-
|
23 |
|
24 |
foreach ( (array)$wpsc_products as $product ) {
|
25 |
wpsc_product_row($product, $parent_product);
|
@@ -157,11 +158,13 @@ function wpsc_product_row(&$product, $parent_product = null) {
|
|
157 |
?>
|
158 |
</strong>
|
159 |
<?php
|
160 |
-
|
|
|
|
|
161 |
$actions = array();
|
162 |
if ( current_user_can('edit_post', $product->ID) && 'trash' != $product->post_status ) {
|
163 |
$actions['edit'] = '<a class="edit-product" href="'.$edit_link.'" title="' . esc_attr(__('Edit this product', 'wpsc')) . '">'. __('Edit', 'wpsc') . '</a>';
|
164 |
-
$actions['quick_edit'] = "<a class='wpsc_editinline' title='".esc_attr(__('Quick Edit', 'wpsc'))."' href='#'>".__('Quick Edit')."</a>";
|
165 |
}
|
166 |
|
167 |
if ( in_array($product->post_status, array('pending', 'draft')) ) {
|
@@ -238,7 +241,7 @@ function wpsc_product_row(&$product, $parent_product = null) {
|
|
238 |
|
239 |
case 'price': /* !price case */
|
240 |
|
241 |
-
$price =
|
242 |
?>
|
243 |
<td <?php echo $attributes ?>>
|
244 |
<?php echo wpsc_currency_display( $price ); ?>
|
@@ -258,7 +261,7 @@ function wpsc_product_row(&$product, $parent_product = null) {
|
|
258 |
if(!isset($product_data['meta']['_wpsc_product_metadata']['weight'])) $product_data['meta']['_wpsc_product_metadata']['weight'] = "";
|
259 |
if(!isset($product_data['meta']['_wpsc_product_metadata']['weight_unit'])) $product_data['meta']['_wpsc_product_metadata']['weight_unit'] = "";
|
260 |
|
261 |
-
$product_data['transformed']['weight'] = wpsc_convert_weight($product_data['meta']['_wpsc_product_metadata']['weight'], "
|
262 |
$weight = $product_data['transformed']['weight'];
|
263 |
if($weight == ''){
|
264 |
$weight = '0';
|
@@ -272,13 +275,13 @@ function wpsc_product_row(&$product, $parent_product = null) {
|
|
272 |
case "ounce":
|
273 |
$unit = " oz.";
|
274 |
break;
|
275 |
-
case "gram":
|
276 |
-
$unit = " g";
|
277 |
-
break;
|
278 |
case "kilograms":
|
279 |
case "kilogram":
|
280 |
$unit = " kgs.";
|
281 |
break;
|
|
|
|
|
|
|
282 |
}
|
283 |
?>
|
284 |
<td <?php echo $attributes ?>>
|
17 |
global $wp_query, $wpsc_products;
|
18 |
|
19 |
add_filter('the_title','esc_html');
|
20 |
+
$args = array_merge( $wp_query->query, array( 'posts_per_page' => '-1', 'post_status' => 'all' ) );
|
21 |
+
$wpsc_temp_query = query_posts( $args );
|
22 |
if ( empty($wpsc_products) )
|
23 |
+
$wpsc_products = &$wpsc_temp_query;
|
24 |
|
25 |
foreach ( (array)$wpsc_products as $product ) {
|
26 |
wpsc_product_row($product, $parent_product);
|
158 |
?>
|
159 |
</strong>
|
160 |
<?php
|
161 |
+
$has_var = '';
|
162 |
+
if(wpsc_product_has_children($product->ID))
|
163 |
+
$has_var = 'wpsc_has_variation';
|
164 |
$actions = array();
|
165 |
if ( current_user_can('edit_post', $product->ID) && 'trash' != $product->post_status ) {
|
166 |
$actions['edit'] = '<a class="edit-product" href="'.$edit_link.'" title="' . esc_attr(__('Edit this product', 'wpsc')) . '">'. __('Edit', 'wpsc') . '</a>';
|
167 |
+
$actions['quick_edit'] = "<a class='wpsc_editinline ".$has_var."' title='".esc_attr(__('Quick Edit', 'wpsc'))."' href='#'>".__('Quick Edit')."</a>";
|
168 |
}
|
169 |
|
170 |
if ( in_array($product->post_status, array('pending', 'draft')) ) {
|
241 |
|
242 |
case 'price': /* !price case */
|
243 |
|
244 |
+
$price = get_product_meta($product->ID, 'price', true);
|
245 |
?>
|
246 |
<td <?php echo $attributes ?>>
|
247 |
<?php echo wpsc_currency_display( $price ); ?>
|
261 |
if(!isset($product_data['meta']['_wpsc_product_metadata']['weight'])) $product_data['meta']['_wpsc_product_metadata']['weight'] = "";
|
262 |
if(!isset($product_data['meta']['_wpsc_product_metadata']['weight_unit'])) $product_data['meta']['_wpsc_product_metadata']['weight_unit'] = "";
|
263 |
|
264 |
+
$product_data['transformed']['weight'] = wpsc_convert_weight($product_data['meta']['_wpsc_product_metadata']['weight'], "pound", $product_data['meta']['_wpsc_product_metadata']['weight_unit']);
|
265 |
$weight = $product_data['transformed']['weight'];
|
266 |
if($weight == ''){
|
267 |
$weight = '0';
|
275 |
case "ounce":
|
276 |
$unit = " oz.";
|
277 |
break;
|
|
|
|
|
|
|
278 |
case "kilograms":
|
279 |
case "kilogram":
|
280 |
$unit = " kgs.";
|
281 |
break;
|
282 |
+
case "gram":
|
283 |
+
default:
|
284 |
+
$unit = " g";
|
285 |
}
|
286 |
?>
|
287 |
<td <?php echo $attributes ?>>
|
wpsc-admin/includes/settings-pages/general.php
CHANGED
@@ -55,8 +55,7 @@ function wpsc_options_general() {
|
|
55 |
<?php
|
56 |
// check for the suhosin module
|
57 |
if ( @extension_loaded( 'suhosin' ) && (@ini_get( 'suhosin.post.max_vars' ) > 0) && (@ini_get( 'suhosin.post.max_vars' ) < 500) ) {
|
58 |
-
echo "<em>" . __( "The Target Markets feature has been disabled because you have the Suhosin PHP extension installed on this server. If you need to use the Target Markets feature then disable the suhosin extension, if you can not do this, you will need to contact your hosting provider.
|
59 |
-
", 'wpsc' ) . "</em>";
|
60 |
} else {
|
61 |
?>
|
62 |
<span>Select: <a href='<?php echo add_query_arg( array( 'selected_all' => 'all' ) ) ?>' class='wpsc_select_all'>All</a> <a href='<?php echo add_query_arg( array( 'selected_all' => 'none' ) ) ?>' class='wpsc_select_none'>None</a></span><br />
|
55 |
<?php
|
56 |
// check for the suhosin module
|
57 |
if ( @extension_loaded( 'suhosin' ) && (@ini_get( 'suhosin.post.max_vars' ) > 0) && (@ini_get( 'suhosin.post.max_vars' ) < 500) ) {
|
58 |
+
echo "<em>" . __( "The Target Markets feature has been disabled because you have the Suhosin PHP extension installed on this server. If you need to use the Target Markets feature then disable the suhosin extension, if you can not do this, you will need to contact your hosting provider.", 'wpsc' ) . "</em>";
|
|
|
59 |
} else {
|
60 |
?>
|
61 |
<span>Select: <a href='<?php echo add_query_arg( array( 'selected_all' => 'all' ) ) ?>' class='wpsc_select_all'>All</a> <a href='<?php echo add_query_arg( array( 'selected_all' => 'none' ) ) ?>' class='wpsc_select_none'>None</a></span><br />
|
wpsc-admin/includes/settings-pages/import.php
CHANGED
@@ -36,16 +36,16 @@ function wpsc_options_import() {
|
|
36 |
$categories = get_terms( 'wpsc_product_category', 'hide_empty=0&parent=' . $category_id );
|
37 |
?>
|
38 |
|
39 |
-
<p
|
40 |
<div class='metabox-holder' style='width:90%'>
|
41 |
<input type='hidden' name='csv_action' value='import'>
|
42 |
|
43 |
<div style='width:100%;' class='postbox'>
|
44 |
-
<h3 class='hndle'
|
45 |
<div class='inside'>
|
46 |
<table>
|
47 |
<tr><td style='width:80%;'>
|
48 |
-
Select if you would like to import your products in as Drafts or Publish them right away.
|
49 |
<br />
|
50 |
</td><td>
|
51 |
<select name='post_status'>
|
@@ -90,7 +90,7 @@ function wpsc_options_import() {
|
|
90 |
</div>
|
91 |
</div>
|
92 |
<?php } ?>
|
93 |
-
<label for='category'
|
94 |
<select id='category' name='category'>
|
95 |
<?php
|
96 |
foreach ( $categories as $category ) {
|
@@ -163,7 +163,7 @@ function wpsc_options_import() {
|
|
163 |
$product_columns = wpsc_sanitise_product_forms( $product_columns );
|
164 |
wpsc_insert_product( $product_columns );
|
165 |
}
|
166 |
-
echo "<br /><br />Success, your <a href='?
|
167 |
}
|
168 |
?>
|
169 |
</div>
|
36 |
$categories = get_terms( 'wpsc_product_category', 'hide_empty=0&parent=' . $category_id );
|
37 |
?>
|
38 |
|
39 |
+
<p><?php _e( 'For each column, select the field it corresponds to in \'Belongs to\'. You can upload as many products as you like.', 'wpsc' ); ?></p>
|
40 |
<div class='metabox-holder' style='width:90%'>
|
41 |
<input type='hidden' name='csv_action' value='import'>
|
42 |
|
43 |
<div style='width:100%;' class='postbox'>
|
44 |
+
<h3 class='hndle'><?php _e('Product Status' , 'wpsc' ); ?></h3>
|
45 |
<div class='inside'>
|
46 |
<table>
|
47 |
<tr><td style='width:80%;'>
|
48 |
+
<?php _e( 'Select if you would like to import your products in as Drafts or Publish them right away.' , 'wpsc' ); ?>
|
49 |
<br />
|
50 |
</td><td>
|
51 |
<select name='post_status'>
|
90 |
</div>
|
91 |
</div>
|
92 |
<?php } ?>
|
93 |
+
<label for='category'><?php _e('Please select a category you would like to place all products from this CSV into' , 'wpsc' ); ?>:</label>
|
94 |
<select id='category' name='category'>
|
95 |
<?php
|
96 |
foreach ( $categories as $category ) {
|
163 |
$product_columns = wpsc_sanitise_product_forms( $product_columns );
|
164 |
wpsc_insert_product( $product_columns );
|
165 |
}
|
166 |
+
echo "<br /><br />Success, your <a href='".admin_url('edit.php?post_type=wpsc-product')."'>products</a> have been upload.";
|
167 |
}
|
168 |
?>
|
169 |
</div>
|
wpsc-admin/includes/settings-pages/marketing.php
CHANGED
@@ -100,7 +100,7 @@ function wpsc_google_merch_center_meta_box() { ?>
|
|
100 |
|
101 |
<?php $google_feed_url = get_bloginfo( 'url' ) . "/index.php?rss=true&action=product_list&xmlformat=google"; ?>
|
102 |
|
103 |
-
<a href="<?php echo htmlentities( $google_feed_url ); ?>"><?php echo htmlentities( $google_feed_url ); ?></a>
|
104 |
|
105 |
<?php
|
106 |
}
|
100 |
|
101 |
<?php $google_feed_url = get_bloginfo( 'url' ) . "/index.php?rss=true&action=product_list&xmlformat=google"; ?>
|
102 |
|
103 |
+
<a href="<?php echo htmlentities( $google_feed_url, ENT_QUOTES, 'UTF-8' ); ?>"><?php echo htmlentities( $google_feed_url, ENT_QUOTES, 'UTF-8' ); ?></a>
|
104 |
|
105 |
<?php
|
106 |
}
|
wpsc-admin/includes/settings-pages/presentation.php
CHANGED
@@ -62,10 +62,15 @@ function wpsc_theme_presentation_page_metabox(){
|
|
62 |
if ( isset( $_SESSION['wpsc_themes_copied'] ) && ($_SESSION['wpsc_themes_copied'] == true) ) {
|
63 |
?>
|
64 |
<div class="updated fade below-h2" id="message" style="background-color: rgb(255, 251, 204);">
|
65 |
-
|
|
|
|
|
|
|
|
|
66 |
</div>
|
67 |
<?php
|
68 |
-
$_SESSION['wpsc_themes_copied']
|
|
|
69 |
}
|
70 |
if ( isset( $_SESSION['wpsc_themes_backup'] ) && ($_SESSION['wpsc_themes_backup'] == true) ) {
|
71 |
?>
|
@@ -822,7 +827,7 @@ function wpsc_options_presentation() {
|
|
822 |
}
|
823 |
?>
|
824 |
<input type='radio' onclick='hideelement1("dropshop_option", this.value)' value='3' name='wpsc_options[cart_location]' id='cart3' <?php if ( isset( $cart3 ) )
|
825 |
-
echo $cart3; ?> /> <label for='cart3'><?php _e( 'Manual', 'wpsc' ); ?> <span style='font-size: 7pt;'>(PHP code: <?php echo
|
826 |
<div style='display: <?php if ( !empty( $cart5 ) ) {
|
827 |
echo "block";
|
828 |
} else {
|
@@ -877,11 +882,11 @@ function wpsc_options_presentation() {
|
|
877 |
</tr>
|
878 |
</table>
|
879 |
|
880 |
-
<h3 class="form_group"><?php _e( 'Product
|
881 |
<table class='wpsc_options form-table'>
|
882 |
|
883 |
<tr>
|
884 |
-
<th scope="row"><?php _e( 'Show Product
|
885 |
<td>
|
886 |
<?php
|
887 |
$wpsc_category_description = get_option( 'wpsc_category_description' );
|
@@ -905,7 +910,7 @@ function wpsc_options_presentation() {
|
|
905 |
|
906 |
<tr>
|
907 |
<th scope="row">
|
908 |
-
<?php _e( 'Show Product
|
909 |
</th>
|
910 |
<td>
|
911 |
<?php
|
@@ -931,7 +936,7 @@ function wpsc_options_presentation() {
|
|
931 |
|
932 |
<tr>
|
933 |
<th scope="row">
|
934 |
-
<?php _e( 'Show Product Count per Product
|
935 |
</th>
|
936 |
<td>
|
937 |
<?php
|
62 |
if ( isset( $_SESSION['wpsc_themes_copied'] ) && ($_SESSION['wpsc_themes_copied'] == true) ) {
|
63 |
?>
|
64 |
<div class="updated fade below-h2" id="message" style="background-color: rgb(255, 251, 204);">
|
65 |
+
<?php if(in_array(false, $_SESSION['wpsc_themes_copied_results'], true)): ?>
|
66 |
+
<p style="color:red;"><?php _e( "Error: some files could not be copied. Please make sure that theme folder is writable.", 'wpsc' ); ?></p>
|
67 |
+
<?php else: ?>
|
68 |
+
<p><?php _e( "Thanks, the themes have been copied.", 'wpsc' ); ?></p>
|
69 |
+
<?php endif; ?>
|
70 |
</div>
|
71 |
<?php
|
72 |
+
unset($_SESSION['wpsc_themes_copied']);
|
73 |
+
unset($_SESSION['wpsc_themes_copied_results']);
|
74 |
}
|
75 |
if ( isset( $_SESSION['wpsc_themes_backup'] ) && ($_SESSION['wpsc_themes_backup'] == true) ) {
|
76 |
?>
|
827 |
}
|
828 |
?>
|
829 |
<input type='radio' onclick='hideelement1("dropshop_option", this.value)' value='3' name='wpsc_options[cart_location]' id='cart3' <?php if ( isset( $cart3 ) )
|
830 |
+
echo $cart3; ?> /> <label for='cart3'><?php _e( 'Manual', 'wpsc' ); ?> <span style='font-size: 7pt;'>(PHP code: <?php echo wpsc_shopping_cart(); ?> )</span></label>
|
831 |
<div style='display: <?php if ( !empty( $cart5 ) ) {
|
832 |
echo "block";
|
833 |
} else {
|
882 |
</tr>
|
883 |
</table>
|
884 |
|
885 |
+
<h3 class="form_group"><?php _e( 'Product Category Settings', 'wpsc' ); ?></h3>
|
886 |
<table class='wpsc_options form-table'>
|
887 |
|
888 |
<tr>
|
889 |
+
<th scope="row"><?php _e( 'Show Product Category Description', 'wpsc' ); ?>:</th>
|
890 |
<td>
|
891 |
<?php
|
892 |
$wpsc_category_description = get_option( 'wpsc_category_description' );
|
910 |
|
911 |
<tr>
|
912 |
<th scope="row">
|
913 |
+
<?php _e( 'Show Product Category Thumbnails', 'wpsc' ); ?>:
|
914 |
</th>
|
915 |
<td>
|
916 |
<?php
|
936 |
|
937 |
<tr>
|
938 |
<th scope="row">
|
939 |
+
<?php _e( 'Show Product Count per Product Category', 'wpsc' ); ?>:
|
940 |
</th>
|
941 |
<td>
|
942 |
<?php
|
wpsc-admin/includes/settings-pages/taxes.php
CHANGED
@@ -142,12 +142,12 @@ function wpec_options_taxes() {
|
|
142 |
?>
|
143 |
<!--End Taxes Output-->
|
144 |
<p>
|
145 |
-
<a id="add_taxes_rate" href="#"><?php _e( 'Add New Tax Rate' ); ?></a>
|
146 |
</p>
|
147 |
</div>
|
148 |
</div>
|
149 |
<div id='wpec-taxes-bands-container' class='postbox'>
|
150 |
-
<h3 class='hndle' style='cursor: default'><?php _e( 'Tax Bands' ); ?></h3>
|
151 |
<div id='wpec-taxes-bands' class='inside'>
|
152 |
|
153 |
<?php
|
@@ -161,14 +161,14 @@ function wpec_options_taxes() {
|
|
161 |
$tax_bands = $wpec_taxes_controller->wpec_taxes->wpec_taxes_get_bands();
|
162 |
$tax_band_count = 0;
|
163 |
if ( !empty( $tax_bands ) ) {
|
164 |
-
foreach ( $tax_bands as $tax_band ) {
|
165 |
echo $wpec_taxes_controller->wpec_taxes_build_form( $tax_band_count, $tax_band, 'bands' );
|
166 |
$tax_band_count++;
|
167 |
}// foreach
|
168 |
}// if
|
169 |
?>
|
170 |
<p>
|
171 |
-
<a id="add_taxes_band" href="#"><?php _e( 'Add New Tax Band' ); ?></a>
|
172 |
</p>
|
173 |
</div>
|
174 |
</div><!--wpec-taxes-bands-container-->
|
142 |
?>
|
143 |
<!--End Taxes Output-->
|
144 |
<p>
|
145 |
+
<a id="add_taxes_rate" href="#"><?php _e( 'Add New Tax Rate', 'wpsc' ); ?></a>
|
146 |
</p>
|
147 |
</div>
|
148 |
</div>
|
149 |
<div id='wpec-taxes-bands-container' class='postbox'>
|
150 |
+
<h3 class='hndle' style='cursor: default'><?php _e( 'Tax Bands', 'wpsc' ); ?></h3>
|
151 |
<div id='wpec-taxes-bands' class='inside'>
|
152 |
|
153 |
<?php
|
161 |
$tax_bands = $wpec_taxes_controller->wpec_taxes->wpec_taxes_get_bands();
|
162 |
$tax_band_count = 0;
|
163 |
if ( !empty( $tax_bands ) ) {
|
164 |
+
foreach ( $tax_bands as $tax_band ) {
|
165 |
echo $wpec_taxes_controller->wpec_taxes_build_form( $tax_band_count, $tax_band, 'bands' );
|
166 |
$tax_band_count++;
|
167 |
}// foreach
|
168 |
}// if
|
169 |
?>
|
170 |
<p>
|
171 |
+
<a id="add_taxes_band" href="#"><?php _e( 'Add New Tax Band', 'wpsc' ); ?></a>
|
172 |
</p>
|
173 |
</div>
|
174 |
</div><!--wpec-taxes-bands-container-->
|
wpsc-admin/includes/updating-functions.php
CHANGED
@@ -228,7 +228,7 @@ GROUP BY ".WPSC_TABLE_PRODUCT_LIST.".id", ARRAY_A);
|
|
228 |
$post_data['_wpsc_product_metadata']['is_stock_limited'] = (int)(bool)$product['quantity_limited'];
|
229 |
|
230 |
// Product Weight
|
231 |
-
$post_data['_wpsc_product_metadata']['weight'] = wpsc_convert_weight($product['weight'], $product['weight_unit'], "
|
232 |
$post_data['_wpsc_product_metadata']['weight_unit'] = $product['weight_unit'];
|
233 |
$post_data['_wpsc_product_metadata']['display_weight_as'] = $product['weight_unit'];
|
234 |
|
@@ -459,7 +459,7 @@ function wpsc_convert_variation_combinations() {
|
|
459 |
$post_data['_wpsc_original_variation_id'] = (float)$variation_item->id;
|
460 |
|
461 |
// Product Weight
|
462 |
-
$post_data['_wpsc_product_metadata']['weight'] = wpsc_convert_weight($variation_item->weight, $variation_item->weight_unit, "
|
463 |
$post_data['_wpsc_product_metadata']['display_weight_as'] = $variation_item->weight_unit;
|
464 |
$post_data['_wpsc_product_metadata']['weight_unit'] = $variation_item->weight_unit;
|
465 |
|
228 |
$post_data['_wpsc_product_metadata']['is_stock_limited'] = (int)(bool)$product['quantity_limited'];
|
229 |
|
230 |
// Product Weight
|
231 |
+
$post_data['_wpsc_product_metadata']['weight'] = wpsc_convert_weight($product['weight'], $product['weight_unit'], "pound");
|
232 |
$post_data['_wpsc_product_metadata']['weight_unit'] = $product['weight_unit'];
|
233 |
$post_data['_wpsc_product_metadata']['display_weight_as'] = $product['weight_unit'];
|
234 |
|
459 |
$post_data['_wpsc_original_variation_id'] = (float)$variation_item->id;
|
460 |
|
461 |
// Product Weight
|
462 |
+
$post_data['_wpsc_product_metadata']['weight'] = wpsc_convert_weight($variation_item->weight, $variation_item->weight_unit, "pound");
|
463 |
$post_data['_wpsc_product_metadata']['display_weight_as'] = $variation_item->weight_unit;
|
464 |
$post_data['_wpsc_product_metadata']['weight_unit'] = $variation_item->weight_unit;
|
465 |
|
wpsc-admin/js/admin.js
CHANGED
@@ -15,9 +15,9 @@ jQuery(document).ready(function(){
|
|
15 |
additional_description = jQuery('textarea#additional_description').text();
|
16 |
name = jQuery('input#title').val();
|
17 |
product_id = jQuery('input#product_id').val();
|
18 |
-
post_values = edit_var_val+'&description='+description+'&additional_description='+additional_description+'&name='+name+'&product_id='+product_id;
|
19 |
jQuery('div#wpsc_product_variation_forms table.widefat tbody').fadeTo(200, 0, function(){
|
20 |
-
jQuery.post('
|
21 |
jQuery('div#wpsc_product_variation_forms table.widefat tbody').html(returned_data).fadeTo(200, 1);
|
22 |
jQuery('img.loading').hide();
|
23 |
});
|
@@ -119,20 +119,7 @@ jQuery(document).ready(function(){
|
|
119 |
|
120 |
});
|
121 |
//checkboxes on checkout page
|
122 |
-
/*
|
123 |
-
jQuery('.wpsc_checkout_selectboxes').livequery(function(){
|
124 |
-
jQuery(this).change(function(){
|
125 |
-
if(jQuery(this).val() == 'checkbox' || jQuery(this).val() == 'radio' ||
|
126 |
-
jQuery(this).val() == 'select'){
|
127 |
-
id = jQuery(this).attr('name');
|
128 |
-
id = id.replace('form_type', '');
|
129 |
-
output = "<tr class='wpsc_grey'><td></td><td colspan='5'>Please save your changes to add options to this "+jQuery(this).val()+" form field.</td></tr>\r\n";
|
130 |
-
jQuery(this).parent().parent('tr').after(output);
|
131 |
-
}
|
132 |
|
133 |
-
});
|
134 |
-
});
|
135 |
-
*/
|
136 |
jQuery('.wpsc_add_new_checkout_option').livequery(function(){
|
137 |
jQuery(this).click(function(event){
|
138 |
form_id = jQuery(this).attr('title');
|
@@ -157,7 +144,7 @@ jQuery(document).ready(function(){
|
|
157 |
if(returned_data != ''){
|
158 |
jQuery('#checkout_'+id).after(returned_data);
|
159 |
}else{
|
160 |
-
output = "<tr class='wpsc_grey'><td></td><td colspan='5'>Please Save your changes before trying to Order your Checkout Forms again.</td></tr>\r\n<tr class='wpsc_grey'><td></td><th>Label</th><th >Value</th><td colspan='3'><a href='' class='wpsc_add_new_checkout_option' title='form_options["+id+"]'>+ New
|
161 |
output += "<tr class='wpsc_grey'><td></td><td><input type='text' value='' name='wpsc_checkout_option_label["+id+"][]' /></td><td colspan='4'><input type='text' value='' name='wpsc_checkout_option_value["+id+"][]' /><a class='wpsc_delete_option' href='' ><img src='" + WPSC_CORE_IMAGES_URL + "trash.gif' alt='Delete' title='delete' /></a></td></tr>";
|
162 |
jQuery('#checkout_'+id).after(output);
|
163 |
|
@@ -301,7 +288,7 @@ jQuery(document).ready(function(){
|
|
301 |
});
|
302 |
return false;
|
303 |
}
|
304 |
-
|
305 |
jQuery('form#addtag, form#edittag').attr('enctype', 'multipart/form-data');
|
306 |
|
307 |
}
|
@@ -314,7 +301,7 @@ jQuery(document).ready(function(){
|
|
314 |
jQuery(this).parents('tr:first').find('td input.wpsc_ie_field, td .wpsc_inline_actions').show();
|
315 |
return false;
|
316 |
});
|
317 |
-
|
318 |
jQuery('#wpsc_product_list .wpsc_ie_cancel').live('click', function(){
|
319 |
jQuery(this).parents('tr:first').find('a.row-title, td > span').show();
|
320 |
jQuery(this).parents('tr:first').find('td input.wpsc_ie_field, td .wpsc_inline_actions').hide();
|
@@ -340,7 +327,7 @@ jQuery(document).ready(function(){
|
|
340 |
special_price: special_price,
|
341 |
sku: sku
|
342 |
};
|
343 |
-
|
344 |
jQuery.post(ajaxurl, data, function(response) {
|
345 |
response = eval(response);
|
346 |
if(response.error){
|
@@ -354,10 +341,10 @@ jQuery(document).ready(function(){
|
|
354 |
jQuery('#post-' + response.id + ' .column-weight span').text(response.weight);
|
355 |
jQuery('#post-' + response.id + ' .column-stock span').text(response.stock);
|
356 |
jQuery('#post-' + response.id + ' .column-SKU span').text(response.sku);
|
357 |
-
|
358 |
jQuery('#post-' + response.id + ' .column-price .pricedisplay').html(jQuery(response.price).text());
|
359 |
jQuery('#post-' + response.id + ' .column-sale_price .pricedisplay').html(jQuery(response.special_price).text());
|
360 |
-
|
361 |
jQuery('#post-' + response.id + ' a.row-title, #post-' + response.id + ' td > span').show();
|
362 |
jQuery('#post-' + response.id + ' td input.wpsc_ie_field, #post-' + response.id + ' td .wpsc_inline_actions').hide();
|
363 |
jQuery('#post-' + response.id + ' .loading_indicator').css('visibility', 'hidden');
|
@@ -374,12 +361,12 @@ jQuery(document).ready(function(){
|
|
374 |
jQuery('fieldset.inline-edit-col-left.wpsc-cols').css({'float': 'right', 'clear' : 'right'});
|
375 |
jQuery("label:contains('Parent')").css('display', 'none');
|
376 |
jQuery("label:contains('Status')").css('display', 'none');
|
377 |
-
jQuery("span:contains('Variations')").css('display', 'none');
|
378 |
jQuery("ul.wpsc-variation-checklist").css('display', 'none');
|
379 |
jQuery("div.inline-edit-date").css('display', 'none');
|
380 |
}
|
381 |
if( wpsc_adminL10n.dragndrop_set == "true" && typenow == "wpsc-product" && adminpage == "edit-php" ) {
|
382 |
-
// this makes the product list table sortable
|
383 |
jQuery('table.widefat:not(.tags)').sortable({
|
384 |
update: function(event, ui) {
|
385 |
category_id = jQuery('select#wpsc_product_category option:selected').val();
|
@@ -426,7 +413,7 @@ jQuery(document).ready(function(){
|
|
426 |
jQuery(".wpsc-row-actions", this).css("visibility", "hidden");
|
427 |
}
|
428 |
);
|
429 |
-
|
430 |
|
431 |
jQuery('tr.wpsc_trackingid_row').hide();
|
432 |
|
@@ -478,6 +465,10 @@ jQuery(document).ready(function(){
|
|
478 |
}
|
479 |
);
|
480 |
});
|
|
|
|
|
|
|
|
|
481 |
|
482 |
jQuery('a.add_variation_item_form').livequery(function(){
|
483 |
jQuery(this).click(function() {
|
@@ -780,18 +771,40 @@ jQuery(document).ready(function(){
|
|
780 |
return false;
|
781 |
});
|
782 |
});
|
783 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
784 |
// Form change tracking code.
|
785 |
jQuery('form.wpsc_form_track :input, form.wpsc_form_track :radio, form.wpsc_form_track :checkbox')
|
786 |
.live('change', function() {
|
787 |
jQuery(this).parents('form.wpsc_form_track:first').addClass('wpsc_form_changed');
|
788 |
});
|
789 |
-
|
790 |
jQuery('form.wpsc_form_track').live('submit', function() {
|
791 |
jQuery(this).removeClass('wpsc_form_changed');
|
792 |
-
|
793 |
});
|
794 |
-
|
795 |
// We'd ideally want to be using window.onbeforeonload to toss in a prompt, but that event is too
|
796 |
// unreliable from a browser to the next. Hooking onto anchors is the next best thing.
|
797 |
jQuery('form.wpsc_form_track a').live('click', function() {
|
@@ -805,8 +818,6 @@ jQuery(document).ready(function(){
|
|
805 |
});
|
806 |
});
|
807 |
|
808 |
-
|
809 |
-
|
810 |
// function for adding more custom meta
|
811 |
function add_more_meta(e) {
|
812 |
current_meta_forms = jQuery(e).parent().children("div.product_custom_meta:last"); // grab the form container
|
@@ -1065,3 +1076,18 @@ function show_status_box(id,image_id) {
|
|
1065 |
return false;
|
1066 |
}
|
1067 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
additional_description = jQuery('textarea#additional_description').text();
|
16 |
name = jQuery('input#title').val();
|
17 |
product_id = jQuery('input#product_id').val();
|
18 |
+
post_values = edit_var_val + '&description=' + description + '&additional_description=' + additional_description + '&name=' + name + '&product_id=' + product_id;
|
19 |
jQuery('div#wpsc_product_variation_forms table.widefat tbody').fadeTo(200, 0, function(){
|
20 |
+
jQuery.post(ajaxurl + '?action=wpsc_update_variations',post_values, function(returned_data){
|
21 |
jQuery('div#wpsc_product_variation_forms table.widefat tbody').html(returned_data).fadeTo(200, 1);
|
22 |
jQuery('img.loading').hide();
|
23 |
});
|
119 |
|
120 |
});
|
121 |
//checkboxes on checkout page
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
|
|
|
|
|
|
|
123 |
jQuery('.wpsc_add_new_checkout_option').livequery(function(){
|
124 |
jQuery(this).click(function(event){
|
125 |
form_id = jQuery(this).attr('title');
|
144 |
if(returned_data != ''){
|
145 |
jQuery('#checkout_'+id).after(returned_data);
|
146 |
}else{
|
147 |
+
output = "<tr class='wpsc_grey'><td></td><td colspan='5'>Please Save your changes before trying to Order your Checkout Forms again.</td></tr>\r\n<tr class='wpsc_grey'><td></td><th>Label</th><th >Value</th><td colspan='3'><a href='' class='wpsc_add_new_checkout_option' title='form_options["+id+"]'>+ New Option</a></td></tr>";
|
148 |
output += "<tr class='wpsc_grey'><td></td><td><input type='text' value='' name='wpsc_checkout_option_label["+id+"][]' /></td><td colspan='4'><input type='text' value='' name='wpsc_checkout_option_value["+id+"][]' /><a class='wpsc_delete_option' href='' ><img src='" + WPSC_CORE_IMAGES_URL + "trash.gif' alt='Delete' title='delete' /></a></td></tr>";
|
149 |
jQuery('#checkout_'+id).after(output);
|
150 |
|
288 |
});
|
289 |
return false;
|
290 |
}
|
291 |
+
|
292 |
jQuery('form#addtag, form#edittag').attr('enctype', 'multipart/form-data');
|
293 |
|
294 |
}
|
301 |
jQuery(this).parents('tr:first').find('td input.wpsc_ie_field, td .wpsc_inline_actions').show();
|
302 |
return false;
|
303 |
});
|
304 |
+
|
305 |
jQuery('#wpsc_product_list .wpsc_ie_cancel').live('click', function(){
|
306 |
jQuery(this).parents('tr:first').find('a.row-title, td > span').show();
|
307 |
jQuery(this).parents('tr:first').find('td input.wpsc_ie_field, td .wpsc_inline_actions').hide();
|
327 |
special_price: special_price,
|
328 |
sku: sku
|
329 |
};
|
330 |
+
|
331 |
jQuery.post(ajaxurl, data, function(response) {
|
332 |
response = eval(response);
|
333 |
if(response.error){
|
341 |
jQuery('#post-' + response.id + ' .column-weight span').text(response.weight);
|
342 |
jQuery('#post-' + response.id + ' .column-stock span').text(response.stock);
|
343 |
jQuery('#post-' + response.id + ' .column-SKU span').text(response.sku);
|
344 |
+
|
345 |
jQuery('#post-' + response.id + ' .column-price .pricedisplay').html(jQuery(response.price).text());
|
346 |
jQuery('#post-' + response.id + ' .column-sale_price .pricedisplay').html(jQuery(response.special_price).text());
|
347 |
+
|
348 |
jQuery('#post-' + response.id + ' a.row-title, #post-' + response.id + ' td > span').show();
|
349 |
jQuery('#post-' + response.id + ' td input.wpsc_ie_field, #post-' + response.id + ' td .wpsc_inline_actions').hide();
|
350 |
jQuery('#post-' + response.id + ' .loading_indicator').css('visibility', 'hidden');
|
361 |
jQuery('fieldset.inline-edit-col-left.wpsc-cols').css({'float': 'right', 'clear' : 'right'});
|
362 |
jQuery("label:contains('Parent')").css('display', 'none');
|
363 |
jQuery("label:contains('Status')").css('display', 'none');
|
364 |
+
jQuery("span:contains('Variations')").css('display', 'none');
|
365 |
jQuery("ul.wpsc-variation-checklist").css('display', 'none');
|
366 |
jQuery("div.inline-edit-date").css('display', 'none');
|
367 |
}
|
368 |
if( wpsc_adminL10n.dragndrop_set == "true" && typenow == "wpsc-product" && adminpage == "edit-php" ) {
|
369 |
+
// this makes the product list table sortable
|
370 |
jQuery('table.widefat:not(.tags)').sortable({
|
371 |
update: function(event, ui) {
|
372 |
category_id = jQuery('select#wpsc_product_category option:selected').val();
|
413 |
jQuery(".wpsc-row-actions", this).css("visibility", "hidden");
|
414 |
}
|
415 |
);
|
416 |
+
|
417 |
|
418 |
jQuery('tr.wpsc_trackingid_row').hide();
|
419 |
|
465 |
}
|
466 |
);
|
467 |
});
|
468 |
+
jQuery('.editinline').live('click', function(){
|
469 |
+
setTimeout('editinline_get_id()',200);
|
470 |
+
|
471 |
+
});
|
472 |
|
473 |
jQuery('a.add_variation_item_form').livequery(function(){
|
474 |
jQuery(this).click(function() {
|
771 |
return false;
|
772 |
});
|
773 |
});
|
774 |
+
|
775 |
+
// Fill in values when inline editor appears.
|
776 |
+
jQuery('.inline-editor').livequery(function() {
|
777 |
+
var id = jQuery(this).attr('id');
|
778 |
+
id = id.replace(/^edit-/, '');
|
779 |
+
|
780 |
+
if (!id || !parseInt(id)) {
|
781 |
+
return;
|
782 |
+
}
|
783 |
+
|
784 |
+
var weight = jQuery('#inline_' + id + '_weight').text(),
|
785 |
+
stock = jQuery('#inline_' + id + '_stock').text(),
|
786 |
+
price = jQuery('#inline_' + id + '_price').text(),
|
787 |
+
sale_price = jQuery('#inline_' + id + '_sale_price').text(),
|
788 |
+
sku = jQuery('#inline_' + id + '_sku').text();
|
789 |
+
|
790 |
+
jQuery(this).find('.wpsc_ie_weight').val(weight);
|
791 |
+
jQuery(this).find('.wpsc_ie_stock').val(stock);
|
792 |
+
jQuery(this).find('.wpsc_ie_price').val(price);
|
793 |
+
jQuery(this).find('.wpsc_ie_sale_price').val(sale_price);
|
794 |
+
jQuery(this).find('.wpsc_ie_sku').val(sku);
|
795 |
+
});
|
796 |
+
|
797 |
// Form change tracking code.
|
798 |
jQuery('form.wpsc_form_track :input, form.wpsc_form_track :radio, form.wpsc_form_track :checkbox')
|
799 |
.live('change', function() {
|
800 |
jQuery(this).parents('form.wpsc_form_track:first').addClass('wpsc_form_changed');
|
801 |
});
|
802 |
+
|
803 |
jQuery('form.wpsc_form_track').live('submit', function() {
|
804 |
jQuery(this).removeClass('wpsc_form_changed');
|
805 |
+
|
806 |
});
|
807 |
+
|
808 |
// We'd ideally want to be using window.onbeforeonload to toss in a prompt, but that event is too
|
809 |
// unreliable from a browser to the next. Hooking onto anchors is the next best thing.
|
810 |
jQuery('form.wpsc_form_track a').live('click', function() {
|
818 |
});
|
819 |
});
|
820 |
|
|
|
|
|
821 |
// function for adding more custom meta
|
822 |
function add_more_meta(e) {
|
823 |
current_meta_forms = jQuery(e).parent().children("div.product_custom_meta:last"); // grab the form container
|
1076 |
return false;
|
1077 |
}
|
1078 |
|
1079 |
+
function editinline_get_id(){
|
1080 |
+
id = jQuery('.inline-edit-row').attr('id');
|
1081 |
+
id = id.replace('edit-','');
|
1082 |
+
has_var = jQuery('#inline_'+id+'_has_var').val();
|
1083 |
+
if( has_var == '1'){
|
1084 |
+
jQuery(".wpsc-cols").css('display', 'none');
|
1085 |
+
jQuery(".wpsc-cols:first").text('Quick Edit options are limited when editing products that have variations. You will need to edit the variations themselves.')
|
1086 |
+
.addClass('wpsc_var_description')
|
1087 |
+
.css('display','block');
|
1088 |
+
}else{
|
1089 |
+
jQuery(".wpsc-cols").css('display', 'block');
|
1090 |
+
}
|
1091 |
+
|
1092 |
+
|
1093 |
+
}
|
wpsc-core/js/tinymce3/window.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
require_once( dirname( dirname( dirname(__FILE__) ) ) . '/wpsc-config.php');
|
4 |
$categorylist = get_terms('wpsc_product_category',array('hide_empty'=> 0));
|
5 |
-
$allProducts = get_posts('post_type=wpsc-product');
|
6 |
|
7 |
//Check capabilities
|
8 |
if ( !current_user_can('edit_pages') && !current_user_can('edit_posts') )
|
2 |
|
3 |
require_once( dirname( dirname( dirname(__FILE__) ) ) . '/wpsc-config.php');
|
4 |
$categorylist = get_terms('wpsc_product_category',array('hide_empty'=> 0));
|
5 |
+
$allProducts = get_posts('post_type=wpsc-product&nopaging=true');
|
6 |
|
7 |
//Check capabilities
|
8 |
if ( !current_user_can('edit_pages') && !current_user_can('edit_posts') )
|
wpsc-core/js/wp-e-commerce.js
CHANGED
@@ -62,6 +62,81 @@
|
|
62 |
}
|
63 |
}
|
64 |
//End Share this JS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
// this function is for binding actions to events and rebinding them after they are replaced by AJAX
|
67 |
// these functions are bound to events on elements when the page is fully loaded.
|
@@ -71,66 +146,20 @@ jQuery(document).ready(function () {
|
|
71 |
jQuery('#checkout_page_container .wpsc_email_address input').keyup(function(){
|
72 |
jQuery('#wpsc_checkout_gravatar').attr('src', 'https://secure.gravatar.com/avatar/'+MD5(jQuery(this).val().split(' ').join(''))+'?s=60&d=mm');
|
73 |
});
|
74 |
-
|
75 |
//this bit of code runs on the checkout page. If the checkbox is selected it copies the valus in the billing country and puts it in the shipping country form fields. 23.07.09
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
jQuery(
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
var phone = jQuery("input[title='billingphone']").val();
|
89 |
-
var email = jQuery("input[title='billingfirstname']").val();
|
90 |
-
var state = jQuery("select[title='billingregion'] :selected").text();
|
91 |
-
if( jQuery("select[title='billingstate']").val() ){
|
92 |
-
var state = jQuery("select[title='billingstate'] :selected").text();
|
93 |
-
}
|
94 |
-
if( jQuery("input[title='billingstate']").val()){
|
95 |
-
var state = jQuery("input[title='billingstate']").val();
|
96 |
-
}
|
97 |
-
var country = jQuery("select[title='billingcountry'] :selected").text();
|
98 |
-
var countryID = jQuery("select[title='billingcountry'] :selected").val();
|
99 |
-
|
100 |
-
jQuery("input[title='shippingfirstname']").val(fname).removeClass('intra-field-label');
|
101 |
-
jQuery("input[title='shippinglastname']").val(lname).removeClass('intra-field-label');
|
102 |
-
jQuery("textarea[title='shippingaddress']").val(addr).removeClass('intra-field-label');
|
103 |
-
jQuery("input[title='shippingcity']").val(city).removeClass('intra-field-label');
|
104 |
-
jQuery("input[title='shippingpostcode']").val(pcode).removeClass('intra-field-label');
|
105 |
-
jQuery("input[title='shippingphone']").val(phone).removeClass('intra-field-label');
|
106 |
-
jQuery("input[title='shippingemail']").val(email).removeClass('intra-field-label');
|
107 |
-
jQuery("input[title='shippingstate']").val(state).removeClass('intra-field-label');
|
108 |
-
jQuery("input.shipping_country").val(countryID).removeClass('intra-field-label');
|
109 |
-
jQuery("span.shipping_country_name").html(country).removeClass('intra-field-label');
|
110 |
-
jQuery("select#current_country").val(countryID).removeClass('intra-field-label');
|
111 |
-
|
112 |
-
jQuery("input[title='shippingcountry']").val(countryID).removeClass('intra-field-label');
|
113 |
-
var html_form_id = jQuery("input[title='shippingcountry']").attr('id');
|
114 |
-
var form_id = jQuery("input[title='shippingcountry']").attr('name');
|
115 |
-
form_id = form_id.replace("collected_data[", "");
|
116 |
-
form_id = form_id.replace("]", "");
|
117 |
-
form_id = form_id.replace("[0]", "");
|
118 |
-
set_shipping_country(html_form_id, form_id)
|
119 |
-
if(jQuery("select[title='billingcountry'] :selected").val() != jQuery("select[name='country'] :selected").val()){
|
120 |
-
id = jQuery("select[name='country'] :selected").val();
|
121 |
-
if(id == 'undefined'){
|
122 |
-
jQuery("select[name='country']").val(countryID);
|
123 |
-
submit_change_country();
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
} else {
|
128 |
-
|
129 |
-
}
|
130 |
-
|
131 |
-
//otherwise, hide it
|
132 |
-
//jQuery("#extra").hide("fast");
|
133 |
-
});
|
134 |
});
|
135 |
|
136 |
// Submit the product form using AJAX
|
@@ -387,8 +416,11 @@ function set_shipping_country(html_form_id, form_id){
|
|
387 |
|
388 |
jQuery.post( 'index.php', form_values, function(returned_data) {
|
389 |
eval(returned_data);
|
|
|
|
|
|
|
390 |
});
|
391 |
-
|
392 |
}
|
393 |
|
394 |
jQuery(document).ready(function(){
|
62 |
}
|
63 |
}
|
64 |
//End Share this JS
|
65 |
+
|
66 |
+
function wpsc_shipping_same_as_billing(){
|
67 |
+
jQuery('#shippingsameasbillingmessage').slideDown('slow');
|
68 |
+
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).keyup(wpsc_shipping_same_as_billing).change(wpsc_shipping_same_as_billing);
|
69 |
+
|
70 |
+
jQuery("select[title='billingregion'], select[title='billingstate'], select[title='billingcountry'], input[title='billingstate']").die( 'change', wpsc_shipping_same_as_billing ).live( 'change', wpsc_shipping_same_as_billing );
|
71 |
+
|
72 |
+
var fields = new Array(
|
73 |
+
Array(
|
74 |
+
"input[title='billingfirstname']",
|
75 |
+
"input[title='shippingfirstname']"
|
76 |
+
),
|
77 |
+
Array(
|
78 |
+
"input[title='billinglastname']",
|
79 |
+
"input[title='shippinglastname']"
|
80 |
+
),
|
81 |
+
Array(
|
82 |
+
"textarea[title='billingaddress']",
|
83 |
+
"textarea[title='shippingaddress']"
|
84 |
+
),
|
85 |
+
Array(
|
86 |
+
"input[title='billingcity']",
|
87 |
+
"input[title='shippingcity']"
|
88 |
+
),
|
89 |
+
Array(
|
90 |
+
"input[title='billingpostcode']",
|
91 |
+
"input[title='shippingpostcode']"
|
92 |
+
),
|
93 |
+
Array(
|
94 |
+
"input[title='billingphone']",
|
95 |
+
"input[title='shippingphone']"
|
96 |
+
),
|
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) {
|
108 |
+
jQuery(fields[i][1]).val(jQuery(fields[i][0]).val()).parents('tr:first').hide();;
|
109 |
+
if(!jQuery(fields[i][0]).hasClass('intra-field-label'))
|
110 |
+
jQuery(fields[i][1]).removeClass('intra-field-label');
|
111 |
+
else
|
112 |
+
jQuery(fields[i][1]).addClass('intra-field-label');
|
113 |
+
}
|
114 |
+
|
115 |
+
//state
|
116 |
+
|
117 |
+
jQuery("input.shipping_country").val(
|
118 |
+
jQuery("select[title='billingcountry'] :selected").text()
|
119 |
+
).removeClass('intra-field-label').parents('tr:first').hide();
|
120 |
+
|
121 |
+
jQuery("span.shipping_country_name").html(
|
122 |
+
jQuery("select[title='billingcountry'] :selected").text()
|
123 |
+
).hide();
|
124 |
+
|
125 |
+
jQuery('select[title="shippingcountry"] option').removeAttr('selected').parents('tr:first').hide();
|
126 |
+
jQuery('select[title="shippingcountry"] option[value="' + jQuery('select[title="billingcountry"] option:selected').val() + '"]').attr('selected', 'selected');
|
127 |
+
|
128 |
+
jQuery('select[title="shippingstate"] option').removeAttr('selected').parents('tr:first').hide();
|
129 |
+
jQuery('select[title="shippingstate"] option[value="' + jQuery('select[title="billingstate"] option:selected').val() + '"]').attr('selected', 'selected');
|
130 |
+
|
131 |
+
jQuery('select[title="shippingcountry"]').change();
|
132 |
+
jQuery('select[title="shippingstate"]').change();
|
133 |
+
|
134 |
+
if( jQuery('#change_country #current_country').val() && ( (jQuery('select[title="billingcountry"]').val() && jQuery('#change_country #current_country').val() != jQuery('select[title="billingcountry"]').val() ) || (jQuery('select[title="billingstate"]').val() && jQuery('select[title="billingstate"]').val() != jQuery('#change_country #region').val()) ) ){
|
135 |
+
jQuery('#change_country select').remove();
|
136 |
+
jQuery('#change_country').append('<input type="hidden" name="country" value="'+jQuery('select[title="billingcountry"]').val()+'" /><input type="hidden" name="region" value="'+jQuery('select[title="billingstate"]').val()+'" /><input type="hidden" name="shippingSameBilling" value="true" />').submit();
|
137 |
+
}
|
138 |
+
|
139 |
+
}
|
140 |
|
141 |
// this function is for binding actions to events and rebinding them after they are replaced by AJAX
|
142 |
// these functions are bound to events on elements when the page is fully loaded.
|
146 |
jQuery('#checkout_page_container .wpsc_email_address input').keyup(function(){
|
147 |
jQuery('#wpsc_checkout_gravatar').attr('src', 'https://secure.gravatar.com/avatar/'+MD5(jQuery(this).val().split(' ').join(''))+'?s=60&d=mm');
|
148 |
});
|
149 |
+
|
150 |
//this bit of code runs on the checkout page. If the checkbox is selected it copies the valus in the billing country and puts it in the shipping country form fields. 23.07.09
|
151 |
+
if(jQuery("#shippingSameBilling").is(":checked"))
|
152 |
+
wpsc_shipping_same_as_billing();
|
153 |
+
|
154 |
+
jQuery("#shippingSameBilling").change(function(){
|
155 |
+
if(jQuery(this).is(":checked")){
|
156 |
+
wpsc_shipping_same_as_billing();
|
157 |
+
} else {
|
158 |
+
jQuery(this).parents('table:first').find('tr').show();
|
159 |
+
jQuery('#shippingsameasbillingmessage').hide();
|
160 |
+
jQuery("select[title='billingregion'], select[title='billingstate'], select[title='billingcountry'], input[title='billingstate']").die( 'change', wpsc_shipping_same_as_billing );
|
161 |
+
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);
|
162 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
});
|
164 |
|
165 |
// Submit the product form using AJAX
|
416 |
|
417 |
jQuery.post( 'index.php', form_values, function(returned_data) {
|
418 |
eval(returned_data);
|
419 |
+
if(jQuery("#shippingSameBilling").is(':checked')){
|
420 |
+
jQuery('.shipping_region').parent().parent().hide();
|
421 |
+
}
|
422 |
});
|
423 |
+
|
424 |
}
|
425 |
|
426 |
jQuery(document).ready(function(){
|
wpsc-core/wpsc-constants.php
CHANGED
@@ -23,7 +23,8 @@ function wpsc_core_load_session() {
|
|
23 |
* The core WPEC constants necessary to start loading
|
24 |
*/
|
25 |
function wpsc_core_constants() {
|
26 |
-
|
|
|
27 |
// Define Plugin version
|
28 |
define( 'WPSC_VERSION', '3.8' );
|
29 |
define( 'WPSC_MINOR_VERSION', ( '00000' . microtime( true ) ) );
|
23 |
* The core WPEC constants necessary to start loading
|
24 |
*/
|
25 |
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', ( '00000' . microtime( true ) ) );
|
wpsc-core/wpsc-deprecated.php
CHANGED
@@ -1,4 +1,16 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
/**
|
4 |
* nzshpcrt_get_gateways()
|
@@ -47,6 +59,7 @@ function nzshpcrt_price_range($args){
|
|
47 |
|
48 |
// preserved for backwards compatibility
|
49 |
function nzshpcrt_shopping_basket( $input = null, $override_state = null ) {
|
|
|
50 |
return wpsc_shopping_cart( $input, $override_state );
|
51 |
}
|
52 |
|
@@ -86,6 +99,7 @@ function nzshpcrt_donations($args){
|
|
86 |
* 5. Function now expects two arrays as per the standard Widget API.
|
87 |
*/
|
88 |
function nzshpcrt_latest_product( $args = null, $instance ) {
|
|
|
89 |
echo wpsc_latest_product( $args, $instance );
|
90 |
}
|
91 |
|
@@ -235,28 +249,8 @@ function wpsc_product_search_url( $url ) {
|
|
235 |
*/
|
236 |
function wpsc_adjacent_products_url( $n ) {
|
237 |
|
238 |
-
|
239 |
-
|
240 |
-
$current_page = wpsc_current_page();
|
241 |
-
|
242 |
-
$n = $current_page + $n;
|
243 |
-
|
244 |
-
if ( $n < 1 || $n > $wpsc_query->page_count ) {
|
245 |
-
return;
|
246 |
-
}
|
247 |
-
|
248 |
-
while ( wpsc_have_pages() ) : wpsc_the_page();
|
249 |
-
if ( wpsc_page_number() == $n ) {
|
250 |
-
$url = wpsc_page_url();
|
251 |
-
$url = wpsc_product_search_url( $url );
|
252 |
-
$wpsc_query->rewind_pages();
|
253 |
-
return $url;
|
254 |
-
}
|
255 |
-
endwhile;
|
256 |
-
|
257 |
-
$wpsc_query->rewind_pages();
|
258 |
-
|
259 |
-
return;
|
260 |
|
261 |
}
|
262 |
|
@@ -269,17 +263,8 @@ function wpsc_adjacent_products_url( $n ) {
|
|
269 |
*/
|
270 |
function wpsc_next_products_link( $text = 'Next', $show_disabled = false ) {
|
271 |
|
272 |
-
|
273 |
-
|
274 |
-
if ( $page_url ) {
|
275 |
-
return '<a href="' . $page_url . '">' . $text . '</a>';
|
276 |
-
}
|
277 |
-
|
278 |
-
if ( $show_disabled ) {
|
279 |
-
return '<span>' . $text . '</span>';
|
280 |
-
}
|
281 |
-
|
282 |
-
return;
|
283 |
|
284 |
}
|
285 |
|
@@ -292,17 +277,8 @@ function wpsc_next_products_link( $text = 'Next', $show_disabled = false ) {
|
|
292 |
*/
|
293 |
function wpsc_previous_products_link( $text = 'Previous', $show_disabled = false ) {
|
294 |
|
295 |
-
|
296 |
-
|
297 |
-
if ( $page_url ) {
|
298 |
-
return '<a href="' . $page_url . '">' . $text . '</a>';
|
299 |
-
}
|
300 |
-
|
301 |
-
if ( $show_disabled ) {
|
302 |
-
return '<span>' . $text . '</span>';
|
303 |
-
}
|
304 |
-
|
305 |
-
return;
|
306 |
|
307 |
}
|
308 |
|
@@ -315,28 +291,8 @@ function wpsc_previous_products_link( $text = 'Previous', $show_disabled = false
|
|
315 |
*/
|
316 |
function wpsc_first_products_link( $text = 'First', $show_disabled = false ) {
|
317 |
|
318 |
-
|
319 |
-
|
320 |
-
$page_url = '';
|
321 |
-
|
322 |
-
while ( wpsc_have_pages() ) : wpsc_the_page();
|
323 |
-
$page_url = wpsc_page_url();
|
324 |
-
break;
|
325 |
-
endwhile;
|
326 |
-
|
327 |
-
$wpsc_query->rewind_pages();
|
328 |
-
|
329 |
-
$page_url = wpsc_product_search_url( $page_url );
|
330 |
-
|
331 |
-
if ( $page_url && wpsc_current_page() > 1 ) {
|
332 |
-
return '<a href="' . $page_url . '">' . $text . '</a>';
|
333 |
-
}
|
334 |
-
|
335 |
-
if ( $show_disabled ) {
|
336 |
-
return '<span>' . $text . '</span>';
|
337 |
-
}
|
338 |
-
|
339 |
-
return;
|
340 |
|
341 |
}
|
342 |
|
@@ -349,27 +305,8 @@ function wpsc_first_products_link( $text = 'First', $show_disabled = false ) {
|
|
349 |
*/
|
350 |
function wpsc_last_products_link( $text = 'Last', $show_disabled = false ) {
|
351 |
|
352 |
-
|
353 |
-
|
354 |
-
$page_url = '';
|
355 |
-
|
356 |
-
while ( wpsc_have_pages() ) : wpsc_the_page();
|
357 |
-
$page_url = wpsc_page_url();
|
358 |
-
endwhile;
|
359 |
-
|
360 |
-
$wpsc_query->rewind_pages();
|
361 |
-
|
362 |
-
$page_url = wpsc_product_search_url( $page_url );
|
363 |
-
|
364 |
-
if ( $page_url && wpsc_current_page() < $wpsc_query->page_count ) {
|
365 |
-
return '<a href="' . $page_url . '">' . $text . '</a>';
|
366 |
-
}
|
367 |
-
|
368 |
-
if ( $show_disabled ) {
|
369 |
-
return '<span>' . $text . '</span>';
|
370 |
-
}
|
371 |
-
|
372 |
-
return;
|
373 |
|
374 |
}
|
375 |
|
@@ -471,4 +408,31 @@ function wpsc_save_variation_set() {
|
|
471 |
wp_redirect($sendback);
|
472 |
}
|
473 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
?>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* wpsc_cart_item_custom_message()
|
4 |
+
*
|
5 |
+
* Deprecated function for checking whether a cart item has a custom message or not
|
6 |
+
*
|
7 |
+
* @return false
|
8 |
+
* @todo Actually correctly deprecate this
|
9 |
+
*/
|
10 |
+
|
11 |
+
function wpsc_cart_item_custom_message(){
|
12 |
+
return false;
|
13 |
+
}
|
14 |
|
15 |
/**
|
16 |
* nzshpcrt_get_gateways()
|
59 |
|
60 |
// preserved for backwards compatibility
|
61 |
function nzshpcrt_shopping_basket( $input = null, $override_state = null ) {
|
62 |
+
_deprecated_function( __FUNCTION__, '3.8', 'wpsc_shopping_cart');
|
63 |
return wpsc_shopping_cart( $input, $override_state );
|
64 |
}
|
65 |
|
99 |
* 5. Function now expects two arrays as per the standard Widget API.
|
100 |
*/
|
101 |
function nzshpcrt_latest_product( $args = null, $instance ) {
|
102 |
+
_deprecated_function( __FUNCTION__, '3.8', 'wpsc_latest_product');
|
103 |
echo wpsc_latest_product( $args, $instance );
|
104 |
}
|
105 |
|
249 |
*/
|
250 |
function wpsc_adjacent_products_url( $n ) {
|
251 |
|
252 |
+
_deprecated_function( __FUNCTION__, '3.8', 'wpsc_pagination');
|
253 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
|
255 |
}
|
256 |
|
263 |
*/
|
264 |
function wpsc_next_products_link( $text = 'Next', $show_disabled = false ) {
|
265 |
|
266 |
+
_deprecated_function( __FUNCTION__, '3.8', 'wpsc_pagination');
|
267 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
|
269 |
}
|
270 |
|
277 |
*/
|
278 |
function wpsc_previous_products_link( $text = 'Previous', $show_disabled = false ) {
|
279 |
|
280 |
+
_deprecated_function( __FUNCTION__, '3.8', 'wpsc_pagination');
|
281 |
+
return false;;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
|
283 |
}
|
284 |
|
291 |
*/
|
292 |
function wpsc_first_products_link( $text = 'First', $show_disabled = false ) {
|
293 |
|
294 |
+
_deprecated_function( __FUNCTION__, '3.8', 'wpsc_pagination');
|
295 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
|
297 |
}
|
298 |
|
305 |
*/
|
306 |
function wpsc_last_products_link( $text = 'Last', $show_disabled = false ) {
|
307 |
|
308 |
+
_deprecated_function( __FUNCTION__, '3.8', 'wpsc_pagination');
|
309 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
|
311 |
}
|
312 |
|
408 |
wp_redirect($sendback);
|
409 |
}
|
410 |
|
411 |
+
/**
|
412 |
+
* wpsc have pages function
|
413 |
+
* @return boolean - true while we have pages to loop through
|
414 |
+
*/
|
415 |
+
function wpsc_have_pages() {
|
416 |
+
_deprecated_function( __FUNCTION__, '3.8', 'wpsc_pagination');
|
417 |
+
return false;
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* wpsc the page function
|
422 |
+
* @return nothing - iterate through the pages
|
423 |
+
*/
|
424 |
+
function wpsc_the_page() {
|
425 |
+
_deprecated_function( __FUNCTION__, '3.8', 'wpsc_pagination');
|
426 |
+
return false;
|
427 |
+
}
|
428 |
+
|
429 |
+
/**
|
430 |
+
* wpsc page number function
|
431 |
+
* @return integer - the page number
|
432 |
+
*/
|
433 |
+
function wpsc_page_number() {
|
434 |
+
_deprecated_function( __FUNCTION__, '3.8', 'wpsc_pagination');
|
435 |
+
return false;
|
436 |
+
}
|
437 |
+
|
438 |
?>
|
wpsc-core/wpsc-functions.php
CHANGED
@@ -16,9 +16,48 @@
|
|
16 |
* Load up the WPEC textdomain
|
17 |
*/
|
18 |
function wpsc_core_load_textdomain() {
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
21 |
-
add_action( 'init', 'wpsc_core_load_textdomain' );
|
22 |
|
23 |
/**
|
24 |
*
|
@@ -30,7 +69,7 @@ add_action( 'init', 'wpsc_core_load_textdomain' );
|
|
30 |
function wpsc_core_load_thumbnail_sizes() {
|
31 |
// Add image sizes for products
|
32 |
add_image_size( 'product-thumbnails', get_option( 'product_image_width' ), get_option( 'product_image_height' ), get_option( 'wpsc_crop_thumbnails', false ) );
|
33 |
-
add_image_size( 'gold-thumbnails',
|
34 |
add_image_size( 'admin-product-thumbnails', 38, 38, get_option( 'wpsc_crop_thumbnails', true ) );
|
35 |
add_image_size( 'featured-product-thumbnails', 425, 215, get_option( 'wpsc_crop_thumbnails', true ) );
|
36 |
add_image_size( 'small-product-thumbnail', get_option( 'product_image_width' ), get_option( 'product_image_height' ), get_option( 'wpsc_crop_thumbnails', false ) );
|
@@ -238,18 +277,18 @@ add_action( 'rdf_item', 'wpsc_add_product_price_to_rss' );
|
|
238 |
function wpsc_register_post_types() {
|
239 |
global $wpsc_page_titles, $wp_rewrite;
|
240 |
$labels = array(
|
241 |
-
'name' => _x( 'Products', 'wpsc
|
242 |
-
'singular_name' => _x( 'Product', 'wpsc
|
243 |
-
'add_new' => _x( 'Add New', '
|
244 |
-
'add_new_item' => __('Add New Product', 'wpsc
|
245 |
-
'edit_item' => __('Edit Product', 'wpsc
|
246 |
-
'new_item' => __('New Product', 'wpsc
|
247 |
-
'view_item' => __('View Product', 'wpsc
|
248 |
-
'search_items' => __('Search Products', 'wpsc
|
249 |
-
'not_found' => __('No products found', 'wpsc
|
250 |
-
'not_found_in_trash' => __( 'No products found in Trash', 'wpsc
|
251 |
'parent_item_colon' => '',
|
252 |
-
'menu_name' => __( 'Products', 'wpsc
|
253 |
);
|
254 |
// Products
|
255 |
register_post_type( 'wpsc-product', array(
|
@@ -278,14 +317,14 @@ function wpsc_register_post_types() {
|
|
278 |
) );
|
279 |
|
280 |
// Product tags
|
281 |
-
$labels = array( 'name' => _x( 'Product Tags', 'taxonomy general name' ),
|
282 |
-
'singular_name' => _x( 'Product Tag', 'taxonomy singular name' ),
|
283 |
-
'search_items' => __( 'Product Search Tags' ),
|
284 |
-
'all_items' => __( 'All Product Tags' ),
|
285 |
-
'edit_item' => __( 'Edit Tag' ),
|
286 |
-
'update_item' => __( 'Update Tag' ),
|
287 |
-
'add_new_item' => __( 'Add new Product Tag' ),
|
288 |
-
'new_item_name' => __( 'New Product Tag Name' ) );
|
289 |
|
290 |
register_taxonomy( 'product_tag', 'wpsc-product', array(
|
291 |
'hierarchical' => false,
|
@@ -297,16 +336,16 @@ function wpsc_register_post_types() {
|
|
297 |
|
298 |
// Product categories, is heirarchical and can use permalinks
|
299 |
$labels = array(
|
300 |
-
'name' => _x( 'Categories', 'taxonomy general name' ),
|
301 |
-
'singular_name' => _x( 'Product Category', 'taxonomy singular name' ),
|
302 |
-
'search_items' => __( 'Search Product Categories' ),
|
303 |
-
'all_items' => __( 'All Product Categories' ),
|
304 |
-
'parent_item' => __( 'Parent Product Category' ),
|
305 |
-
'parent_item_colon' => __( 'Parent Product Category:' ),
|
306 |
-
'edit_item' => __( 'Edit Product Category' ),
|
307 |
-
'update_item' => __( 'Update Product Category' ),
|
308 |
-
'add_new_item' => __( 'Add New Product Category' ),
|
309 |
-
'new_item_name' => __( 'New Product Category Name' )
|
310 |
);
|
311 |
register_taxonomy( 'wpsc_product_category', 'wpsc-product', array(
|
312 |
'hierarchical' => true,
|
@@ -317,16 +356,16 @@ function wpsc_register_post_types() {
|
|
317 |
'labels' => $labels
|
318 |
) );
|
319 |
$labels = array(
|
320 |
-
'name' => _x( 'Variations', 'taxonomy general name' ),
|
321 |
-
'singular_name' => _x( 'Variation', 'taxonomy singular name' ),
|
322 |
-
'search_items' => __( 'Search Variations' ),
|
323 |
-
'all_items' => __( 'All Variations' ),
|
324 |
-
'parent_item' => __( 'Parent Variation' ),
|
325 |
-
'parent_item_colon' => __( 'Parent Variations:' ),
|
326 |
-
'edit_item' => __( 'Edit Variation' ),
|
327 |
-
'update_item' => __( 'Update Variation' ),
|
328 |
-
'add_new_item' => __( 'Add New Variation' ),
|
329 |
-
'new_item_name' => __( 'New Variation Name' ),
|
330 |
);
|
331 |
|
332 |
// Product Variations, is internally heirarchical, externally, two separate types of items, one containing the other
|
@@ -382,7 +421,7 @@ function wpsc_start_the_query() {
|
|
382 |
if ( count( $wpsc_query_vars ) <= 1 ) {
|
383 |
$wpsc_query_vars = array(
|
384 |
'post_parent' => 0,
|
385 |
-
'order' => 'ASC'
|
386 |
);
|
387 |
|
388 |
if( isset( $_GET['product_order'] ) )
|
@@ -400,14 +439,15 @@ function wpsc_start_the_query() {
|
|
400 |
$wpsc_query_vars['term'] = $wp_query->query_vars['term'];
|
401 |
}else{
|
402 |
$wpsc_query_vars['post_type'] = 'wpsc-product';
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
|
|
411 |
}
|
412 |
$orderby = get_option( 'wpsc_sort_by' );
|
413 |
if( isset( $_GET['product_order'] ) )
|
@@ -447,7 +487,6 @@ function wpsc_start_the_query() {
|
|
447 |
if(empty($wpsc_query_vars['paged']))
|
448 |
$wpsc_query_vars['paged'] = get_query_var('page');
|
449 |
}
|
450 |
-
|
451 |
$wpsc_query = new WP_Query( $wpsc_query_vars );
|
452 |
}
|
453 |
}
|
@@ -685,7 +724,7 @@ function wpsc_generate_product_query( $query ) {
|
|
685 |
} else {
|
686 |
$query->query_vars['posts_per_page'] = '-1';
|
687 |
}
|
688 |
-
if ( $query->is_tax == true
|
689 |
new wpsc_products_by_category( $query );
|
690 |
|
691 |
return $query;
|
@@ -720,24 +759,27 @@ class wpsc_products_by_category {
|
|
720 |
global $wpdb;
|
721 |
$q = $query->query_vars;
|
722 |
|
723 |
-
|
724 |
// Category stuff for nice URLs
|
725 |
-
if ( ('' != $q['
|
|
|
|
|
|
|
726 |
$join = " INNER JOIN $wpdb->term_relationships
|
727 |
ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)
|
728 |
INNER JOIN $wpdb->term_taxonomy
|
729 |
ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
|
730 |
";
|
731 |
-
|
|
|
732 |
$whichcat = " AND $wpdb->term_taxonomy.taxonomy = '{$q['taxonomy']}' ";
|
733 |
|
734 |
$term_data = get_term_by( 'slug', $q['term'], $q['taxonomy'] );
|
735 |
-
|
736 |
-
$term_children_data = get_term_children( $term_data->term_id, $q['taxonomy'] );
|
737 |
-
|
738 |
$in_cats = array( $term_data->term_id );
|
739 |
-
|
740 |
-
|
|
|
|
|
741 |
$in_cats = "'" . implode( "', '", $in_cats ) . "'";
|
742 |
$whichcat .= "AND $wpdb->term_taxonomy.term_id IN ($in_cats)";
|
743 |
$groupby = "{$wpdb->posts}.ID";
|
@@ -932,8 +974,10 @@ function wpsc_product_link( $permalink, $post, $leavename ) {
|
|
932 |
}
|
933 |
|
934 |
$post_name = $post->post_name;
|
935 |
-
|
|
|
936 |
$post_name = "product/{$post_name}";
|
|
|
937 |
|
938 |
if(isset($category_slug) && empty($category_slug)) $category_slug = 'product';
|
939 |
|
16 |
* Load up the WPEC textdomain
|
17 |
*/
|
18 |
function wpsc_core_load_textdomain() {
|
19 |
+
//if there is a translation file in wp-content/langauges then load it, else load from default location
|
20 |
+
//this is to alow users modify translations and don't loose modifications when upgrading
|
21 |
+
if( !load_plugin_textdomain( 'wpsc', false, '../languages/' ) )
|
22 |
+
load_plugin_textdomain( 'wpsc', false, dirname( plugin_basename( __FILE__ ) ) . '/../wpsc-languages/' );
|
23 |
+
}
|
24 |
+
add_action( 'plugins_loaded', 'wpsc_core_load_textdomain' );
|
25 |
+
|
26 |
+
add_filter( 'intermediate_image_sizes_advanced', 'wpsc_intermediate_image_sizes_advanced', 10, 1 );
|
27 |
+
|
28 |
+
function wpsc_intermediate_image_sizes_advanced($sizes){
|
29 |
+
$sizes['small-product-thumbnail']=array(
|
30 |
+
"width" => get_option( 'product_image_width' ),
|
31 |
+
"height" => get_option( 'product_image_height' ),
|
32 |
+
"crop" => get_option( 'wpsc_crop_thumbnails', false )
|
33 |
+
);
|
34 |
+
$sizes['medium-single-product']=array(
|
35 |
+
"width" => get_option( 'single_view_image_width' ),
|
36 |
+
"height" => get_option( 'single_view_image_height' ),
|
37 |
+
"crop" => get_option( 'wpsc_crop_thumbnails', false )
|
38 |
+
);
|
39 |
+
$sizes['featured-product-thumbnails']=array(
|
40 |
+
"width" => 425,
|
41 |
+
"height" => 215,
|
42 |
+
"crop" => get_option( 'wpsc_crop_thumbnails', true )
|
43 |
+
);
|
44 |
+
$sizes['admin-product-thumbnails']=array(
|
45 |
+
"width" => 38,
|
46 |
+
"height" => 38,
|
47 |
+
"crop" => get_option( 'wpsc_crop_thumbnails', true )
|
48 |
+
);
|
49 |
+
$sizes['product-thumbnails']=array(
|
50 |
+
"width" => get_option( 'product_image_width' ),
|
51 |
+
"height" => get_option( 'product_image_height' ),
|
52 |
+
"crop" => get_option( 'wpsc_crop_thumbnails', false )
|
53 |
+
);
|
54 |
+
$sizes['gold-thumbnails']=array(
|
55 |
+
"width" => get_option( 'wpsc_gallery_image_width' ),
|
56 |
+
"height" => get_option( 'wpsc_gallery_image_height' ),
|
57 |
+
"crop" => get_option( 'wpsc_crop_thumbnails', false )
|
58 |
+
);
|
59 |
+
return $sizes;
|
60 |
}
|
|
|
61 |
|
62 |
/**
|
63 |
*
|
69 |
function wpsc_core_load_thumbnail_sizes() {
|
70 |
// Add image sizes for products
|
71 |
add_image_size( 'product-thumbnails', get_option( 'product_image_width' ), get_option( 'product_image_height' ), get_option( 'wpsc_crop_thumbnails', false ) );
|
72 |
+
add_image_size( 'gold-thumbnails', get_option( 'wpsc_gallery_image_width' ), get_option( 'wpsc_gallery_image_height' ), get_option( 'wpsc_crop_thumbnails', false ) );
|
73 |
add_image_size( 'admin-product-thumbnails', 38, 38, get_option( 'wpsc_crop_thumbnails', true ) );
|
74 |
add_image_size( 'featured-product-thumbnails', 425, 215, get_option( 'wpsc_crop_thumbnails', true ) );
|
75 |
add_image_size( 'small-product-thumbnail', get_option( 'product_image_width' ), get_option( 'product_image_height' ), get_option( 'wpsc_crop_thumbnails', false ) );
|
277 |
function wpsc_register_post_types() {
|
278 |
global $wpsc_page_titles, $wp_rewrite;
|
279 |
$labels = array(
|
280 |
+
'name' => _x( 'Products', 'post type name', 'wpsc' ),
|
281 |
+
'singular_name' => _x( 'Product', 'post type singular name', 'wpsc' ),
|
282 |
+
'add_new' => _x( 'Add New', 'admin menu: add new product', 'wpsc' ),
|
283 |
+
'add_new_item' => __('Add New Product', 'wpsc' ),
|
284 |
+
'edit_item' => __('Edit Product', 'wpsc' ),
|
285 |
+
'new_item' => __('New Product', 'wpsc' ),
|
286 |
+
'view_item' => __('View Product', 'wpsc' ),
|
287 |
+
'search_items' => __('Search Products', 'wpsc' ),
|
288 |
+
'not_found' => __('No products found', 'wpsc' ),
|
289 |
+
'not_found_in_trash' => __( 'No products found in Trash', 'wpsc' ),
|
290 |
'parent_item_colon' => '',
|
291 |
+
'menu_name' => __( 'Products', 'wpsc' )
|
292 |
);
|
293 |
// Products
|
294 |
register_post_type( 'wpsc-product', array(
|
317 |
) );
|
318 |
|
319 |
// Product tags
|
320 |
+
$labels = array( 'name' => _x( 'Product Tags', 'taxonomy general name', 'wpsc' ),
|
321 |
+
'singular_name' => _x( 'Product Tag', 'taxonomy singular name', 'wpsc' ),
|
322 |
+
'search_items' => __( 'Product Search Tags', 'wpsc' ),
|
323 |
+
'all_items' => __( 'All Product Tags' , 'wpsc'),
|
324 |
+
'edit_item' => __( 'Edit Tag', 'wpsc' ),
|
325 |
+
'update_item' => __( 'Update Tag', 'wpsc' ),
|
326 |
+
'add_new_item' => __( 'Add new Product Tag', 'wpsc' ),
|
327 |
+
'new_item_name' => __( 'New Product Tag Name', 'wpsc' ) );
|
328 |
|
329 |
register_taxonomy( 'product_tag', 'wpsc-product', array(
|
330 |
'hierarchical' => false,
|
336 |
|
337 |
// Product categories, is heirarchical and can use permalinks
|
338 |
$labels = array(
|
339 |
+
'name' => _x( 'Categories', 'taxonomy general name', 'wpsc' ),
|
340 |
+
'singular_name' => _x( 'Product Category', 'taxonomy singular name', 'wpsc' ),
|
341 |
+
'search_items' => __( 'Search Product Categories', 'wpsc' ),
|
342 |
+
'all_items' => __( 'All Product Categories', 'wpsc' ),
|
343 |
+
'parent_item' => __( 'Parent Product Category', 'wpsc' ),
|
344 |
+
'parent_item_colon' => __( 'Parent Product Category:', 'wpsc' ),
|
345 |
+
'edit_item' => __( 'Edit Product Category', 'wpsc' ),
|
346 |
+
'update_item' => __( 'Update Product Category', 'wpsc' ),
|
347 |
+
'add_new_item' => __( 'Add New Product Category', 'wpsc' ),
|
348 |
+
'new_item_name' => __( 'New Product Category Name', 'wpsc' )
|
349 |
);
|
350 |
register_taxonomy( 'wpsc_product_category', 'wpsc-product', array(
|
351 |
'hierarchical' => true,
|
356 |
'labels' => $labels
|
357 |
) );
|
358 |
$labels = array(
|
359 |
+
'name' => _x( 'Variations', 'taxonomy general name', 'wpsc' ),
|
360 |
+
'singular_name' => _x( 'Variation', 'taxonomy singular name', 'wpsc' ),
|
361 |
+
'search_items' => __( 'Search Variations', 'wpsc' ),
|
362 |
+
'all_items' => __( 'All Variations', 'wpsc' ),
|
363 |
+
'parent_item' => __( 'Parent Variation', 'wpsc' ),
|
364 |
+
'parent_item_colon' => __( 'Parent Variations:', 'wpsc' ),
|
365 |
+
'edit_item' => __( 'Edit Variation', 'wpsc' ),
|
366 |
+
'update_item' => __( 'Update Variation', 'wpsc' ),
|
367 |
+
'add_new_item' => __( 'Add New Variation', 'wpsc' ),
|
368 |
+
'new_item_name' => __( 'New Variation Name', 'wpsc' ),
|
369 |
);
|
370 |
|
371 |
// Product Variations, is internally heirarchical, externally, two separate types of items, one containing the other
|
421 |
if ( count( $wpsc_query_vars ) <= 1 ) {
|
422 |
$wpsc_query_vars = array(
|
423 |
'post_parent' => 0,
|
424 |
+
'order' => apply_filters('wpsc_product_order','ASC')
|
425 |
);
|
426 |
|
427 |
if( isset( $_GET['product_order'] ) )
|
439 |
$wpsc_query_vars['term'] = $wp_query->query_vars['term'];
|
440 |
}else{
|
441 |
$wpsc_query_vars['post_type'] = 'wpsc-product';
|
442 |
+
$wpsc_query_vars['pagename'] = 'products-page';
|
443 |
+
}
|
444 |
+
if(1 == get_option('use_pagination')){
|
445 |
+
$wpsc_query_vars['nopaging'] = false;
|
446 |
+
$wpsc_query_vars['posts_per_page'] = get_option('wpsc_products_per_page');
|
447 |
+
$wpsc_query_vars['paged'] = get_query_var('paged');
|
448 |
+
if(empty($wpsc_query_vars['paged']))
|
449 |
+
$wpsc_query_vars['paged'] = get_query_var('page');
|
450 |
+
|
451 |
}
|
452 |
$orderby = get_option( 'wpsc_sort_by' );
|
453 |
if( isset( $_GET['product_order'] ) )
|
487 |
if(empty($wpsc_query_vars['paged']))
|
488 |
$wpsc_query_vars['paged'] = get_query_var('page');
|
489 |
}
|
|
|
490 |
$wpsc_query = new WP_Query( $wpsc_query_vars );
|
491 |
}
|
492 |
}
|
724 |
} else {
|
725 |
$query->query_vars['posts_per_page'] = '-1';
|
726 |
}
|
727 |
+
if ( $query->is_tax == true )
|
728 |
new wpsc_products_by_category( $query );
|
729 |
|
730 |
return $query;
|
759 |
global $wpdb;
|
760 |
$q = $query->query_vars;
|
761 |
|
762 |
+
|
763 |
// Category stuff for nice URLs
|
764 |
+
if ( ('' != $q['wpsc_product_category']) && !$query->is_singular ) {
|
765 |
+
$q['taxonomy'] = 'wpsc_product_category';
|
766 |
+
$q['term'] = $q['wpsc_product_category'];
|
767 |
+
|
768 |
$join = " INNER JOIN $wpdb->term_relationships
|
769 |
ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)
|
770 |
INNER JOIN $wpdb->term_taxonomy
|
771 |
ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
|
772 |
";
|
773 |
+
if(isset($q['meta_key']))
|
774 |
+
$join .= " INNER JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) ";
|
775 |
$whichcat = " AND $wpdb->term_taxonomy.taxonomy = '{$q['taxonomy']}' ";
|
776 |
|
777 |
$term_data = get_term_by( 'slug', $q['term'], $q['taxonomy'] );
|
|
|
|
|
|
|
778 |
$in_cats = array( $term_data->term_id );
|
779 |
+
if('0' != get_option('show_subcatsprods_in_cat')){
|
780 |
+
$term_children_data = get_term_children( $term_data->term_id, $q['taxonomy'] );
|
781 |
+
$in_cats = array_reverse( array_merge( $in_cats, $term_children_data ) );
|
782 |
+
}
|
783 |
$in_cats = "'" . implode( "', '", $in_cats ) . "'";
|
784 |
$whichcat .= "AND $wpdb->term_taxonomy.term_id IN ($in_cats)";
|
785 |
$groupby = "{$wpdb->posts}.ID";
|
974 |
}
|
975 |
|
976 |
$post_name = $post->post_name;
|
977 |
+
/*
|
978 |
+
if ( in_array( $post_name, $product_category_slugs ) )
|
979 |
$post_name = "product/{$post_name}";
|
980 |
+
*/
|
981 |
|
982 |
if(isset($category_slug) && empty($category_slug)) $category_slug = 'product';
|
983 |
|
wpsc-core/wpsc-installer.php
CHANGED
@@ -35,7 +35,7 @@ function wpsc_install() {
|
|
35 |
if ( !$first_install )
|
36 |
wpsc_regenerate_thumbnails();
|
37 |
|
38 |
-
add_option( 'wpsc_version', WPSC_VERSION, '
|
39 |
|
40 |
// run the create or update code here.
|
41 |
wpsc_create_or_update_tables();
|
@@ -52,15 +52,48 @@ function wpsc_install() {
|
|
52 |
update_option( 'wpsc_version', WPSC_VERSION );
|
53 |
update_option( 'wpsc_minor_version', WPSC_MINOR_VERSION );
|
54 |
}
|
|
|
|
|
55 |
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
-
|
60 |
-
add_option( '
|
61 |
-
add_option( '
|
62 |
-
|
63 |
-
add_option( '
|
|
|
|
|
|
|
|
|
64 |
|
65 |
$default_payment_gateways_names = array(
|
66 |
'chronopay' => '',
|
@@ -75,38 +108,33 @@ function wpsc_install() {
|
|
75 |
|
76 |
|
77 |
if ( function_exists( 'register_sidebar' ) )
|
78 |
-
add_option( 'cart_location', '4',
|
79 |
-
else
|
80 |
-
add_option( 'cart_location', '1', __( 'Cart Location', 'wpsc' ), 'yes' );
|
81 |
-
|
82 |
-
if ( function_exists( 'register_sidebar' ) )
|
83 |
-
add_option( 'cart_location', '4', __( 'Cart Location', 'wpsc' ), 'yes' );
|
84 |
else
|
85 |
-
add_option( 'cart_location', '1',
|
86 |
|
87 |
-
add_option( 'currency_type', '156',
|
88 |
-
add_option( 'currency_sign_location', '3',
|
89 |
|
90 |
-
add_option( 'gst_rate', '1',
|
91 |
|
92 |
-
add_option( 'max_downloads', '1',
|
93 |
|
94 |
-
add_option( 'display_pnp', '1',
|
95 |
|
96 |
-
add_option( 'display_specials', '1',
|
97 |
-
add_option( 'do_not_use_shipping', '1', '
|
98 |
|
99 |
-
add_option( 'postage_and_packaging', '0',
|
100 |
|
101 |
-
add_option( 'purch_log_email', '',
|
102 |
-
add_option( 'return_email', '',
|
103 |
-
add_option( 'terms_and_conditions', '',
|
104 |
|
105 |
-
add_option( 'google_key', 'none',
|
106 |
-
add_option( 'google_id', 'none',
|
107 |
|
108 |
-
add_option( 'default_brand', 'none',
|
109 |
-
add_option( 'wpsc_default_category', 'all',
|
110 |
|
111 |
add_option( 'product_view', 'default', "", 'yes' );
|
112 |
add_option( 'add_plustax', 'default', "", '1' );
|
@@ -118,20 +146,20 @@ function wpsc_install() {
|
|
118 |
update_option( 'show_categorybrands', 2 );
|
119 |
|
120 |
// PayPal options
|
121 |
-
add_option( 'paypal_business', '',
|
122 |
-
add_option( 'paypal_url', '',
|
123 |
-
add_option( 'paypal_ipn', '1',
|
124 |
|
125 |
|
126 |
-
add_option( 'paypal_multiple_business', '',
|
127 |
|
128 |
add_option( 'paypal_multiple_url', "https://www.paypal.com/cgi-bin/webscr" );
|
129 |
|
130 |
-
add_option( 'product_ratings', '0',
|
131 |
add_option( 'wpsc_email_receipt', __( 'Thank you for purchasing with %shop_name%, any items to be shipped will be processed as soon as possible, any items that can be downloaded can be downloaded using the links on this page.All prices include tax and postage and packaging where applicable.
|
132 |
You ordered these items:
|
133 |
-
%product_list%%total_shipping%%total_price%', 'wpsc' ), 'yes' );
|
134 |
-
add_option( 'wpsc_email_admin', __( '%product_list%%total_shipping%%total_price%', 'wpsc' ), 'yes' );
|
135 |
|
136 |
add_option( 'wpsc_selected_theme', 'default', '', 'yes' );
|
137 |
|
@@ -308,18 +336,18 @@ if ( !function_exists( 'wp_generate_attachment_metadata' ) ) {
|
|
308 |
$post_parent_type = get_post_type( $image->post_parent );
|
309 |
|
310 |
if ("wpsc-product" == $post_parent_type) {
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
|
|
321 |
}
|
322 |
-
}
|
323 |
}
|
324 |
}
|
325 |
|
@@ -715,7 +743,7 @@ function wpsc_add_checkout_fields() {
|
|
715 |
( '" . __( 'Country', 'wpsc' ) . "', 'country', '1', '0', '', '1', 7,'billingcountry'),
|
716 |
( '" . __( 'Postal Code', 'wpsc' ) . "', 'text', '0', '0', '', '1', 8,'billingpostcode'),
|
717 |
( '" . __( 'Email', 'wpsc' ) . "', 'email', '1', '1', '', '1', 9,'billingemail'),
|
718 |
-
( '" . __( 'Shipping
|
719 |
( '" . __( 'First Name', 'wpsc' ) . "', 'text', '0', '0', '', '1', 11,'shippingfirstname'),
|
720 |
( '" . __( 'Last Name', 'wpsc' ) . "', 'text', '0', '0', '', '1', 12,'shippinglastname'),
|
721 |
( '" . __( 'Address', 'wpsc' ) . "', 'address', '0', '0', '', '1', 13,'shippingaddress'),
|
@@ -732,8 +760,12 @@ function wpsc_add_checkout_fields() {
|
|
732 |
}
|
733 |
function wpsc_rename_checkout_column(){
|
734 |
global $wpdb;
|
735 |
-
$sql = "
|
736 |
-
$wpdb->
|
|
|
|
|
|
|
|
|
737 |
|
738 |
}
|
739 |
?>
|
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();
|
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 |
|
58 |
+
if('' == get_option('wpsc_share_this'))
|
59 |
+
update_option('wpsc_share_this',0);
|
60 |
+
|
61 |
+
if('' == get_option('wpsc_crop_thumbnails'))
|
62 |
+
update_option('wpsc_crop_thumbnails',0);
|
63 |
+
|
64 |
+
if('' == get_option('wpsc_products_per_page'))
|
65 |
+
update_option('wpsc_products_per_page',0);
|
66 |
+
|
67 |
+
if('' == get_option('wpsc_force_ssl'))
|
68 |
+
update_option('wpsc_force_ssl',0);
|
69 |
+
|
70 |
+
if('' == get_option('use_pagination'))
|
71 |
+
update_option('use_pagination',0);
|
72 |
+
|
73 |
+
if('' == get_option('hide_name_link'))
|
74 |
+
update_option('hide_name_link',0);
|
75 |
+
|
76 |
+
if('' == get_option('wpsc_enable_comments'))
|
77 |
+
update_option('wpsc_enable_comments',0);
|
78 |
+
|
79 |
+
if('' == get_option('multi_add'))
|
80 |
+
update_option('multi_add',0);
|
81 |
+
|
82 |
+
if('' == get_option('hide_addtocart_button'))
|
83 |
+
update_option('hide_addtocart_button',0);
|
84 |
+
|
85 |
+
if('' == get_option('wpsc_addtocart_or_buynow'))
|
86 |
+
update_option('wpsc_addtocart_or_buynow',0);
|
87 |
|
88 |
+
|
89 |
+
add_option( 'show_thumbnails', 1, '', "yes" );
|
90 |
+
add_option( 'show_thumbnails_thickbox', 1, '', "yes" );
|
91 |
+
|
92 |
+
add_option( 'product_list_url', '', '', 'yes' );
|
93 |
+
add_option( 'shopping_cart_url', '', '', 'yes' );
|
94 |
+
add_option( 'checkout_url', '', '', 'yes' );
|
95 |
+
add_option( 'transact_url', '', '', 'yes' );
|
96 |
+
add_option( 'payment_gateway', '','', 'yes' );
|
97 |
|
98 |
$default_payment_gateways_names = array(
|
99 |
'chronopay' => '',
|
108 |
|
109 |
|
110 |
if ( function_exists( 'register_sidebar' ) )
|
111 |
+
add_option( 'cart_location', '4','', 'yes' );
|
|
|
|
|
|
|
|
|
|
|
112 |
else
|
113 |
+
add_option( 'cart_location', '1', '', 'yes' );
|
114 |
|
115 |
+
add_option( 'currency_type', '156','', 'yes' );
|
116 |
+
add_option( 'currency_sign_location', '3', '', 'yes' );
|
117 |
|
118 |
+
add_option( 'gst_rate', '1','', 'yes' );
|
119 |
|
120 |
+
add_option( 'max_downloads', '1','', 'yes' );
|
121 |
|
122 |
+
add_option( 'display_pnp', '1', '', 'yes' );
|
123 |
|
124 |
+
add_option( 'display_specials', '1', '', 'yes' );
|
125 |
+
add_option( 'do_not_use_shipping', '1', '', 'yes' );
|
126 |
|
127 |
+
add_option( 'postage_and_packaging', '0','', 'yes' );
|
128 |
|
129 |
+
add_option( 'purch_log_email', '', '', 'yes' );
|
130 |
+
add_option( 'return_email', '', '', 'yes' );
|
131 |
+
add_option( 'terms_and_conditions', '', '', 'yes' );
|
132 |
|
133 |
+
add_option( 'google_key', 'none', '', 'yes' );
|
134 |
+
add_option( 'google_id', 'none', '', 'yes' );
|
135 |
|
136 |
+
add_option( 'default_brand', 'none', '', 'yes' );
|
137 |
+
add_option( 'wpsc_default_category', 'all', '', 'yes' );
|
138 |
|
139 |
add_option( 'product_view', 'default', "", 'yes' );
|
140 |
add_option( 'add_plustax', 'default', "", '1' );
|
146 |
update_option( 'show_categorybrands', 2 );
|
147 |
|
148 |
// PayPal options
|
149 |
+
add_option( 'paypal_business', '', '', 'yes' );
|
150 |
+
add_option( 'paypal_url', '', '', 'yes' );
|
151 |
+
add_option( 'paypal_ipn', '1', '', 'yes' );
|
152 |
|
153 |
|
154 |
+
add_option( 'paypal_multiple_business', '', '', 'yes' );
|
155 |
|
156 |
add_option( 'paypal_multiple_url', "https://www.paypal.com/cgi-bin/webscr" );
|
157 |
|
158 |
+
add_option( 'product_ratings', '0', '', 'yes' );
|
159 |
add_option( 'wpsc_email_receipt', __( 'Thank you for purchasing with %shop_name%, any items to be shipped will be processed as soon as possible, any items that can be downloaded can be downloaded using the links on this page.All prices include tax and postage and packaging where applicable.
|
160 |
You ordered these items:
|
161 |
+
%product_list%%total_shipping%%total_price%', 'wpsc' ), '', 'yes' );
|
162 |
+
add_option( 'wpsc_email_admin', __( '%product_list%%total_shipping%%total_price%', 'wpsc' ), '','yes' );
|
163 |
|
164 |
add_option( 'wpsc_selected_theme', 'default', '', 'yes' );
|
165 |
|
336 |
$post_parent_type = get_post_type( $image->post_parent );
|
337 |
|
338 |
if ("wpsc-product" == $post_parent_type) {
|
339 |
+
|
340 |
+
$fullsizepath = get_attached_file( $id );
|
341 |
+
|
342 |
+
if ( false === $fullsizepath || !file_exists($fullsizepath) )
|
343 |
+
die ("Could not find path specified!");
|
344 |
+
|
345 |
+
if ( wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $fullsizepath ) ) ) {
|
346 |
+
$success = true;
|
347 |
+
} else {
|
348 |
+
$success = false;
|
349 |
+
}
|
350 |
}
|
|
|
351 |
}
|
352 |
}
|
353 |
|
743 |
( '" . __( 'Country', 'wpsc' ) . "', 'country', '1', '0', '', '1', 7,'billingcountry'),
|
744 |
( '" . __( 'Postal Code', 'wpsc' ) . "', 'text', '0', '0', '', '1', 8,'billingpostcode'),
|
745 |
( '" . __( 'Email', 'wpsc' ) . "', 'email', '1', '1', '', '1', 9,'billingemail'),
|
746 |
+
( '" . __( 'Shipping Address', 'wpsc' ) . "', 'heading', '0', '0', '', '1', 10,'delivertoafriend'),
|
747 |
( '" . __( 'First Name', 'wpsc' ) . "', 'text', '0', '0', '', '1', 11,'shippingfirstname'),
|
748 |
( '" . __( 'Last Name', 'wpsc' ) . "', 'text', '0', '0', '', '1', 12,'shippinglastname'),
|
749 |
( '" . __( 'Address', 'wpsc' ) . "', 'address', '0', '0', '', '1', 13,'shippingaddress'),
|
760 |
}
|
761 |
function wpsc_rename_checkout_column(){
|
762 |
global $wpdb;
|
763 |
+
$sql = "SELECT `checkout_order` FROM `" . WPSC_TABLE_CHECKOUT_FORMS . "`";
|
764 |
+
$col = $wpdb->get_col($sql);
|
765 |
+
if(empty($col)){
|
766 |
+
$sql = "ALTER TABLE `" . WPSC_TABLE_CHECKOUT_FORMS . "` CHANGE `order` `checkout_order` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'";
|
767 |
+
$wpdb->query($sql);
|
768 |
+
}
|
769 |
|
770 |
}
|
771 |
?>
|
wpsc-includes/ajax.functions.php
CHANGED
@@ -81,9 +81,9 @@ function wpsc_add_to_cart() {
|
|
81 |
if ( $parameters['quantity'] <= 0 ) {
|
82 |
$cart_messages[] = __( 'Sorry, but you cannot add zero items to your cart', 'wpsc' );
|
83 |
} else if ( $wpsc_cart->get_remaining_quantity( $product_id, $parameters['variation_values'], $parameters['quantity'] ) > 0 ) {
|
84 |
-
$cart_messages[] =
|
85 |
} else {
|
86 |
-
$cart_messages[] =
|
87 |
}
|
88 |
}
|
89 |
|
@@ -806,8 +806,8 @@ function wpsc_change_tax() {
|
|
806 |
if ( ($form_selected_country != null) && ($onchange_function != null) ) {
|
807 |
$region_list = $wpdb->get_results( "SELECT `" . WPSC_TABLE_REGION_TAX . "`.* FROM `" . WPSC_TABLE_REGION_TAX . "`, `" . WPSC_TABLE_CURRENCY_LIST . "` WHERE `" . WPSC_TABLE_CURRENCY_LIST . "`.`isocode` IN('" . $form_selected_country . "') AND `" . WPSC_TABLE_CURRENCY_LIST . "`.`id` = `" . WPSC_TABLE_REGION_TAX . "`.`country_id`", ARRAY_A );
|
808 |
if ( $region_list != null ) {
|
809 |
-
|
810 |
-
$output = "<select name='collected_data[" . $form_id . "][1]' class='current_region' onchange='$onchange_function(\"region_country_form_$form_id\", \"$form_id\");'>\n\r";
|
811 |
|
812 |
foreach ( $region_list as $region ) {
|
813 |
if ( $form_selected_region == $region['id'] ) {
|
@@ -1028,7 +1028,7 @@ function wpsc_download_file() {
|
|
1028 |
}
|
1029 |
|
1030 |
if ( is_file( $file_path ) ) {
|
1031 |
-
set_time_limit(0);
|
1032 |
header( 'Content-Type: ' . $file_data->post_mime_type );
|
1033 |
header( 'Content-Length: ' . filesize( $file_path ) );
|
1034 |
header( 'Content-Transfer-Encoding: binary' );
|
81 |
if ( $parameters['quantity'] <= 0 ) {
|
82 |
$cart_messages[] = __( 'Sorry, but you cannot add zero items to your cart', 'wpsc' );
|
83 |
} else if ( $wpsc_cart->get_remaining_quantity( $product_id, $parameters['variation_values'], $parameters['quantity'] ) > 0 ) {
|
84 |
+
$cart_messages[] = sprintf( __( 'Sorry, but there are only %s of this item in stock.', 'wpsc' ), $wpsc_cart->get_remaining_quantity( $product_id, $parameters['variation_values'], $parameters['quantity'] ) );
|
85 |
} else {
|
86 |
+
$cart_messages[] = sprintf( __( 'Sorry, but the item "%s" is out of stock.', 'wpsc' ), $product->post_title );
|
87 |
}
|
88 |
}
|
89 |
|
806 |
if ( ($form_selected_country != null) && ($onchange_function != null) ) {
|
807 |
$region_list = $wpdb->get_results( "SELECT `" . WPSC_TABLE_REGION_TAX . "`.* FROM `" . WPSC_TABLE_REGION_TAX . "`, `" . WPSC_TABLE_CURRENCY_LIST . "` WHERE `" . WPSC_TABLE_CURRENCY_LIST . "`.`isocode` IN('" . $form_selected_country . "') AND `" . WPSC_TABLE_CURRENCY_LIST . "`.`id` = `" . WPSC_TABLE_REGION_TAX . "`.`country_id`", ARRAY_A );
|
808 |
if ( $region_list != null ) {
|
809 |
+
$title = (empty($_POST['billing_country']))?'shippingstate':'billingstate';
|
810 |
+
$output = "<select name='collected_data[" . $form_id . "][1]' class='current_region' onchange='$onchange_function(\"region_country_form_$form_id\", \"$form_id\");' title='" . $title . "'>\n\r";
|
811 |
|
812 |
foreach ( $region_list as $region ) {
|
813 |
if ( $form_selected_region == $region['id'] ) {
|
1028 |
}
|
1029 |
|
1030 |
if ( is_file( $file_path ) ) {
|
1031 |
+
if( !ini_get('safe_mode') ) set_time_limit(0);
|
1032 |
header( 'Content-Type: ' . $file_data->post_mime_type );
|
1033 |
header( 'Content-Length: ' . filesize( $file_path ) );
|
1034 |
header( 'Content-Transfer-Encoding: binary' );
|
wpsc-includes/breadcrumbs.class.php
CHANGED
@@ -19,7 +19,7 @@ function wpsc_has_breadcrumbs() {
|
|
19 |
* @return boolean - true if we have breadcrumbs to loop through
|
20 |
*/
|
21 |
function wpsc_have_breadcrumbs() {
|
22 |
-
global $
|
23 |
|
24 |
return $wpsc_breadcrumbs->have_breadcrumbs();
|
25 |
}
|
@@ -29,7 +29,7 @@ function wpsc_have_breadcrumbs() {
|
|
29 |
* @return nothing - iterate through the breadcrumbs
|
30 |
*/
|
31 |
function wpsc_the_breadcrumb() {
|
32 |
-
global $
|
33 |
|
34 |
$wpsc_breadcrumbs->the_breadcrumb();
|
35 |
}
|
@@ -39,7 +39,7 @@ function wpsc_the_breadcrumb() {
|
|
39 |
* @return string - the breadcrumb name
|
40 |
*/
|
41 |
function wpsc_breadcrumb_name() {
|
42 |
-
global $
|
43 |
|
44 |
return $wpsc_breadcrumbs->breadcrumb['name'];
|
45 |
}
|
@@ -49,7 +49,7 @@ function wpsc_breadcrumb_name() {
|
|
49 |
* @return string - the breadcrumb slug - for use in the CSS ID
|
50 |
*/
|
51 |
function wpsc_breadcrumb_slug() {
|
52 |
-
global $
|
53 |
|
54 |
return (isset($wpsc_breadcrumbs->breadcrumb['slug']) ? $wpsc_breadcrumbs->breadcrumb['slug'] : '');
|
55 |
}
|
@@ -59,7 +59,7 @@ function wpsc_breadcrumb_slug() {
|
|
59 |
* @return string - the breadcrumb URL
|
60 |
*/
|
61 |
function wpsc_breadcrumb_url() {
|
62 |
-
global $
|
63 |
|
64 |
if($wpsc_breadcrumbs->breadcrumb['url'] == '') {
|
65 |
return false;
|
@@ -73,13 +73,16 @@ function wpsc_breadcrumb_url() {
|
|
73 |
* @return None - outputs breadcrumb HTML
|
74 |
*/
|
75 |
function wpsc_output_breadcrumbs($options = Array()) {
|
76 |
-
global $wpsc_query;
|
77 |
$products_page_id = wpec_get_the_post_id_by_shortcode('[productspage]');
|
78 |
$products_page = get_post($products_page_id);
|
79 |
if(!wpsc_has_breadcrumbs()){
|
80 |
return;
|
81 |
}
|
82 |
-
|
|
|
|
|
|
|
|
|
83 |
// If home if the same as products apge only show the products-page link and not the home link
|
84 |
if(get_option('page_on_front') != $products_page_id){
|
85 |
echo isset($options['before-breadcrumbs']) ? $options['before-breadcrumbs'] : '<div class="wpsc-breadcrumbs">';
|
@@ -90,7 +93,7 @@ function wpsc_output_breadcrumbs($options = Array()) {
|
|
90 |
echo isset($options['crumb-separator']) ? $options['crumb-separator'] : ' » ';
|
91 |
}
|
92 |
echo isset($options['before-crumb']) ? $options['before-crumb'] : '';
|
93 |
-
echo '<a class="wpsc-crumb" id="wpsc-crumb-'.$products_page_id.'" href="'
|
94 |
echo isset($options['after-crumb']) ? $options['after-crumb'] : '';
|
95 |
|
96 |
|
19 |
* @return boolean - true if we have breadcrumbs to loop through
|
20 |
*/
|
21 |
function wpsc_have_breadcrumbs() {
|
22 |
+
global $wpsc_breadcrumbs;
|
23 |
|
24 |
return $wpsc_breadcrumbs->have_breadcrumbs();
|
25 |
}
|
29 |
* @return nothing - iterate through the breadcrumbs
|
30 |
*/
|
31 |
function wpsc_the_breadcrumb() {
|
32 |
+
global $wpsc_breadcrumbs;
|
33 |
|
34 |
$wpsc_breadcrumbs->the_breadcrumb();
|
35 |
}
|
39 |
* @return string - the breadcrumb name
|
40 |
*/
|
41 |
function wpsc_breadcrumb_name() {
|
42 |
+
global $wpsc_breadcrumbs;
|
43 |
|
44 |
return $wpsc_breadcrumbs->breadcrumb['name'];
|
45 |
}
|
49 |
* @return string - the breadcrumb slug - for use in the CSS ID
|
50 |
*/
|
51 |
function wpsc_breadcrumb_slug() {
|
52 |
+
global $wpsc_breadcrumbs;
|
53 |
|
54 |
return (isset($wpsc_breadcrumbs->breadcrumb['slug']) ? $wpsc_breadcrumbs->breadcrumb['slug'] : '');
|
55 |
}
|
59 |
* @return string - the breadcrumb URL
|
60 |
*/
|
61 |
function wpsc_breadcrumb_url() {
|
62 |
+
global $wpsc_breadcrumbs;
|
63 |
|
64 |
if($wpsc_breadcrumbs->breadcrumb['url'] == '') {
|
65 |
return false;
|
73 |
* @return None - outputs breadcrumb HTML
|
74 |
*/
|
75 |
function wpsc_output_breadcrumbs($options = Array()) {
|
|
|
76 |
$products_page_id = wpec_get_the_post_id_by_shortcode('[productspage]');
|
77 |
$products_page = get_post($products_page_id);
|
78 |
if(!wpsc_has_breadcrumbs()){
|
79 |
return;
|
80 |
}
|
81 |
+
$filtered_products_page = array(
|
82 |
+
'url' => get_option('product_list_url'),
|
83 |
+
'name' => $products_page->post_title
|
84 |
+
);
|
85 |
+
$filtered_products_page = apply_filters('wpsc_change_pp_breadcrumb', $filtered_products_page);
|
86 |
// If home if the same as products apge only show the products-page link and not the home link
|
87 |
if(get_option('page_on_front') != $products_page_id){
|
88 |
echo isset($options['before-breadcrumbs']) ? $options['before-breadcrumbs'] : '<div class="wpsc-breadcrumbs">';
|
93 |
echo isset($options['crumb-separator']) ? $options['crumb-separator'] : ' » ';
|
94 |
}
|
95 |
echo isset($options['before-crumb']) ? $options['before-crumb'] : '';
|
96 |
+
echo '<a class="wpsc-crumb" id="wpsc-crumb-'.$products_page_id.'" href="'.$filtered_products_page['url'].'">'.$filtered_products_page['name'].'</a>';
|
97 |
echo isset($options['after-crumb']) ? $options['after-crumb'] : '';
|
98 |
|
99 |
|
wpsc-includes/cart.class.php
CHANGED
@@ -342,10 +342,10 @@ function wpsc_cart_item_url() {
|
|
342 |
* @param integer height
|
343 |
* @return string url to the to the cart item thumbnail image
|
344 |
*/
|
345 |
-
function wpsc_cart_item_image() {
|
346 |
global $wpsc_cart;
|
347 |
|
348 |
-
$cart_image = wpsc_the_product_thumbnail(
|
349 |
|
350 |
if( is_ssl() && !strstr( $cart_image, 'https' ) ) str_replace( 'http', 'https', $cart_image );
|
351 |
|
@@ -1624,9 +1624,8 @@ class wpsc_cart_item {
|
|
1624 |
|
1625 |
|
1626 |
$priceandstock_id = 0;
|
1627 |
-
$weight = wpsc_convert_weight($product_meta[0]["weight"], 'gram', 'pound');
|
1628 |
|
1629 |
-
$this->weight = $weight;
|
1630 |
// if we are using table rate price
|
1631 |
$levels = $product_meta[0]['table_rate_price'];
|
1632 |
if (isset($levels["quantity"]) && $levels["quantity"] != '') {
|
342 |
* @param integer height
|
343 |
* @return string url to the to the cart item thumbnail image
|
344 |
*/
|
345 |
+
function wpsc_cart_item_image( $width = 31, $height = 31 ) {
|
346 |
global $wpsc_cart;
|
347 |
|
348 |
+
$cart_image = wpsc_the_product_thumbnail( $width, $height, $wpsc_cart->cart_item->product_id, "shopping_cart");
|
349 |
|
350 |
if( is_ssl() && !strstr( $cart_image, 'https' ) ) str_replace( 'http', 'https', $cart_image );
|
351 |
|
1624 |
|
1625 |
|
1626 |
$priceandstock_id = 0;
|
|
|
1627 |
|
1628 |
+
$this->weight = $product_meta[0]["weight"];
|
1629 |
// if we are using table rate price
|
1630 |
$levels = $product_meta[0]['table_rate_price'];
|
1631 |
if (isset($levels["quantity"]) && $levels["quantity"] != '') {
|
wpsc-includes/category.functions.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
*
|
8 |
* @package wp-e-commerce
|
9 |
* @since 3.7
|
10 |
-
*/
|
11 |
|
12 |
/**
|
13 |
* wpsc_list_categories function.
|
@@ -112,12 +112,66 @@ function wpsc_print_category_id() {
|
|
112 |
/**
|
113 |
* wpsc print category classes function
|
114 |
* places classes for the category including selected state
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
*/
|
116 |
-
function
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
|
|
|
|
121 |
}
|
122 |
|
123 |
|
@@ -182,7 +236,6 @@ function wpsc_end_category_query() {
|
|
182 |
*/
|
183 |
function wpsc_display_category_loop($query, $category_html, &$category_branch = null){
|
184 |
static $category_count_data = array(); // the array tree is stored in this
|
185 |
-
global $wpdb, $wpsc_query;
|
186 |
|
187 |
if( isset($query['parent_category_id']) )
|
188 |
$category_id = absint($query['parent_category_id']);
|
@@ -216,14 +269,7 @@ function wpsc_display_category_loop($query, $category_html, &$category_branch =
|
|
216 |
|
217 |
|
218 |
// Creates the list of classes on the category item
|
219 |
-
$category_classes =
|
220 |
-
if(isset($wpsc_query->query_vars['wpsc_product_category'])){
|
221 |
-
$currcat = get_term_by('slug',$wpsc_query->query_vars['wpsc_product_category'], 'wpsc_product_category');
|
222 |
-
if ( $currcat->term_id == $category_row->term_id) {
|
223 |
-
$category_classes .= ' wpsc-current-cat';
|
224 |
-
}
|
225 |
-
|
226 |
-
}
|
227 |
|
228 |
// Set the variables for this category
|
229 |
$category_branch[$category_row->term_id]['children'] = array();
|
@@ -322,7 +368,6 @@ function wpsc_display_category_loop($query, $category_html, &$category_branch =
|
|
322 |
*/
|
323 |
function wpsc_place_category_image($category_id, $query) {
|
324 |
// show the full sized image for the product, if supplied with dimensions, will resize image to those.
|
325 |
-
global $wpsc_query, $wpdb;
|
326 |
$width = (isset($query['image_size']['width'])) ? ($query['image_size']['width']) : get_option('category_image_width');
|
327 |
$height = (isset($query['image_size']['height'])) ? ($query['image_size']['height']) : get_option('category_image_height');
|
328 |
$image_url = "index.php?wpsc_request_image=true&category_id=".$category_id."&width=".$width."&height=".$height;
|
@@ -344,18 +389,17 @@ function wpsc_category_url($category_id, $permalink_compatibility = false) {
|
|
344 |
|
345 |
function wpsc_is_in_category() {
|
346 |
global $wpdb, $wp_query;
|
347 |
-
$
|
348 |
-
if(isset($wp_query->query_vars['
|
349 |
-
$
|
350 |
-
} else if(isset($_GET['
|
351 |
-
$
|
352 |
-
}
|
353 |
-
if($category_id > 0) {
|
354 |
-
return true;
|
355 |
}
|
356 |
-
|
|
|
357 |
}
|
358 |
|
|
|
359 |
/**
|
360 |
* wpsc_category_image function, Gets the category image or returns false
|
361 |
* @param integer category ID, can be 0
|
7 |
*
|
8 |
* @package wp-e-commerce
|
9 |
* @since 3.7
|
10 |
+
*/
|
11 |
|
12 |
/**
|
13 |
* wpsc_list_categories function.
|
112 |
/**
|
113 |
* wpsc print category classes function
|
114 |
* places classes for the category including selected state
|
115 |
+
*
|
116 |
+
* please note that "current category" means the category that we are in now,
|
117 |
+
* and not the category that we are printing for
|
118 |
+
*
|
119 |
+
* @param $category_to_print - the category for which we should print classes
|
120 |
+
* @param $echo - whether to echo the result (true) or return (false)
|
121 |
+
*/
|
122 |
+
function wpsc_print_category_classes($category_to_print = false, $echo = true) {
|
123 |
+
global $wp_query, $wpdb;
|
124 |
+
|
125 |
+
//if we are in wpsc category page then get the current category
|
126 |
+
if(isset($wp_query->query_vars['wpsc_product_category']) || (isset($wp_query->query_vars['taxonomy']) && 'wpsc_product_category' == $wp_query->query_vars['taxonomy']))
|
127 |
+
$curr_cat = get_term_by('slug',$wp_query->query_vars['term'], 'wpsc_product_category');
|
128 |
+
else
|
129 |
+
$curr_cat = false;
|
130 |
+
|
131 |
+
//check if we are in wpsc category page and that we have a term_id of the category to print
|
132 |
+
//this is done here because none of the following matters if we don't have one of those and we can
|
133 |
+
//safely return
|
134 |
+
if(isset($category_to_print['term_id']) && $curr_cat){
|
135 |
+
|
136 |
+
//we will need a list of current category parents for the following if statement
|
137 |
+
$curr_cat_parents = wpsc_get_term_parents($curr_cat->term_id, 'wpsc_product_category');
|
138 |
+
|
139 |
+
//if current category is the same as the one we are printing - then add wpsc-current-cat class
|
140 |
+
if( $category_to_print[term_id] == $curr_cat->term_id )
|
141 |
+
$result = ' wpsc-current-cat ';
|
142 |
+
//else check if the category that we are printing is parent of current category
|
143 |
+
elseif ( in_array($category_to_print[term_id], $curr_cat_parents) )
|
144 |
+
$result = ' wpsc-cat-ancestor ';
|
145 |
+
}
|
146 |
+
if($echo)
|
147 |
+
echo $result;
|
148 |
+
else
|
149 |
+
return $result;
|
150 |
+
}
|
151 |
+
|
152 |
+
|
153 |
+
/**
|
154 |
+
* wpsc_get_term_parents - get all parents of the term
|
155 |
+
*
|
156 |
+
* @param int $id - id of the term
|
157 |
+
* @return array of term objects or empty array if anything went wrong or there were no parrents
|
158 |
*/
|
159 |
+
function wpsc_get_term_parents( $term_id, $taxonomy ) {
|
160 |
+
$term = &get_term( $term_id, $taxonomy );
|
161 |
+
|
162 |
+
if(empty($term->parent))
|
163 |
+
return array();
|
164 |
+
$parent = &get_term( $term->parent, $taxonomy );
|
165 |
+
if ( is_wp_error( $parent ) )
|
166 |
+
return array();
|
167 |
+
|
168 |
+
$parents = array( $parent->term_id );
|
169 |
+
|
170 |
+
if ( $parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $parents ) ) {
|
171 |
+
$parents = array_merge($parents, wpsc_get_term_parents( $parent->term_id, $taxonomy ));
|
172 |
}
|
173 |
+
|
174 |
+
return $parents;
|
175 |
}
|
176 |
|
177 |
|
236 |
*/
|
237 |
function wpsc_display_category_loop($query, $category_html, &$category_branch = null){
|
238 |
static $category_count_data = array(); // the array tree is stored in this
|
|
|
239 |
|
240 |
if( isset($query['parent_category_id']) )
|
241 |
$category_id = absint($query['parent_category_id']);
|
269 |
|
270 |
|
271 |
// Creates the list of classes on the category item
|
272 |
+
$category_classes = wpsc_print_category_classes((array)$category_row, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
// Set the variables for this category
|
275 |
$category_branch[$category_row->term_id]['children'] = array();
|
368 |
*/
|
369 |
function wpsc_place_category_image($category_id, $query) {
|
370 |
// show the full sized image for the product, if supplied with dimensions, will resize image to those.
|
|
|
371 |
$width = (isset($query['image_size']['width'])) ? ($query['image_size']['width']) : get_option('category_image_width');
|
372 |
$height = (isset($query['image_size']['height'])) ? ($query['image_size']['height']) : get_option('category_image_height');
|
373 |
$image_url = "index.php?wpsc_request_image=true&category_id=".$category_id."&width=".$width."&height=".$height;
|
389 |
|
390 |
function wpsc_is_in_category() {
|
391 |
global $wpdb, $wp_query;
|
392 |
+
$is_in_category = false;
|
393 |
+
if(isset($wp_query->query_vars['wpsc_product_category'] ) && !empty($wp_query->query_vars['wpsc_product_category'])) {
|
394 |
+
$is_in_category = true;
|
395 |
+
} else if(isset($_GET['wpsc_product_category']) && !empty($_GET['wpsc_product_category'])) {
|
396 |
+
$is_in_category = true;
|
|
|
|
|
|
|
397 |
}
|
398 |
+
|
399 |
+
return $is_in_category;
|
400 |
}
|
401 |
|
402 |
+
|
403 |
/**
|
404 |
* wpsc_category_image function, Gets the category image or returns false
|
405 |
* @param integer category ID, can be 0
|
wpsc-includes/checkout.class.php
CHANGED
@@ -456,30 +456,30 @@ function wpsc_shipping_region_list( $selected_country, $selected_region, $shippi
|
|
456 |
function wpsc_shipping_country_list( $shippingdetails = false ) {
|
457 |
global $wpdb, $wpsc_shipping_modules;
|
458 |
$js = '';
|
|
|
459 |
if ( !$shippingdetails ) {
|
460 |
$output = "<input type='hidden' name='wpsc_ajax_actions' value='update_location' />";
|
461 |
$js = " onchange='submit_change_country();'";
|
462 |
}
|
463 |
$selected_country = $_SESSION['wpsc_delivery_country'];
|
464 |
$selected_region = $_SESSION['wpsc_delivery_region'];
|
465 |
-
|
|
|
466 |
$selected_country = get_option( 'base_country' );
|
467 |
-
|
468 |
-
if ( $selected_region
|
469 |
$selected_region = get_option( 'base_region' );
|
470 |
-
|
471 |
-
$country_data = $wpdb->get_results( "SELECT * FROM `" . WPSC_TABLE_CURRENCY_LIST . "` ORDER BY `country` ASC", ARRAY_A );
|
|
|
472 |
$output .= "<select name='country' id='current_country' " . $js . " >";
|
473 |
foreach ( $country_data as $country ) {
|
474 |
-
// 23-02-09 fix for custom target market by jeffry
|
475 |
-
// recon this should be taken out and put into a function somewhere maybe,,,
|
476 |
-
if ( $country['visible'] == '1' ) {
|
477 |
$selected = '';
|
478 |
if ( $selected_country == $country['isocode'] ) {
|
479 |
$selected = "selected='selected'";
|
480 |
}
|
481 |
$output .= "<option value='" . $country['isocode'] . "' $selected>" . htmlspecialchars( $country['country'] ) . "</option>";
|
482 |
-
|
483 |
}
|
484 |
|
485 |
$output .= "</select>";
|
@@ -644,7 +644,7 @@ class wpsc_checkout {
|
|
644 |
}
|
645 |
}
|
646 |
}
|
647 |
-
$saved_form_data = @htmlentities( stripslashes( (string)$_SESSION['wpsc_checkout_saved_values'][$this->checkout_item->id] ), ENT_QUOTES );
|
648 |
$an_array = '';
|
649 |
if ( function_exists( 'wpsc_get_ticket_checkout_set' ) ) {
|
650 |
if ( $this->checkout_item->checkout_set == wpsc_get_ticket_checkout_set() )
|
@@ -718,7 +718,7 @@ class wpsc_checkout {
|
|
718 |
$disabled = '';
|
719 |
if(wpsc_disregard_shipping_state_fields())
|
720 |
$disabled = 'disabled = "disabled"';
|
721 |
-
$output = "<input class='shipping_region' title='" . $this->checkout_item->unique_name . "' type='text' id='" . $this->form_element_id() . "'
|
722 |
}
|
723 |
} elseif ( $this->checkout_item->unique_name == 'billingstate' ) {
|
724 |
if ( wpsc_uses_shipping() && wpsc_has_regions($_SESSION['wpsc_selected_country']) ) {
|
@@ -727,7 +727,7 @@ class wpsc_checkout {
|
|
727 |
$disabled = '';
|
728 |
if(wpsc_disregard_billing_state_fields())
|
729 |
$disabled = 'disabled = "disabled"';
|
730 |
-
$output = "<input class='billing_region' title='" . $this->checkout_item->unique_name . "' type='text' id='" . $this->form_element_id() . "'
|
731 |
}
|
732 |
} else {
|
733 |
$output = "<input title='" . $this->checkout_item->unique_name . "' type='text' id='" . $this->form_element_id() . "' class='text' value='" . $saved_form_data . "' name='collected_data[{$this->checkout_item->id}]" . $an_array . "' />";
|
@@ -759,7 +759,7 @@ class wpsc_checkout {
|
|
759 |
|
760 |
$any_bad_inputs = true;
|
761 |
$bad_input = true;
|
762 |
-
$_SESSION['wpsc_gateway_error_messages']['card_number'] = __( 'Please enter a valid', 'wpsc' )
|
763 |
$_SESSION['wpsc_checkout_saved_values']['card_number'] = '';
|
764 |
}
|
765 |
}
|
@@ -769,7 +769,7 @@ class wpsc_checkout {
|
|
769 |
} else {
|
770 |
$any_bad_inputs = true;
|
771 |
$bad_input = true;
|
772 |
-
$_SESSION['wpsc_gateway_error_messages']['expdate'] = __( 'Please enter a valid', 'wpsc' )
|
773 |
$_SESSION['wpsc_checkout_saved_values']['expdate'] = '';
|
774 |
}
|
775 |
}
|
@@ -777,7 +777,7 @@ class wpsc_checkout {
|
|
777 |
if ( empty($_POST['card_code']) || (!is_numeric( $_POST['card_code'] )) ) {
|
778 |
$any_bad_inputs = true;
|
779 |
$bad_input = true;
|
780 |
-
$_SESSION['wpsc_gateway_error_messages']['card_code'] = __( 'Please enter a valid', 'wpsc' )
|
781 |
$_SESSION['wpsc_checkout_saved_values']['card_code'] = '';
|
782 |
} else {
|
783 |
$_SESSION['wpsc_gateway_error_messages']['card_code'] = '';
|
@@ -787,7 +787,7 @@ class wpsc_checkout {
|
|
787 |
if ( $_POST['cctype'] == '' ) {
|
788 |
$any_bad_inputs = true;
|
789 |
$bad_input = true;
|
790 |
-
$_SESSION['wpsc_gateway_error_messages']['cctype'] = __( 'Please enter a valid', 'wpsc' )
|
791 |
$_SESSION['wpsc_checkout_saved_values']['cctype'] = '';
|
792 |
} else {
|
793 |
$_SESSION['wpsc_gateway_error_messages']['cctype'] = '';
|
@@ -851,7 +851,7 @@ class wpsc_checkout {
|
|
851 |
break;
|
852 |
}
|
853 |
if ( $bad_input === true ) {
|
854 |
-
$_SESSION['wpsc_checkout_error_messages'][$form_data->id] = __( 'Please enter a valid', 'wpsc' )
|
855 |
$_SESSION['wpsc_checkout_saved_values'][$form_data->id] = '';
|
856 |
}
|
857 |
}
|
456 |
function wpsc_shipping_country_list( $shippingdetails = false ) {
|
457 |
global $wpdb, $wpsc_shipping_modules;
|
458 |
$js = '';
|
459 |
+
$output = '';
|
460 |
if ( !$shippingdetails ) {
|
461 |
$output = "<input type='hidden' name='wpsc_ajax_actions' value='update_location' />";
|
462 |
$js = " onchange='submit_change_country();'";
|
463 |
}
|
464 |
$selected_country = $_SESSION['wpsc_delivery_country'];
|
465 |
$selected_region = $_SESSION['wpsc_delivery_region'];
|
466 |
+
|
467 |
+
if ( empty( $selected_country ) )
|
468 |
$selected_country = get_option( 'base_country' );
|
469 |
+
|
470 |
+
if ( empty( $selected_region ) )
|
471 |
$selected_region = get_option( 'base_region' );
|
472 |
+
|
473 |
+
$country_data = $wpdb->get_results( "SELECT * FROM `" . WPSC_TABLE_CURRENCY_LIST . "` WHERE `visible`= '1' ORDER BY `country` ASC", ARRAY_A );
|
474 |
+
|
475 |
$output .= "<select name='country' id='current_country' " . $js . " >";
|
476 |
foreach ( $country_data as $country ) {
|
|
|
|
|
|
|
477 |
$selected = '';
|
478 |
if ( $selected_country == $country['isocode'] ) {
|
479 |
$selected = "selected='selected'";
|
480 |
}
|
481 |
$output .= "<option value='" . $country['isocode'] . "' $selected>" . htmlspecialchars( $country['country'] ) . "</option>";
|
482 |
+
|
483 |
}
|
484 |
|
485 |
$output .= "</select>";
|
644 |
}
|
645 |
}
|
646 |
}
|
647 |
+
$saved_form_data = @htmlentities( stripslashes( (string)$_SESSION['wpsc_checkout_saved_values'][$this->checkout_item->id] ), ENT_QUOTES, 'UTF-8' );
|
648 |
$an_array = '';
|
649 |
if ( function_exists( 'wpsc_get_ticket_checkout_set' ) ) {
|
650 |
if ( $this->checkout_item->checkout_set == wpsc_get_ticket_checkout_set() )
|
718 |
$disabled = '';
|
719 |
if(wpsc_disregard_shipping_state_fields())
|
720 |
$disabled = 'disabled = "disabled"';
|
721 |
+
$output = "<input class='shipping_region text' title='" . $this->checkout_item->unique_name . "' type='text' id='" . $this->form_element_id() . "' value='" . $saved_form_data . "' name='collected_data[{$this->checkout_item->id}]" . $an_array . "' ".$disabled." />";
|
722 |
}
|
723 |
} elseif ( $this->checkout_item->unique_name == 'billingstate' ) {
|
724 |
if ( wpsc_uses_shipping() && wpsc_has_regions($_SESSION['wpsc_selected_country']) ) {
|
727 |
$disabled = '';
|
728 |
if(wpsc_disregard_billing_state_fields())
|
729 |
$disabled = 'disabled = "disabled"';
|
730 |
+
$output = "<input class='billing_region text' title='" . $this->checkout_item->unique_name . "' type='text' id='" . $this->form_element_id() . "' value='" . $saved_form_data . "' name='collected_data[{$this->checkout_item->id}]" . $an_array . "' ".$disabled." />";
|
731 |
}
|
732 |
} else {
|
733 |
$output = "<input title='" . $this->checkout_item->unique_name . "' type='text' id='" . $this->form_element_id() . "' class='text' value='" . $saved_form_data . "' name='collected_data[{$this->checkout_item->id}]" . $an_array . "' />";
|
759 |
|
760 |
$any_bad_inputs = true;
|
761 |
$bad_input = true;
|
762 |
+
$_SESSION['wpsc_gateway_error_messages']['card_number'] = __( 'Please enter a valid card number.', 'wpsc' );
|
763 |
$_SESSION['wpsc_checkout_saved_values']['card_number'] = '';
|
764 |
}
|
765 |
}
|
769 |
} else {
|
770 |
$any_bad_inputs = true;
|
771 |
$bad_input = true;
|
772 |
+
$_SESSION['wpsc_gateway_error_messages']['expdate'] = __( 'Please enter a valid expiry date.', 'wpsc' );
|
773 |
$_SESSION['wpsc_checkout_saved_values']['expdate'] = '';
|
774 |
}
|
775 |
}
|
777 |
if ( empty($_POST['card_code']) || (!is_numeric( $_POST['card_code'] )) ) {
|
778 |
$any_bad_inputs = true;
|
779 |
$bad_input = true;
|
780 |
+
$_SESSION['wpsc_gateway_error_messages']['card_code'] = __( 'Please enter a valid CVV.', 'wpsc' );
|
781 |
$_SESSION['wpsc_checkout_saved_values']['card_code'] = '';
|
782 |
} else {
|
783 |
$_SESSION['wpsc_gateway_error_messages']['card_code'] = '';
|
787 |
if ( $_POST['cctype'] == '' ) {
|
788 |
$any_bad_inputs = true;
|
789 |
$bad_input = true;
|
790 |
+
$_SESSION['wpsc_gateway_error_messages']['cctype'] = __( 'Please enter a valid CVV.', 'wpsc' );
|
791 |
$_SESSION['wpsc_checkout_saved_values']['cctype'] = '';
|
792 |
} else {
|
793 |
$_SESSION['wpsc_gateway_error_messages']['cctype'] = '';
|
851 |
break;
|
852 |
}
|
853 |
if ( $bad_input === true ) {
|
854 |
+
$_SESSION['wpsc_checkout_error_messages'][$form_data->id] = sprintf(__( 'Please enter a valid %s.', 'wpsc' ), strtolower( $form_data->name ));
|
855 |
$_SESSION['wpsc_checkout_saved_values'][$form_data->id] = '';
|
856 |
}
|
857 |
}
|
wpsc-includes/display.functions.php
CHANGED
@@ -15,7 +15,6 @@
|
|
15 |
* @return string - html displaying one or more products
|
16 |
*/
|
17 |
function wpsc_buy_now_button( $product_id, $replaced_shortcode = false ) {
|
18 |
-
global $wpdb, $wpsc_query, $wpsc_cart, $wp_query;
|
19 |
$product = get_post( $product_id );
|
20 |
$supported_gateways = array('wpsc_merchant_paypal_standard','paypal_multiple');
|
21 |
$selected_gateways = get_option( 'custom_gateway_options' );
|
@@ -118,6 +117,14 @@ function wpsc_also_bought( $product_id ) {
|
|
118 |
return $output;
|
119 |
}
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
function fancy_notifications() {
|
122 |
global $wpdb;
|
123 |
$output = "";
|
@@ -125,7 +132,7 @@ function fancy_notifications() {
|
|
125 |
$output = "";
|
126 |
$output .= "<div id='fancy_notification'>\n\r";
|
127 |
$output .= " <div id='loading_animation'>\n\r";
|
128 |
-
$output .= '<img id="fancy_notificationimage" title="Loading" alt="Loading" src="' .
|
129 |
$output .= " </div>\n\r";
|
130 |
$output .= " <div id='fancy_notification_content'>\n\r";
|
131 |
$output .= " </div>\n\r";
|
@@ -325,8 +332,8 @@ function wpsc_obtain_the_title() {
|
|
325 |
$wp_query->query_vars['wpsc_product_category'] = 0;
|
326 |
|
327 |
|
328 |
-
if ( isset( $wp_query->query_vars['taxonomy'] ) && 'wpsc_product_category' == $wp_query->query_vars['taxonomy'])
|
329 |
-
$category_id = wpsc_get_the_category_id($wp_query->query_vars['
|
330 |
|
331 |
if ( $category_id > 0 ) {
|
332 |
|
@@ -419,8 +426,8 @@ function wpsc_replace_bloginfo_title( $input, $show ) {
|
|
419 |
return $input;
|
420 |
}
|
421 |
|
422 |
-
if ( get_option( 'wpsc_replace_page_title' ) == 1 ) {
|
423 |
|
424 |
add_filter( 'wp_title', 'wpsc_replace_wp_title', 10, 2 );
|
425 |
-
}
|
426 |
-
?>
|
15 |
* @return string - html displaying one or more products
|
16 |
*/
|
17 |
function wpsc_buy_now_button( $product_id, $replaced_shortcode = false ) {
|
|
|
18 |
$product = get_post( $product_id );
|
19 |
$supported_gateways = array('wpsc_merchant_paypal_standard','paypal_multiple');
|
20 |
$selected_gateways = get_option( 'custom_gateway_options' );
|
117 |
return $output;
|
118 |
}
|
119 |
|
120 |
+
/**
|
121 |
+
* Get the URL of the loading animation image.
|
122 |
+
* Can be filtered using the wpsc_loading_animation_url filter.
|
123 |
+
*/
|
124 |
+
function wpsc_loading_animation_url() {
|
125 |
+
return apply_filters( 'wpsc_loading_animation_url', WPSC_CORE_THEME_URL . 'wpsc-images/indicator.gif' );
|
126 |
+
}
|
127 |
+
|
128 |
function fancy_notifications() {
|
129 |
global $wpdb;
|
130 |
$output = "";
|
132 |
$output = "";
|
133 |
$output .= "<div id='fancy_notification'>\n\r";
|
134 |
$output .= " <div id='loading_animation'>\n\r";
|
135 |
+
$output .= '<img id="fancy_notificationimage" title="Loading" alt="Loading" src="' . wpsc_loading_animation_url() . '" />' . __( 'Updating', 'wpsc' ) . "...\n\r";
|
136 |
$output .= " </div>\n\r";
|
137 |
$output .= " <div id='fancy_notification_content'>\n\r";
|
138 |
$output .= " </div>\n\r";
|
332 |
$wp_query->query_vars['wpsc_product_category'] = 0;
|
333 |
|
334 |
|
335 |
+
if ( isset( $wp_query->query_vars['taxonomy'] ) && 'wpsc_product_category' == $wp_query->query_vars['taxonomy'] || isset($wp_query->query_vars['wpsc_product_category']))
|
336 |
+
$category_id = wpsc_get_the_category_id($wp_query->query_vars['wpsc_product_category'],'slug');
|
337 |
|
338 |
if ( $category_id > 0 ) {
|
339 |
|
426 |
return $input;
|
427 |
}
|
428 |
|
429 |
+
//if ( get_option( 'wpsc_replace_page_title' ) == 1 ) {
|
430 |
|
431 |
add_filter( 'wp_title', 'wpsc_replace_wp_title', 10, 2 );
|
432 |
+
//}
|
433 |
+
?>
|
wpsc-includes/processing.functions.php
CHANGED
@@ -51,6 +51,7 @@ function wpsc_currency_display( $price_in, $args = null ) {
|
|
51 |
$currency_code = $wpsc_currency_data['code'];
|
52 |
|
53 |
// Figure out the currency sign
|
|
|
54 |
if ( $query['display_currency_symbol'] ) {
|
55 |
if ( !empty( $wpsc_currency_data['symbol'] ) ) {
|
56 |
if ( $query['display_as_html'] ) {
|
@@ -119,7 +120,7 @@ function wpsc_decrement_claimed_stock($purchase_log_id) {
|
|
119 |
|
120 |
$remaining_stock = $wpdb->get_row($sql_query, ARRAY_A);
|
121 |
if($remaining_stock == 0 && get_product_meta($product_id,'unpublish_oos',true) == 1){
|
122 |
-
wp_mail(get_option('admin_email'),
|
123 |
$wpdb->query("UPDATE `".$wpdb->posts."` SET `post_status` = 'draft' WHERE `ID` = '{$product_id}'");
|
124 |
}
|
125 |
}
|
@@ -197,7 +198,7 @@ function wpsc_convert_weights($weight, $unit) {
|
|
197 |
return $weight;
|
198 |
}
|
199 |
|
200 |
-
function wpsc_convert_weight($in_weight, $in_unit, $out_unit = '
|
201 |
if (isset($weight) && is_array($weight)) {
|
202 |
$weight = $weight['weight'];
|
203 |
}
|
51 |
$currency_code = $wpsc_currency_data['code'];
|
52 |
|
53 |
// Figure out the currency sign
|
54 |
+
$currency_sign = '';
|
55 |
if ( $query['display_currency_symbol'] ) {
|
56 |
if ( !empty( $wpsc_currency_data['symbol'] ) ) {
|
57 |
if ( $query['display_as_html'] ) {
|
120 |
|
121 |
$remaining_stock = $wpdb->get_row($sql_query, ARRAY_A);
|
122 |
if($remaining_stock == 0 && get_product_meta($product_id,'unpublish_oos',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 |
}
|
126 |
}
|
198 |
return $weight;
|
199 |
}
|
200 |
|
201 |
+
function wpsc_convert_weight($in_weight, $in_unit, $out_unit = 'pound') {
|
202 |
if (isset($weight) && is_array($weight)) {
|
203 |
$weight = $weight['weight'];
|
204 |
}
|
wpsc-includes/product-template.php
CHANGED
@@ -15,6 +15,8 @@ function wpsc_has_pages_top(){
|
|
15 |
else
|
16 |
return false;
|
17 |
}
|
|
|
|
|
18 |
function wpsc_has_pages_bottom(){
|
19 |
if(wpsc_has_pages() && ((get_option('wpsc_page_number_position') == 2) || (get_option('wpsc_page_number_position') == 3)))
|
20 |
return true;
|
@@ -86,10 +88,7 @@ function wpsc_pagination($totalpages = '', $per_page = '', $current_page = '', $
|
|
86 |
//end of additional links
|
87 |
|
88 |
if(empty($totalpages)){
|
89 |
-
|
90 |
-
$totalpages = $wp_query->max_num_pages;
|
91 |
-
else
|
92 |
-
$totalpages = $wpsc_query->max_num_pages;
|
93 |
}
|
94 |
if(empty($per_page))
|
95 |
$per_page = get_option('wpsc_products_per_page');
|
@@ -115,8 +114,8 @@ function wpsc_pagination($totalpages = '', $per_page = '', $current_page = '', $
|
|
115 |
$separator = '=';
|
116 |
}else{
|
117 |
// This will need changing when we get product categories sorted
|
118 |
-
if(isset($wpsc_query->query_vars['
|
119 |
-
$page_link = trailingslashit(get_option('product_list_url')).$wpsc_query->query_vars['
|
120 |
else
|
121 |
$page_link = trailingslashit(get_option('product_list_url'));
|
122 |
|
@@ -143,7 +142,10 @@ function wpsc_pagination($totalpages = '', $per_page = '', $current_page = '', $
|
|
143 |
if($i <= 0) $i =1;
|
144 |
while($i < $current_page){
|
145 |
if($count <= $num_paged_links){
|
146 |
-
$
|
|
|
|
|
|
|
147 |
}
|
148 |
$i++;
|
149 |
$count++;
|
@@ -155,10 +157,12 @@ function wpsc_pagination($totalpages = '', $per_page = '', $current_page = '', $
|
|
155 |
//Links after Current Page
|
156 |
$i = $current_page + $num_paged_links;
|
157 |
$count = 1;
|
|
|
158 |
if($current_page < $totalpages){
|
159 |
while(($i) > $current_page){
|
|
|
160 |
if($count < $num_paged_links && ($count+$current_page) <= $totalpages){
|
161 |
-
|
162 |
$i++;
|
163 |
}else{
|
164 |
break;
|
@@ -799,7 +803,7 @@ function wpsc_product_has_stock( $id = null ) {
|
|
799 |
$variations = get_children( array( "post_type" => "wpsc-product", "post_parent" => $id ) );
|
800 |
|
801 |
if ( is_numeric( $stock ) ) {
|
802 |
-
if ( $stock > 0 && $variations
|
803 |
$claimed_stock = $wpdb->get_var("SELECT SUM(`stock_claimed`) FROM `".WPSC_TABLE_CLAIMED_STOCK."` WHERE `product_id` IN($id)");
|
804 |
if($stock - $claimed_stock > 0)
|
805 |
return true;
|
@@ -889,9 +893,9 @@ function wpsc_product_is_donation( $id = null ) {
|
|
889 |
function wpsc_product_on_special() {
|
890 |
global $wpsc_query;
|
891 |
|
892 |
-
$price =
|
893 |
-
$special_price =
|
894 |
-
if ( ($special_price > 0) && (($price - $special_price)
|
895 |
return true;
|
896 |
else
|
897 |
return false;
|
@@ -1496,36 +1500,6 @@ function wpsc_has_pages() {
|
|
1496 |
|
1497 |
}
|
1498 |
|
1499 |
-
/**
|
1500 |
-
* wpsc have pages function
|
1501 |
-
* @return boolean - true while we have pages to loop through
|
1502 |
-
*/
|
1503 |
-
function wpsc_have_pages() {
|
1504 |
-
_deprecated_function( __FUNCTION__, '3.8', 'the updated ' . __FUNCTION__ . '' );
|
1505 |
-
global $wpsc_query;
|
1506 |
-
return $wpsc_query->have_pages();
|
1507 |
-
}
|
1508 |
-
|
1509 |
-
/**
|
1510 |
-
* wpsc the page function
|
1511 |
-
* @return nothing - iterate through the pages
|
1512 |
-
*/
|
1513 |
-
function wpsc_the_page() {
|
1514 |
-
_deprecated_function( __FUNCTION__, '3.8', 'the updated ' . __FUNCTION__ . '' );
|
1515 |
-
global $wpsc_query;
|
1516 |
-
$wpsc_query->the_page();
|
1517 |
-
}
|
1518 |
-
|
1519 |
-
/**
|
1520 |
-
* wpsc page number function
|
1521 |
-
* @return integer - the page number
|
1522 |
-
*/
|
1523 |
-
function wpsc_page_number() {
|
1524 |
-
_deprecated_function( __FUNCTION__, '3.8', 'the updated ' . __FUNCTION__ . '' );
|
1525 |
-
global $wpsc_query;
|
1526 |
-
return $wpsc_query->page['number'];
|
1527 |
-
}
|
1528 |
-
|
1529 |
/**
|
1530 |
* this is for the multi adding property, it checks to see whether multi adding is enabled;
|
1531 |
*
|
@@ -1722,7 +1696,9 @@ function wpsc_you_save($args = null){
|
|
1722 |
else
|
1723 |
$regular_price = get_product_meta($product_id, 'price', true);
|
1724 |
//if actual price is zero, false, or something similar, or is less than sale price - return false
|
1725 |
-
|
|
|
|
|
1726 |
return 0;
|
1727 |
|
1728 |
switch($type){
|
15 |
else
|
16 |
return false;
|
17 |
}
|
18 |
+
|
19 |
+
|
20 |
function wpsc_has_pages_bottom(){
|
21 |
if(wpsc_has_pages() && ((get_option('wpsc_page_number_position') == 2) || (get_option('wpsc_page_number_position') == 3)))
|
22 |
return true;
|
88 |
//end of additional links
|
89 |
|
90 |
if(empty($totalpages)){
|
91 |
+
$totalpages = $wp_query->max_num_pages;
|
|
|
|
|
|
|
92 |
}
|
93 |
if(empty($per_page))
|
94 |
$per_page = get_option('wpsc_products_per_page');
|
114 |
$separator = '=';
|
115 |
}else{
|
116 |
// This will need changing when we get product categories sorted
|
117 |
+
if(isset($wpsc_query->query_vars['wpsc_product_category']))
|
118 |
+
$page_link = trailingslashit(get_option('product_list_url')).$wpsc_query->query_vars['wpsc_product_category'].'/';
|
119 |
else
|
120 |
$page_link = trailingslashit(get_option('product_list_url'));
|
121 |
|
142 |
if($i <= 0) $i =1;
|
143 |
while($i < $current_page){
|
144 |
if($count <= $num_paged_links){
|
145 |
+
if($count == 1)
|
146 |
+
$output .= " <a href=\"". $page_link . $additional_links . "\" title=\"" . sprintf( __('Page %s', 'wpsc'), $i ) . " \">".$i."</a>";
|
147 |
+
else
|
148 |
+
$output .= " <a href=\"". $page_link .$separator. $i . $additional_links . "\" title=\"" . sprintf( __('Page %s', 'wpsc'), $i ) . " \">".$i."</a>";
|
149 |
}
|
150 |
$i++;
|
151 |
$count++;
|
157 |
//Links after Current Page
|
158 |
$i = $current_page + $num_paged_links;
|
159 |
$count = 1;
|
160 |
+
|
161 |
if($current_page < $totalpages){
|
162 |
while(($i) > $current_page){
|
163 |
+
|
164 |
if($count < $num_paged_links && ($count+$current_page) <= $totalpages){
|
165 |
+
$output .= " <a href=\"". $page_link .$separator. ($count+$current_page) .$additional_links . "\" title=\"" . sprintf( __('Page %s', 'wpsc'), ($count+$current_page) ) . "\">".($count+$current_page)."</a>";
|
166 |
$i++;
|
167 |
}else{
|
168 |
break;
|
803 |
$variations = get_children( array( "post_type" => "wpsc-product", "post_parent" => $id ) );
|
804 |
|
805 |
if ( is_numeric( $stock ) ) {
|
806 |
+
if ( $stock > 0 && empty($variations)) {
|
807 |
$claimed_stock = $wpdb->get_var("SELECT SUM(`stock_claimed`) FROM `".WPSC_TABLE_CLAIMED_STOCK."` WHERE `product_id` IN($id)");
|
808 |
if($stock - $claimed_stock > 0)
|
809 |
return true;
|
893 |
function wpsc_product_on_special() {
|
894 |
global $wpsc_query;
|
895 |
|
896 |
+
$price = get_product_meta( get_the_ID(), 'price', true );
|
897 |
+
$special_price = get_product_meta( get_the_ID(), 'special_price', true );
|
898 |
+
if ( ($special_price > 0) && (($price - $special_price) > 0) )
|
899 |
return true;
|
900 |
else
|
901 |
return false;
|
1500 |
|
1501 |
}
|
1502 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1503 |
/**
|
1504 |
* this is for the multi adding property, it checks to see whether multi adding is enabled;
|
1505 |
*
|
1696 |
else
|
1697 |
$regular_price = get_product_meta($product_id, 'price', true);
|
1698 |
//if actual price is zero, false, or something similar, or is less than sale price - return false
|
1699 |
+
|
1700 |
+
|
1701 |
+
if( !$regular_price || !( $sale_price < $regular_price) )
|
1702 |
return 0;
|
1703 |
|
1704 |
switch($type){
|
wpsc-includes/purchaselogs.class.php
CHANGED
@@ -448,12 +448,12 @@ function wpsc_display_purchlog_totalprice() {
|
|
448 |
|
449 |
function wpsc_display_purchlog_buyers_name() {
|
450 |
global $purchlogitem;
|
451 |
-
return htmlentities( stripslashes( $purchlogitem->userinfo['billingfirstname']['value'] ), ENT_QUOTES ) . ' ' . htmlentities( stripslashes( $purchlogitem->userinfo['billinglastname']['value'] ), ENT_QUOTES );
|
452 |
}
|
453 |
|
454 |
function wpsc_display_purchlog_buyers_email() {
|
455 |
global $purchlogitem;
|
456 |
-
return htmlentities( stripslashes( $purchlogitem->userinfo['billingemail']['value'] ), ENT_QUOTES );
|
457 |
}
|
458 |
|
459 |
function wpsc_display_purchlog_buyers_address() {
|
@@ -464,27 +464,27 @@ function wpsc_display_purchlog_buyers_address() {
|
|
464 |
else
|
465 |
$state = $purchlogitem->userinfo['billingstate']['value'];
|
466 |
|
467 |
-
return nl2br(trim(htmlentities( stripslashes( $purchlogitem->userinfo['billingaddress']['value'] ), ENT_QUOTES ), "\n\r")).'<br />'.htmlentities( stripslashes( $state ), ENT_QUOTES ) .', '.htmlentities( stripslashes( $purchlogitem->userinfo['billingpostcode']['value'] ), ENT_QUOTES ).'<br />'.htmlentities( stripslashes( $purchlogitem->extrainfo->billing_country ), ENT_QUOTES );
|
468 |
}
|
469 |
|
470 |
function wpsc_display_purchlog_buyers_phone() {
|
471 |
global $purchlogitem;
|
472 |
-
return htmlentities( stripslashes( $purchlogitem->userinfo['billingphone']['value'] ), ENT_QUOTES );
|
473 |
}
|
474 |
|
475 |
function wpsc_display_purchlog_shipping_name() {
|
476 |
global $purchlogitem;
|
477 |
-
return htmlentities( stripslashes( $purchlogitem->shippinginfo['shippingfirstname']['value'] ), ENT_QUOTES ) . ' ' . htmlentities( stripslashes( $purchlogitem->shippinginfo['shippinglastname']['value'] ), ENT_QUOTES );
|
478 |
}
|
479 |
|
480 |
function wpsc_display_purchlog_shipping_address() {
|
481 |
global $purchlogitem;
|
482 |
-
return nl2br(trim(htmlentities( stripslashes( $purchlogitem->shippinginfo['shippingaddress']['value'] ), ENT_QUOTES ), "\n\r"));
|
483 |
}
|
484 |
|
485 |
function wpsc_display_purchlog_shipping_city() {
|
486 |
global $purchlogitem;
|
487 |
-
return htmlentities( stripslashes( $purchlogitem->shippinginfo['shippingcity']['value'] ), ENT_QUOTES );
|
488 |
}
|
489 |
|
490 |
function wpsc_display_purchlog_shipping_state_and_postcode() {
|
@@ -502,7 +502,7 @@ function wpsc_display_purchlog_shipping_state_and_postcode() {
|
|
502 |
|
503 |
function wpsc_display_purchlog_shipping_country() {
|
504 |
global $purchlogitem;
|
505 |
-
return htmlentities( stripslashes( $purchlogitem->shippinginfo['shippingcountry']['value'] ), ENT_QUOTES );
|
506 |
}
|
507 |
|
508 |
function wpsc_display_purchlog_shipping_method() {
|
@@ -616,8 +616,12 @@ class wpsc_purchaselogs {
|
|
616 |
if ( isset( $_SESSION['newlogs'] ) ) {
|
617 |
$purchaselogs = $_SESSION['newlogs'];
|
618 |
} else {
|
619 |
-
|
620 |
-
|
|
|
|
|
|
|
|
|
621 |
}
|
622 |
|
623 |
$this->allpurchaselogs = $purchaselogs;
|
448 |
|
449 |
function wpsc_display_purchlog_buyers_name() {
|
450 |
global $purchlogitem;
|
451 |
+
return htmlentities( stripslashes( $purchlogitem->userinfo['billingfirstname']['value'] ), ENT_QUOTES, 'UTF-8') . ' ' . htmlentities( stripslashes( $purchlogitem->userinfo['billinglastname']['value'] ), ENT_QUOTES, 'UTF-8');
|
452 |
}
|
453 |
|
454 |
function wpsc_display_purchlog_buyers_email() {
|
455 |
global $purchlogitem;
|
456 |
+
return htmlentities( stripslashes( $purchlogitem->userinfo['billingemail']['value'] ), ENT_QUOTES, 'UTF-8');
|
457 |
}
|
458 |
|
459 |
function wpsc_display_purchlog_buyers_address() {
|
464 |
else
|
465 |
$state = $purchlogitem->userinfo['billingstate']['value'];
|
466 |
|
467 |
+
return nl2br(trim(htmlentities( stripslashes( $purchlogitem->userinfo['billingaddress']['value'] ), ENT_QUOTES, 'UTF-8'), "\n\r")).'<br />'.htmlentities( stripslashes( $state ), ENT_QUOTES, 'UTF-8') .', '.htmlentities( stripslashes( $purchlogitem->userinfo['billingpostcode']['value'] ), ENT_QUOTES, 'UTF-8').'<br />'.htmlentities( stripslashes( $purchlogitem->extrainfo->billing_country ), ENT_QUOTES, 'UTF-8');
|
468 |
}
|
469 |
|
470 |
function wpsc_display_purchlog_buyers_phone() {
|
471 |
global $purchlogitem;
|
472 |
+
return htmlentities( stripslashes( $purchlogitem->userinfo['billingphone']['value'] ), ENT_QUOTES, 'UTF-8');
|
473 |
}
|
474 |
|
475 |
function wpsc_display_purchlog_shipping_name() {
|
476 |
global $purchlogitem;
|
477 |
+
return htmlentities( stripslashes( $purchlogitem->shippinginfo['shippingfirstname']['value'] ), ENT_QUOTES, 'UTF-8') . ' ' . htmlentities( stripslashes( $purchlogitem->shippinginfo['shippinglastname']['value'] ), ENT_QUOTES, 'UTF-8');
|
478 |
}
|
479 |
|
480 |
function wpsc_display_purchlog_shipping_address() {
|
481 |
global $purchlogitem;
|
482 |
+
return nl2br(trim(htmlentities( stripslashes( $purchlogitem->shippinginfo['shippingaddress']['value'] ), ENT_QUOTES, 'UTF-8'), "\n\r"));
|
483 |
}
|
484 |
|
485 |
function wpsc_display_purchlog_shipping_city() {
|
486 |
global $purchlogitem;
|
487 |
+
return htmlentities( stripslashes( $purchlogitem->shippinginfo['shippingcity']['value'] ), ENT_QUOTES, 'UTF-8' );
|
488 |
}
|
489 |
|
490 |
function wpsc_display_purchlog_shipping_state_and_postcode() {
|
502 |
|
503 |
function wpsc_display_purchlog_shipping_country() {
|
504 |
global $purchlogitem;
|
505 |
+
return htmlentities( stripslashes( $purchlogitem->shippinginfo['shippingcountry']['value'] ), ENT_QUOTES, 'UTF-8' );
|
506 |
}
|
507 |
|
508 |
function wpsc_display_purchlog_shipping_method() {
|
616 |
if ( isset( $_SESSION['newlogs'] ) ) {
|
617 |
$purchaselogs = $_SESSION['newlogs'];
|
618 |
} else {
|
619 |
+
$dates = array_slice( $dates, 0, 3 );
|
620 |
+
$this->current_start_timestamp = $dates[2]['start'];
|
621 |
+
$this->current_end_timestamp = $dates[0]['end'];
|
622 |
+
$newlogs = $this->get_purchlogs( $dates, $status );
|
623 |
+
$_SESSION['newlogs'] = $newlogs;
|
624 |
+
$this->allpurchaselogs = $newlogs;
|
625 |
}
|
626 |
|
627 |
$this->allpurchaselogs = $purchaselogs;
|
wpsc-includes/shopping_cart_functions.php
CHANGED
@@ -128,7 +128,7 @@ function wpsc_country_region_list( $form_id = null, $ajax = false, $selected_cou
|
|
128 |
if ( $selected_country == $country['isocode'] ) {
|
129 |
$selected = "selected='selected'";
|
130 |
}
|
131 |
-
$output .= "<option value='" . $country['isocode'] . "' $selected>" . htmlentities( $country['country'] ) . "</option>\n\r";
|
132 |
}
|
133 |
}
|
134 |
|
@@ -158,7 +158,7 @@ function wpsc_country_region_list( $form_id = null, $ajax = false, $selected_cou
|
|
158 |
} else {
|
159 |
$selected = "";
|
160 |
}
|
161 |
-
$output .= "<option value='" . $region['id'] . "' $selected>" . htmlentities( $region['name'] ) . "</option>\n\r";
|
162 |
}
|
163 |
$output .= "</select>\n\r";
|
164 |
}
|
128 |
if ( $selected_country == $country['isocode'] ) {
|
129 |
$selected = "selected='selected'";
|
130 |
}
|
131 |
+
$output .= "<option value='" . $country['isocode'] . "' $selected>" . htmlentities( $country['country'], ENT_QUOTES, 'UTF-8' ) . "</option>\n\r";
|
132 |
}
|
133 |
}
|
134 |
|
158 |
} else {
|
159 |
$selected = "";
|
160 |
}
|
161 |
+
$output .= "<option value='" . $region['id'] . "' $selected>" . htmlentities( $region['name'], ENT_QUOTES, 'UTF-8' ) . "</option>\n\r";
|
162 |
}
|
163 |
$output .= "</select>\n\r";
|
164 |
}
|
wpsc-includes/theme.functions.php
CHANGED
@@ -53,7 +53,8 @@ function wpsc_register_core_theme_files() {
|
|
53 |
wpsc_register_theme_file( 'wpsc-user_log.php' );
|
54 |
wpsc_register_theme_file( 'wpsc-cart_widget.php' );
|
55 |
wpsc_register_theme_file( 'wpsc-featured_product.php' );
|
56 |
-
|
|
|
57 |
// Let other plugins register their theme files
|
58 |
do_action( 'wpsc_register_core_theme_files' );
|
59 |
}
|
@@ -402,13 +403,13 @@ function wpsc_single_template( $content ) {
|
|
402 |
|
403 |
global $wpdb, $post, $wp_query, $wpsc_query;
|
404 |
|
405 |
-
|
406 |
$single_theme_path = wpsc_get_template_file_path( 'wpsc-single_product.php' );
|
407 |
if((!isset($wp_query->is_product)) && !isset($wp_query->query_vars['wpsc_product_category']))return $content;
|
408 |
-
if(isset($wpsc_query->query['paged']) && $wpsc_query->post_count <= 1){
|
|
|
|
|
409 |
list($wp_query, $wpsc_query) = array( $wpsc_query, $wp_query ); // swap the wpsc_query object
|
410 |
$GLOBALS['nzshpcrt_activateshpcrt'] = true;
|
411 |
-
|
412 |
// get the display type for the productspage
|
413 |
$display_type = get_option('product_view');
|
414 |
if ( isset( $_SESSION['wpsc_display_type'] ) ) {
|
@@ -429,6 +430,7 @@ function wpsc_single_template( $content ) {
|
|
429 |
list($wp_query, $wpsc_query) = array( $wpsc_query, $wp_query ); // swap the wpsc_query objects back
|
430 |
if ( ($is_single == false) || ($product_meta['enable_comments'] == '0') )
|
431 |
$GLOBALS['post'] = $wp_query->post;
|
|
|
432 |
return $output;
|
433 |
}
|
434 |
if ( 'wpsc-product' == $wp_query->post->post_type && !is_archive() && $wp_query->post_count <= 1 ) {
|
@@ -440,7 +442,8 @@ function wpsc_single_template( $content ) {
|
|
440 |
$content = ob_get_contents();
|
441 |
ob_end_clean();
|
442 |
list( $wp_query, $wpsc_temp_query ) = array( $wpsc_temp_query, $wp_query ); // swap the wpsc_query objects back
|
443 |
-
|
|
|
444 |
remove_filter( "the_content", "wpsc_single_template" );
|
445 |
list( $wp_query, $wpsc_query ) = array( $wpsc_query, $wp_query ); // swap the wpsc_query object
|
446 |
if(isset($wp_query->query['pagename']))
|
@@ -465,7 +468,7 @@ function wpsc_single_template( $content ) {
|
|
465 |
|
466 |
function wpsc_is_viewable_taxonomy(){
|
467 |
global $wp_query;
|
468 |
-
if(isset($wp_query->query_vars['taxonomy']) && ('wpsc_product_category' == $wp_query->query_vars['taxonomy'] || 'product_tag' == $wp_query->query_vars['taxonomy'] ))
|
469 |
return true;
|
470 |
else
|
471 |
return false;
|
@@ -482,27 +485,32 @@ function wpsc_is_viewable_taxonomy(){
|
|
482 |
function wpsc_the_category_title($title='', $id=''){
|
483 |
global $wp_query;
|
484 |
$post = get_post($id);
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
$
|
489 |
-
return $post->post_title;
|
490 |
-
}
|
491 |
-
if( wpsc_is_viewable_taxonomy() && 'wpsc-product' == $post->post_type && $wp_query->posts[0]->post_title == $post->post_title && $wp_query->post_count != 1){
|
492 |
remove_filter('the_title','wpsc_the_category_title');
|
493 |
-
$category = get_term_by('slug',$wp_query->query_vars['term'],'wpsc_product_category');
|
494 |
}
|
495 |
-
if( isset($wp_query->query_vars['taxonomy']) && 'product_tag' == $wp_query->query_vars['taxonomy'] && $wp_query->posts[0]->post_title == $post->post_title ){
|
496 |
-
remove_filter('the_title','wpsc_the_category_title');
|
497 |
-
$category->name = $wp_query->query_vars['term'];
|
498 |
|
|
|
|
|
|
|
|
|
499 |
}
|
500 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
501 |
return $category->name;
|
502 |
else
|
503 |
return $title;
|
504 |
-
}
|
505 |
|
|
|
|
|
506 |
/**
|
507 |
* wpsc_the_category_template swaps the template used for product categories with pageif archive template is being used use
|
508 |
* @access public
|
@@ -513,9 +521,6 @@ function wpsc_the_category_title($title='', $id=''){
|
|
513 |
*/
|
514 |
function wpsc_the_category_template($template){
|
515 |
global $wp_query;
|
516 |
-
//this little bit of code makes sure we dont get an empty content section if no posts are found for a wpec category
|
517 |
-
if(wpsc_is_viewable_taxonomy() && 0 == $wp_query->post_count)
|
518 |
-
$wp_query->post_count += 1;
|
519 |
//this bit of code makes sure we use a nice standard page template for our products
|
520 |
if(wpsc_is_viewable_taxonomy() && false !== strpos($template,'archive'))
|
521 |
return str_ireplace('archive', 'page',$template);
|
@@ -881,7 +886,7 @@ function wpsc_display_products_page( $query ) {
|
|
881 |
global $wpdb, $wpsc_query,$wp_query;
|
882 |
static $count = 0;
|
883 |
$count++;
|
884 |
-
|
885 |
if ( $count > 10 )
|
886 |
exit( 'fail' );
|
887 |
|
@@ -1023,6 +1028,8 @@ function wpsc_products_page( $content = '' ) {
|
|
1023 |
global $wpdb, $wp_query, $wpsc_query, $wpsc_query_vars;
|
1024 |
$output = '';
|
1025 |
if ( preg_match( "/\[productspage\]/", $content ) ) {
|
|
|
|
|
1026 |
remove_filter( 'the_content', 'wpautop' );
|
1027 |
|
1028 |
list($wp_query, $wpsc_query) = array( $wpsc_query, $wp_query ); // swap the wpsc_query object
|
@@ -1059,7 +1066,7 @@ function wpsc_products_page( $content = '' ) {
|
|
1059 |
function wpsc_all_products_on_page(){
|
1060 |
global $wp_query,$wpsc_query;
|
1061 |
do_action('wpsc_swap_the_template');
|
1062 |
-
if($wp_query->query_vars['post_type'] == 'wpsc-product'){
|
1063 |
if (isset($wp_query->post_count) && 1 == $wp_query->post_count && file_exists(STYLESHEETPATH.'/single-wpsc-product.php')){
|
1064 |
include(STYLESHEETPATH. '/single-wpsc-product.php');
|
1065 |
exit();
|
@@ -1147,15 +1154,18 @@ function wpsc_user_log( $content = '' ) {
|
|
1147 |
}
|
1148 |
|
1149 |
//displays a list of categories when the code [showcategories] is present in a post or page.
|
1150 |
-
function wpsc_show_categories( $content
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
|
|
1158 |
}
|
|
|
|
|
1159 |
function wpec_get_the_post_id_by_shortcode($shortcode){
|
1160 |
global $wpdb;
|
1161 |
$sql = "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` IN('page','post') AND `post_content` LIKE '%$shortcode%' LIMIT 1";
|
@@ -1240,19 +1250,6 @@ function wpsc_enable_page_filters( $excerpt = '' ) {
|
|
1240 |
add_filter( 'the_content', 'wpsc_place_shopping_cart', 12 );
|
1241 |
add_filter( 'the_content', 'wpsc_transaction_results', 12 );
|
1242 |
add_filter( 'the_content', 'wpsc_user_log', 12 );
|
1243 |
-
add_filter( 'the_content', 'wpsc_show_categories', 12 );
|
1244 |
-
return $excerpt;
|
1245 |
-
}
|
1246 |
-
|
1247 |
-
function wpsc_disable_page_filters( $excerpt = '' ) {
|
1248 |
-
remove_filter( 'the_content', 'add_to_cart_shortcode' ); //Used for add_to_cart_button shortcode
|
1249 |
-
remove_filter( 'the_content', 'wpsc_products_page' );
|
1250 |
-
remove_filter( 'the_content', 'wpsc_single_template' );
|
1251 |
-
remove_filter( 'the_content', 'wpsc_place_shopping_cart' );
|
1252 |
-
remove_filter( 'the_content', 'wpsc_transaction_results' );
|
1253 |
-
remove_filter( 'the_content', 'wpsc_user_log' );
|
1254 |
-
remove_filter( 'the_content', 'wpsc_show_categories' );
|
1255 |
-
remove_filter( 'the_content', 'wpsc_substitute_buy_now_button' );
|
1256 |
return $excerpt;
|
1257 |
}
|
1258 |
|
@@ -1452,9 +1449,10 @@ class WPSC_Hide_subcatsprods_in_cat {
|
|
1452 |
global $wpdb;
|
1453 |
remove_action( 'posts_where', array( &$this, 'where' ) );
|
1454 |
remove_action( 'posts_join', array( &$this, 'join' ) );
|
1455 |
-
if(strpos($join, "JOIN $wpdb->term_relationships ON $wpdb->posts.
|
1456 |
return $join;
|
1457 |
-
|
|
|
1458 |
return $join;
|
1459 |
}
|
1460 |
}
|
53 |
wpsc_register_theme_file( 'wpsc-user_log.php' );
|
54 |
wpsc_register_theme_file( 'wpsc-cart_widget.php' );
|
55 |
wpsc_register_theme_file( 'wpsc-featured_product.php' );
|
56 |
+
wpsc_register_theme_file( 'wpsc-category-list.php' );
|
57 |
+
|
58 |
// Let other plugins register their theme files
|
59 |
do_action( 'wpsc_register_core_theme_files' );
|
60 |
}
|
403 |
|
404 |
global $wpdb, $post, $wp_query, $wpsc_query;
|
405 |
|
|
|
406 |
$single_theme_path = wpsc_get_template_file_path( 'wpsc-single_product.php' );
|
407 |
if((!isset($wp_query->is_product)) && !isset($wp_query->query_vars['wpsc_product_category']))return $content;
|
408 |
+
if(isset($wpsc_query->query['paged']) && $wpsc_query->post_count <= 1 && $wp_query->is_single != 1){
|
409 |
+
|
410 |
+
remove_filter( "the_content", "wpsc_single_template" );
|
411 |
list($wp_query, $wpsc_query) = array( $wpsc_query, $wp_query ); // swap the wpsc_query object
|
412 |
$GLOBALS['nzshpcrt_activateshpcrt'] = true;
|
|
|
413 |
// get the display type for the productspage
|
414 |
$display_type = get_option('product_view');
|
415 |
if ( isset( $_SESSION['wpsc_display_type'] ) ) {
|
430 |
list($wp_query, $wpsc_query) = array( $wpsc_query, $wp_query ); // swap the wpsc_query objects back
|
431 |
if ( ($is_single == false) || ($product_meta['enable_comments'] == '0') )
|
432 |
$GLOBALS['post'] = $wp_query->post;
|
433 |
+
$wp_query->current_post = $wp_query->post_count;
|
434 |
return $output;
|
435 |
}
|
436 |
if ( 'wpsc-product' == $wp_query->post->post_type && !is_archive() && $wp_query->post_count <= 1 ) {
|
442 |
$content = ob_get_contents();
|
443 |
ob_end_clean();
|
444 |
list( $wp_query, $wpsc_temp_query ) = array( $wpsc_temp_query, $wp_query ); // swap the wpsc_query objects back
|
445 |
+
|
446 |
+
}elseif( is_archive() && wpsc_is_viewable_taxonomy() || ($wp_query->post_count > 1 && 1 == $wp_query->is_product)){
|
447 |
remove_filter( "the_content", "wpsc_single_template" );
|
448 |
list( $wp_query, $wpsc_query ) = array( $wpsc_query, $wp_query ); // swap the wpsc_query object
|
449 |
if(isset($wp_query->query['pagename']))
|
468 |
|
469 |
function wpsc_is_viewable_taxonomy(){
|
470 |
global $wp_query;
|
471 |
+
if(isset($wp_query->query_vars['taxonomy']) && ('wpsc_product_category' == $wp_query->query_vars['taxonomy'] || 'product_tag' == $wp_query->query_vars['taxonomy'] ) || isset($wp_query->query_vars['wpsc_product_category']))
|
472 |
return true;
|
473 |
else
|
474 |
return false;
|
485 |
function wpsc_the_category_title($title='', $id=''){
|
486 |
global $wp_query;
|
487 |
$post = get_post($id);
|
488 |
+
|
489 |
+
// If its the category page
|
490 |
+
if( wpsc_is_viewable_taxonomy() && $wp_query->posts[0]->post_title == $post->post_title && $wp_query->is_archive){
|
491 |
+
$category = get_term_by('slug',$wp_query->query_vars['wpsc_product_category'],'wpsc_product_category');
|
|
|
|
|
|
|
492 |
remove_filter('the_title','wpsc_the_category_title');
|
|
|
493 |
}
|
|
|
|
|
|
|
494 |
|
495 |
+
// If its the product_tag page
|
496 |
+
if( isset($wp_query->query_vars['taxonomy']) && 'product_tag' == $wp_query->query_vars['taxonomy'] && $wp_query->posts[0]->post_title == $post->post_title ){
|
497 |
+
$category = get_term_by('slug',$wp_query->query_vars['term'],'product_tag');
|
498 |
+
remove_filter('the_title','wpsc_the_category_title');
|
499 |
}
|
500 |
+
// if its product-page but paginated
|
501 |
+
if(empty($category->name) && $wp_query->query_vars['paged'] && $wp_query->posts[0]->post_title == $post->post_title && 'wpsc-product' == $wp_query->query_vars['post_type'] ){
|
502 |
+
$post_id = wpec_get_the_post_id_by_shortcode('[productspage]');
|
503 |
+
$post = get_post($post_id);
|
504 |
+
$title = $post->post_title;
|
505 |
+
remove_filter('the_title','wpsc_the_category_title');
|
506 |
+
}
|
507 |
+
if(!empty($category->name))
|
508 |
return $category->name;
|
509 |
else
|
510 |
return $title;
|
|
|
511 |
|
512 |
+
|
513 |
+
}
|
514 |
/**
|
515 |
* wpsc_the_category_template swaps the template used for product categories with pageif archive template is being used use
|
516 |
* @access public
|
521 |
*/
|
522 |
function wpsc_the_category_template($template){
|
523 |
global $wp_query;
|
|
|
|
|
|
|
524 |
//this bit of code makes sure we use a nice standard page template for our products
|
525 |
if(wpsc_is_viewable_taxonomy() && false !== strpos($template,'archive'))
|
526 |
return str_ireplace('archive', 'page',$template);
|
886 |
global $wpdb, $wpsc_query,$wp_query;
|
887 |
static $count = 0;
|
888 |
$count++;
|
889 |
+
remove_filter('the_title','wpsc_the_category_title');
|
890 |
if ( $count > 10 )
|
891 |
exit( 'fail' );
|
892 |
|
1028 |
global $wpdb, $wp_query, $wpsc_query, $wpsc_query_vars;
|
1029 |
$output = '';
|
1030 |
if ( preg_match( "/\[productspage\]/", $content ) ) {
|
1031 |
+
global $more;
|
1032 |
+
$more = 0;
|
1033 |
remove_filter( 'the_content', 'wpautop' );
|
1034 |
|
1035 |
list($wp_query, $wpsc_query) = array( $wpsc_query, $wp_query ); // swap the wpsc_query object
|
1066 |
function wpsc_all_products_on_page(){
|
1067 |
global $wp_query,$wpsc_query;
|
1068 |
do_action('wpsc_swap_the_template');
|
1069 |
+
if($wp_query->query_vars['post_type'] == 'wpsc-product' || isset($wp_query->query_vars['wpsc_product_category']) ){
|
1070 |
if (isset($wp_query->post_count) && 1 == $wp_query->post_count && file_exists(STYLESHEETPATH.'/single-wpsc-product.php')){
|
1071 |
include(STYLESHEETPATH. '/single-wpsc-product.php');
|
1072 |
exit();
|
1154 |
}
|
1155 |
|
1156 |
//displays a list of categories when the code [showcategories] is present in a post or page.
|
1157 |
+
function wpsc_show_categories( $content ) {
|
1158 |
+
|
1159 |
+
ob_start();
|
1160 |
+
include( wpsc_get_template_file_path( 'wpsc-category-list.php' ) );
|
1161 |
+
$output = ob_get_contents();
|
1162 |
+
|
1163 |
+
ob_end_clean();
|
1164 |
+
return $output;
|
1165 |
+
|
1166 |
}
|
1167 |
+
|
1168 |
+
add_shortcode('showcategories', 'wpsc_show_categories');
|
1169 |
function wpec_get_the_post_id_by_shortcode($shortcode){
|
1170 |
global $wpdb;
|
1171 |
$sql = "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` IN('page','post') AND `post_content` LIKE '%$shortcode%' LIMIT 1";
|
1250 |
add_filter( 'the_content', 'wpsc_place_shopping_cart', 12 );
|
1251 |
add_filter( 'the_content', 'wpsc_transaction_results', 12 );
|
1252 |
add_filter( 'the_content', 'wpsc_user_log', 12 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1253 |
return $excerpt;
|
1254 |
}
|
1255 |
|
1449 |
global $wpdb;
|
1450 |
remove_action( 'posts_where', array( &$this, 'where' ) );
|
1451 |
remove_action( 'posts_join', array( &$this, 'join' ) );
|
1452 |
+
if( strpos($join, "JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)" ) ){
|
1453 |
return $join;
|
1454 |
+
}
|
1455 |
+
$join .= " JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)";
|
1456 |
return $join;
|
1457 |
}
|
1458 |
}
|
wpsc-includes/theming.class.php
CHANGED
@@ -48,6 +48,7 @@ class wpsc_theming {
|
|
48 |
if ( $this->files_exist() ) {
|
49 |
return;
|
50 |
} else {
|
|
|
51 |
// WP-WPSC theme doesn't exist, so let's figure out where we're porting from, either the plugin directory or the wpsc-themes directory
|
52 |
$theme_location = $this->theme_location();
|
53 |
$this->active_wp_theme = trailingslashit( get_stylesheet_directory() );
|
@@ -133,7 +134,7 @@ class wpsc_theming {
|
|
133 |
if ( is_dir( $src . '/' . $file ) )
|
134 |
$this->recursive_copy( $src . '/' . $file, $dst . '/' . $file );
|
135 |
else
|
136 |
-
@ copy( $src . '/' . $file, $dst . '/' . $theme_file_prefix . $file );
|
137 |
}
|
138 |
}
|
139 |
closedir( $dir );
|
@@ -165,7 +166,7 @@ class wpsc_theming {
|
|
165 |
if ( in_array( $file, $this->templates_to_move ) ) {
|
166 |
if ( !strstr( $file, "functions" ) && !strstr( $file, "widget" ) ) {
|
167 |
$file_data = file_get_contents( $old . "/" . $file );
|
168 |
-
@file_put_contents( $path . "/" . $file, $file_data );
|
169 |
rename( $path . "/" . $file, $path . "/" . $theme_file_prefix . $file );
|
170 |
}
|
171 |
}
|
@@ -176,7 +177,8 @@ class wpsc_theming {
|
|
176 |
do_action( 'wpsc_move_theme' );
|
177 |
}
|
178 |
}
|
179 |
-
|
|
|
180 |
add_action( 'admin_init', create_function( '', 'global $wpsc_theming; $wpsc_theming = new wpsc_theming();' ) );
|
181 |
|
182 |
?>
|
48 |
if ( $this->files_exist() ) {
|
49 |
return;
|
50 |
} else {
|
51 |
+
$_SESSION['wpsc_themes_copied_results'] = array();
|
52 |
// WP-WPSC theme doesn't exist, so let's figure out where we're porting from, either the plugin directory or the wpsc-themes directory
|
53 |
$theme_location = $this->theme_location();
|
54 |
$this->active_wp_theme = trailingslashit( get_stylesheet_directory() );
|
134 |
if ( is_dir( $src . '/' . $file ) )
|
135 |
$this->recursive_copy( $src . '/' . $file, $dst . '/' . $file );
|
136 |
else
|
137 |
+
$_SESSION['wpsc_themes_copied_results'][] = @ copy( $src . '/' . $file, $dst . '/' . $theme_file_prefix . $file );
|
138 |
}
|
139 |
}
|
140 |
closedir( $dir );
|
166 |
if ( in_array( $file, $this->templates_to_move ) ) {
|
167 |
if ( !strstr( $file, "functions" ) && !strstr( $file, "widget" ) ) {
|
168 |
$file_data = file_get_contents( $old . "/" . $file );
|
169 |
+
$_SESSION['wpsc_themes_copied_results'][] = @file_put_contents( $path . "/" . $file, $file_data );
|
170 |
rename( $path . "/" . $file, $path . "/" . $theme_file_prefix . $file );
|
171 |
}
|
172 |
}
|
177 |
do_action( 'wpsc_move_theme' );
|
178 |
}
|
179 |
}
|
180 |
+
|
181 |
+
if ( isset( $_REQUEST['wpsc_move_themes'] ) && !empty($_REQUEST['wpsc_move_themes']) )
|
182 |
add_action( 'admin_init', create_function( '', 'global $wpsc_theming; $wpsc_theming = new wpsc_theming();' ) );
|
183 |
|
184 |
?>
|
wpsc-merchants/library/googlerequest.php
CHANGED
@@ -187,9 +187,9 @@
|
|
187 |
"<reason>". $reason . "</reason>";
|
188 |
if($amount!=0) {
|
189 |
$postargs .= "<amount currency=\"" . $this->currency . "\">";
|
190 |
-
$postargs .= htmlentities($amount)."</amount>";
|
191 |
}
|
192 |
-
$postargs .= "<comment>". htmlentities($comment) . "</comment>
|
193 |
</refund-order>";
|
194 |
return $this->SendReq($this->request_url,
|
195 |
$this->GetAuthenticationHeaders(), $postargs);
|
@@ -211,10 +211,10 @@
|
|
211 |
<cancel-order xmlns=\"".$this->schema_url.
|
212 |
"\" google-order-number=\"". $google_order. "\">
|
213 |
<reason>".
|
214 |
-
(substr(htmlentities(strip_tags($reason)),0,GOOGLE_REASON_LENGTH)) .
|
215 |
"</reason>
|
216 |
<comment>".
|
217 |
-
(substr(htmlentities(strip_tags($comment)),0,GOOGLE_REASON_LENGTH)) .
|
218 |
"</comment>
|
219 |
</cancel-order>";
|
220 |
return $this->SendReq($this->request_url,
|
@@ -240,7 +240,7 @@
|
|
240 |
<add-tracking-data xmlns=\"". $this->schema_url .
|
241 |
"\" google-order-number=\"". $google_order . "\">
|
242 |
<tracking-data>
|
243 |
-
<carrier>". htmlentities($carrier) . "</carrier>
|
244 |
<tracking-number>". $tracking_no . "</tracking-number>
|
245 |
</tracking-data>
|
246 |
</add-tracking-data>";
|
@@ -292,7 +292,7 @@
|
|
292 |
<send-buyer-message xmlns=\"". $this->schema_url .
|
293 |
"\" google-order-number=\"". $google_order . "\">
|
294 |
<message>" .
|
295 |
-
(substr(htmlentities(strip_tags($message)),0,GOOGLE_MESSAGE_LENGTH))
|
296 |
. "</message>
|
297 |
<send-email>" . strtolower($send_mail) . "</send-email>
|
298 |
</send-buyer-message>";
|
@@ -343,8 +343,8 @@
|
|
343 |
"\" google-order-number=\"". $google_order . "\">";
|
344 |
if($carrier != "" && $tracking_no != "") {
|
345 |
$postargs .= "<tracking-data>
|
346 |
-
<carrier>". htmlentities($carrier) . "</carrier>
|
347 |
-
<tracking-number>". htmlentities($tracking_no) . "</tracking-number>
|
348 |
</tracking-data>";
|
349 |
}
|
350 |
$postargs .= "<send-email>". strtolower($send_mail) . "</send-email>
|
@@ -428,7 +428,7 @@
|
|
428 |
$postargs .= "<tracking-data-list>\n";
|
429 |
foreach($item->tracking_data_list as $tracking_data) {
|
430 |
$postargs .= "<tracking-data>
|
431 |
-
<carrier>". htmlentities($tracking_data['carrier']) . "</carrier>
|
432 |
<tracking-number>". $tracking_data['tracking-number'] . "</tracking-number>
|
433 |
</tracking-data>\n";
|
434 |
}
|
@@ -505,10 +505,10 @@
|
|
505 |
$postargs .= "</item-ids>";
|
506 |
$postargs .= "<send-email>". strtolower($send_mail) . "</send-email>
|
507 |
<reason>".
|
508 |
-
(substr(htmlentities(strip_tags($reason)),0,GOOGLE_REASON_LENGTH)) .
|
509 |
"</reason>
|
510 |
<comment>".
|
511 |
-
(substr(htmlentities(strip_tags($comment)),0,GOOGLE_REASON_LENGTH)) .
|
512 |
"</comment>
|
513 |
</cancel-items>";
|
514 |
return $this->SendReq($this->request_url,
|
@@ -656,19 +656,19 @@
|
|
656 |
break;
|
657 |
case 503:
|
658 |
$this->log->LogError($response);
|
659 |
-
return array(503, htmlentities($body));
|
660 |
break;
|
661 |
case 403:
|
662 |
$this->log->LogError($response);
|
663 |
-
return array(403, htmlentities($body));
|
664 |
break;
|
665 |
case 400:
|
666 |
$this->log->LogError($response);
|
667 |
-
return array(400, htmlentities($body));
|
668 |
break;
|
669 |
default:
|
670 |
$this->log->LogError($response);
|
671 |
-
return array("ERR", htmlentities($body));
|
672 |
break;
|
673 |
}
|
674 |
}
|
187 |
"<reason>". $reason . "</reason>";
|
188 |
if($amount!=0) {
|
189 |
$postargs .= "<amount currency=\"" . $this->currency . "\">";
|
190 |
+
$postargs .= htmlentities($amount, ENT_QUOTES, 'UTF-8')."</amount>";
|
191 |
}
|
192 |
+
$postargs .= "<comment>". htmlentities($comment, ENT_QUOTES, 'UTF-8') . "</comment>
|
193 |
</refund-order>";
|
194 |
return $this->SendReq($this->request_url,
|
195 |
$this->GetAuthenticationHeaders(), $postargs);
|
211 |
<cancel-order xmlns=\"".$this->schema_url.
|
212 |
"\" google-order-number=\"". $google_order. "\">
|
213 |
<reason>".
|
214 |
+
(substr(htmlentities(strip_tags($reason), ENT_QUOTES, 'UTF-8'),0,GOOGLE_REASON_LENGTH)) .
|
215 |
"</reason>
|
216 |
<comment>".
|
217 |
+
(substr(htmlentities(strip_tags($comment), ENT_QUOTES, 'UTF-8'),0,GOOGLE_REASON_LENGTH)) .
|
218 |
"</comment>
|
219 |
</cancel-order>";
|
220 |
return $this->SendReq($this->request_url,
|
240 |
<add-tracking-data xmlns=\"". $this->schema_url .
|
241 |
"\" google-order-number=\"". $google_order . "\">
|
242 |
<tracking-data>
|
243 |
+
<carrier>". htmlentities($carrier, ENT_QUOTES, 'UTF-8') . "</carrier>
|
244 |
<tracking-number>". $tracking_no . "</tracking-number>
|
245 |
</tracking-data>
|
246 |
</add-tracking-data>";
|
292 |
<send-buyer-message xmlns=\"". $this->schema_url .
|
293 |
"\" google-order-number=\"". $google_order . "\">
|
294 |
<message>" .
|
295 |
+
(substr(htmlentities(strip_tags($message), ENT_QUOTES, 'UTF-8'),0,GOOGLE_MESSAGE_LENGTH))
|
296 |
. "</message>
|
297 |
<send-email>" . strtolower($send_mail) . "</send-email>
|
298 |
</send-buyer-message>";
|
343 |
"\" google-order-number=\"". $google_order . "\">";
|
344 |
if($carrier != "" && $tracking_no != "") {
|
345 |
$postargs .= "<tracking-data>
|
346 |
+
<carrier>". htmlentities($carrier, ENT_QUOTES, 'UTF-8') . "</carrier>
|
347 |
+
<tracking-number>". htmlentities($tracking_no, ENT_QUOTES, 'UTF-8') . "</tracking-number>
|
348 |
</tracking-data>";
|
349 |
}
|
350 |
$postargs .= "<send-email>". strtolower($send_mail) . "</send-email>
|
428 |
$postargs .= "<tracking-data-list>\n";
|
429 |
foreach($item->tracking_data_list as $tracking_data) {
|
430 |
$postargs .= "<tracking-data>
|
431 |
+
<carrier>". htmlentities($tracking_data['carrier'], ENT_QUOTES, 'UTF-8') . "</carrier>
|
432 |
<tracking-number>". $tracking_data['tracking-number'] . "</tracking-number>
|
433 |
</tracking-data>\n";
|
434 |
}
|
505 |
$postargs .= "</item-ids>";
|
506 |
$postargs .= "<send-email>". strtolower($send_mail) . "</send-email>
|
507 |
<reason>".
|
508 |
+
(substr(htmlentities(strip_tags($reason), ENT_QUOTES, 'UTF-8'),0,GOOGLE_REASON_LENGTH)) .
|
509 |
"</reason>
|
510 |
<comment>".
|
511 |
+
(substr(htmlentities(strip_tags($comment), ENT_QUOTES, 'UTF-8'),0,GOOGLE_REASON_LENGTH)) .
|
512 |
"</comment>
|
513 |
</cancel-items>";
|
514 |
return $this->SendReq($this->request_url,
|
656 |
break;
|
657 |
case 503:
|
658 |
$this->log->LogError($response);
|
659 |
+
return array(503, htmlentities($body, ENT_QUOTES, 'UTF-8'));
|
660 |
break;
|
661 |
case 403:
|
662 |
$this->log->LogError($response);
|
663 |
+
return array(403, htmlentities($body, ENT_QUOTES, 'UTF-8'));
|
664 |
break;
|
665 |
case 400:
|
666 |
$this->log->LogError($response);
|
667 |
+
return array(400, htmlentities($body, ENT_QUOTES, 'UTF-8'));
|
668 |
break;
|
669 |
default:
|
670 |
$this->log->LogError($response);
|
671 |
+
return array("ERR", htmlentities($body, ENT_QUOTES, 'UTF-8'));
|
672 |
break;
|
673 |
}
|
674 |
}
|
wpsc-merchants/library/xml-processing/gc_xmlbuilder.php
CHANGED
@@ -47,7 +47,7 @@
|
|
47 |
$this->_indent();
|
48 |
$this->xml .= '<'.$element;
|
49 |
foreach ($attributes as $key => $value) {
|
50 |
-
$this->xml .= ' '.$key.'="'.htmlentities($value).'"';
|
51 |
}
|
52 |
$this->xml .= ">\n";
|
53 |
$this->stack[] = $element;
|
@@ -60,16 +60,16 @@
|
|
60 |
$this->_indent();
|
61 |
$this->xml .= '<'.$element;
|
62 |
foreach ($attributes as $key => $value) {
|
63 |
-
$this->xml .= ' '.$key.'="'.htmlentities($value).'"';
|
64 |
}
|
65 |
-
$this->xml .= '>'.htmlentities($content).'</'.$element.'>'."\n";
|
66 |
}
|
67 |
|
68 |
function EmptyElement($element, $attributes = array()) {
|
69 |
$this->_indent();
|
70 |
$this->xml .= '<'.$element;
|
71 |
foreach ($attributes as $key => $value) {
|
72 |
-
$this->xml .= ' '.$key.'="'.htmlentities($value).'"';
|
73 |
}
|
74 |
$this->xml .= " />\n";
|
75 |
}
|
47 |
$this->_indent();
|
48 |
$this->xml .= '<'.$element;
|
49 |
foreach ($attributes as $key => $value) {
|
50 |
+
$this->xml .= ' '.$key.'="'.htmlentities($value, ENT_QUOTES, 'UTF-8').'"';
|
51 |
}
|
52 |
$this->xml .= ">\n";
|
53 |
$this->stack[] = $element;
|
60 |
$this->_indent();
|
61 |
$this->xml .= '<'.$element;
|
62 |
foreach ($attributes as $key => $value) {
|
63 |
+
$this->xml .= ' '.$key.'="'.htmlentities($value, ENT_QUOTES, 'UTF-8').'"';
|
64 |
}
|
65 |
+
$this->xml .= '>'.htmlentities($content, ENT_QUOTES, 'UTF-8').'</'.$element.'>'."\n";
|
66 |
}
|
67 |
|
68 |
function EmptyElement($element, $attributes = array()) {
|
69 |
$this->_indent();
|
70 |
$this->xml .= '<'.$element;
|
71 |
foreach ($attributes as $key => $value) {
|
72 |
+
$this->xml .= ' '.$key.'="'.htmlentities($value, ENT_QUOTES, 'UTF-8').'"';
|
73 |
}
|
74 |
$this->xml .= " />\n";
|
75 |
}
|
wpsc-merchants/paypal-pro.merchant.php
CHANGED
@@ -168,7 +168,7 @@ class wpsc_merchant_paypal_pro extends wpsc_merchant {
|
|
168 |
|
169 |
case 'LONGMESSAGE':
|
170 |
// Oddly, this comes with two levels of slashes, so strip them twice
|
171 |
-
$error_data[$error_number]['error_message'] = htmlentities( stripslashes( stripslashes( $response_value ) ) );
|
172 |
break;
|
173 |
}
|
174 |
}
|
168 |
|
169 |
case 'LONGMESSAGE':
|
170 |
// Oddly, this comes with two levels of slashes, so strip them twice
|
171 |
+
$error_data[$error_number]['error_message'] = htmlentities( stripslashes( stripslashes( $response_value ) ), ENT_QUOTES, 'UTF-8' );
|
172 |
break;
|
173 |
}
|
174 |
}
|
wpsc-merchants/paypal-standard.merchant.php
CHANGED
@@ -68,6 +68,10 @@ class wpsc_merchant_paypal_standard extends wpsc_merchant {
|
|
68 |
function _construct_value_array($aggregate = false) {
|
69 |
global $wpdb;
|
70 |
$paypal_vars = array();
|
|
|
|
|
|
|
|
|
71 |
|
72 |
// Store settings to be sent to paypal
|
73 |
$paypal_vars += array(
|
@@ -202,10 +206,13 @@ class wpsc_merchant_paypal_standard extends wpsc_merchant {
|
|
202 |
'cmd' => '_ext-enter',
|
203 |
'redirect_cmd' => '_cart',
|
204 |
);
|
205 |
-
|
|
|
|
|
|
|
206 |
// Set base shipping
|
207 |
$paypal_vars += array(
|
208 |
-
'handling_cart' => $
|
209 |
);
|
210 |
|
211 |
// Stick the cart item values together here
|
@@ -216,7 +223,7 @@ class wpsc_merchant_paypal_standard extends wpsc_merchant {
|
|
216 |
$paypal_vars += array(
|
217 |
"item_name_$i" => $cart_row['name'],
|
218 |
"amount_$i" => $this->format_price($cart_row['price']),
|
219 |
-
"tax_$i" => $this->format_price($cart_row['tax']),
|
220 |
"quantity_$i" => $cart_row['quantity'],
|
221 |
"item_number_$i" => $cart_row['product_id'],
|
222 |
// additional shipping for the the (first item / total of the items)
|
@@ -248,12 +255,12 @@ class wpsc_merchant_paypal_standard extends wpsc_merchant {
|
|
248 |
} else {
|
249 |
$paypal_currency_productprice = $this->cart_data['total_price'];
|
250 |
}
|
251 |
-
|
252 |
$paypal_vars['item_name_'.$i] = "Your Shopping Cart";
|
253 |
-
$paypal_vars['amount_'.$i] = $this->format_price(
|
254 |
$paypal_currency_productprice,
|
255 |
$local_currency_code
|
256 |
-
);
|
257 |
$paypal_vars['quantity_'.$i] = 1;
|
258 |
$paypal_vars['shipping_'.$i] = 0;
|
259 |
$paypal_vars['shipping2_'.$i] = 0;
|
@@ -288,7 +295,6 @@ class wpsc_merchant_paypal_standard extends wpsc_merchant {
|
|
288 |
|
289 |
$redirect = get_option('paypal_multiple_url')."?".$gateway_values;
|
290 |
}
|
291 |
-
|
292 |
if (defined('WPSC_ADD_DEBUG_PAGE') && WPSC_ADD_DEBUG_PAGE) {
|
293 |
echo "<a href='".esc_url($redirect)."'>Test the URL here</a>";
|
294 |
echo "<pre>".print_r($this->collected_gateway_data,true)."</pre>";
|
68 |
function _construct_value_array($aggregate = false) {
|
69 |
global $wpdb;
|
70 |
$paypal_vars = array();
|
71 |
+
$add_tax = true;
|
72 |
+
if(get_option('wpec_taxes_inprice') == 'inclusive')
|
73 |
+
$add_tax = false;
|
74 |
+
|
75 |
|
76 |
// Store settings to be sent to paypal
|
77 |
$paypal_vars += array(
|
206 |
'cmd' => '_ext-enter',
|
207 |
'redirect_cmd' => '_cart',
|
208 |
);
|
209 |
+
$handling = $this->cart_data['base_shipping'];
|
210 |
+
if($add_tax)
|
211 |
+
$handling += $this->cart_data['cart_tax'];
|
212 |
+
|
213 |
// Set base shipping
|
214 |
$paypal_vars += array(
|
215 |
+
'handling_cart' => $handling
|
216 |
);
|
217 |
|
218 |
// Stick the cart item values together here
|
223 |
$paypal_vars += array(
|
224 |
"item_name_$i" => $cart_row['name'],
|
225 |
"amount_$i" => $this->format_price($cart_row['price']),
|
226 |
+
"tax_$i" => ($add_tax) ? $this->format_price($cart_row['tax']) : 0,
|
227 |
"quantity_$i" => $cart_row['quantity'],
|
228 |
"item_number_$i" => $cart_row['product_id'],
|
229 |
// additional shipping for the the (first item / total of the items)
|
255 |
} else {
|
256 |
$paypal_currency_productprice = $this->cart_data['total_price'];
|
257 |
}
|
258 |
+
|
259 |
$paypal_vars['item_name_'.$i] = "Your Shopping Cart";
|
260 |
+
$paypal_vars['amount_'.$i] = ($this->format_price(
|
261 |
$paypal_currency_productprice,
|
262 |
$local_currency_code
|
263 |
+
)-$paypal_vars['handling_cart']);
|
264 |
$paypal_vars['quantity_'.$i] = 1;
|
265 |
$paypal_vars['shipping_'.$i] = 0;
|
266 |
$paypal_vars['shipping2_'.$i] = 0;
|
295 |
|
296 |
$redirect = get_option('paypal_multiple_url')."?".$gateway_values;
|
297 |
}
|
|
|
298 |
if (defined('WPSC_ADD_DEBUG_PAGE') && WPSC_ADD_DEBUG_PAGE) {
|
299 |
echo "<a href='".esc_url($redirect)."'>Test the URL here</a>";
|
300 |
echo "<pre>".print_r($this->collected_gateway_data,true)."</pre>";
|
wpsc-shipping/australiapost.php
CHANGED
@@ -69,6 +69,7 @@ class australiapost {
|
|
69 |
foreach ($this->services as $code => $value) {
|
70 |
$this->settings['services'][$code] = true;
|
71 |
}
|
|
|
72 |
}
|
73 |
|
74 |
return true;
|
@@ -105,19 +106,23 @@ class australiapost {
|
|
105 |
$checked = $this->settings['services'][$code] ? "checked='checked'" : '';
|
106 |
$output .= " <label style=\"margin-left: 50px;\"><input type='checkbox' {$checked} name='wpsc_australiapost_settings[services][{$code}]'/>{$this->services[$code]}</label><br />\n\r";
|
107 |
}
|
|
|
108 |
$output .= "</td></tr>";
|
109 |
$output .= "<tr><td><h4>" . __('Notes:', 'wpsc') . "</h4>";
|
110 |
$output .= __('1. The actual services quoted to the customer during checkout will depend on the destination country. Not all methods are available to all destinations.', 'wpsc') . "<br />";
|
111 |
$output .= __('2. Each product must have a valid weight configured. When editing a product, use the weight field.).', 'wpsc') . "<br />";
|
112 |
$output .= __('3. To ensure accurate quotes, each product must valid dimensions configured. When editing a product, use the height, width and length fields.', 'wpsc') . "<br />";
|
113 |
$output .= __('4. The combined dimensions are estimated by calculating the volume of each item, and then calculating the cubed root of the overall order volume which becomes width, length and height.', 'wpsc') . "<br />";
|
114 |
-
$output .= __('5. If no product
|
115 |
$output .= "</tr></td>";
|
116 |
return $output;
|
117 |
}
|
118 |
|
119 |
function submit_form() {
|
120 |
$this->settings['services'] = array();
|
|
|
|
|
|
|
121 |
|
122 |
if (isset($_POST['wpsc_australiapost_settings'])) {
|
123 |
if (isset($_POST['wpsc_australiapost_settings']['services'])) {
|
@@ -126,10 +131,8 @@ class australiapost {
|
|
126 |
}
|
127 |
}
|
128 |
}
|
129 |
-
|
130 |
-
|
131 |
-
update_option('wpsc_australiapost_settings', $this->settings);
|
132 |
-
}
|
133 |
return true;
|
134 |
}
|
135 |
|
@@ -179,9 +182,8 @@ class australiapost {
|
|
179 |
*/
|
180 |
|
181 |
|
182 |
-
//
|
183 |
-
|
184 |
-
$weight = floatval($wpsc_cart->calculate_total_weight(true) * 453.59237);
|
185 |
|
186 |
// Calculate the total cart dimensions by adding the volume of each product then calculating the cubed root
|
187 |
$volume = 0;
|
69 |
foreach ($this->services as $code => $value) {
|
70 |
$this->settings['services'][$code] = true;
|
71 |
}
|
72 |
+
update_option('wpsc_australiapost_settings', $this->settings);
|
73 |
}
|
74 |
|
75 |
return true;
|
106 |
$checked = $this->settings['services'][$code] ? "checked='checked'" : '';
|
107 |
$output .= " <label style=\"margin-left: 50px;\"><input type='checkbox' {$checked} name='wpsc_australiapost_settings[services][{$code}]'/>{$this->services[$code]}</label><br />\n\r";
|
108 |
}
|
109 |
+
$output .= "<input type='hidden' name='{$this->internal_name}_updateoptions' value='true'>";
|
110 |
$output .= "</td></tr>";
|
111 |
$output .= "<tr><td><h4>" . __('Notes:', 'wpsc') . "</h4>";
|
112 |
$output .= __('1. The actual services quoted to the customer during checkout will depend on the destination country. Not all methods are available to all destinations.', 'wpsc') . "<br />";
|
113 |
$output .= __('2. Each product must have a valid weight configured. When editing a product, use the weight field.).', 'wpsc') . "<br />";
|
114 |
$output .= __('3. To ensure accurate quotes, each product must valid dimensions configured. When editing a product, use the height, width and length fields.', 'wpsc') . "<br />";
|
115 |
$output .= __('4. The combined dimensions are estimated by calculating the volume of each item, and then calculating the cubed root of the overall order volume which becomes width, length and height.', 'wpsc') . "<br />";
|
116 |
+
$output .= __('5. If no product dimensions are defined, then default package dimensions of 100mm x 100mm x 100mm will be used.', 'wpsc') . "<br />";
|
117 |
$output .= "</tr></td>";
|
118 |
return $output;
|
119 |
}
|
120 |
|
121 |
function submit_form() {
|
122 |
$this->settings['services'] = array();
|
123 |
+
|
124 |
+
// Only continue if this module's options were updated
|
125 |
+
if ( !isset($_POST["{$this->internal_name}_updateoptions"]) || !$_POST["{$this->internal_name}_updateoptions"] ) return;
|
126 |
|
127 |
if (isset($_POST['wpsc_australiapost_settings'])) {
|
128 |
if (isset($_POST['wpsc_australiapost_settings']['services'])) {
|
131 |
}
|
132 |
}
|
133 |
}
|
134 |
+
|
135 |
+
update_option('wpsc_australiapost_settings', $this->settings);
|
|
|
|
|
136 |
return true;
|
137 |
}
|
138 |
|
182 |
*/
|
183 |
|
184 |
|
185 |
+
// Weight is in grams
|
186 |
+
$weight = wpsc_convert_weight($wpsc_cart->calculate_total_weight(true), 'pound', 'gram');
|
|
|
187 |
|
188 |
// Calculate the total cart dimensions by adding the volume of each product then calculating the cubed root
|
189 |
$volume = 0;
|
wpsc-shipping/weightrate.php
CHANGED
@@ -46,7 +46,7 @@ class weightrate {
|
|
46 |
*/
|
47 |
function getForm() {
|
48 |
|
49 |
-
$output.="<tr><th>".__('Total weight <br />(<abbr alt="You must enter the weight here in pounds, regardless of what you used on your products" title="You must enter the weight here in pounds, regardless of what you used on your products">in
|
50 |
|
51 |
$layers = get_option("weight_rate_layers");
|
52 |
|
46 |
*/
|
47 |
function getForm() {
|
48 |
|
49 |
+
$output.="<tr><th>".__('Total weight <br />(<abbr alt="You must enter the weight here in pounds, regardless of what you used on your products" title="You must enter the weight here in pounds, regardless of what you used on your products">in pounds</abbr>)', 'wpsc')."</th><th>".__('Shipping Price', 'wpsc')."</th></tr>";
|
50 |
|
51 |
$layers = get_option("weight_rate_layers");
|
52 |
|
wpsc-taxes/controllers/taxes_controller.class.php
CHANGED
@@ -288,8 +288,8 @@ class wpec_taxes_controller {
|
|
288 |
* @param: input_settings (optional) - Expects an array of settings for the
|
289 |
* select menu generated.
|
290 |
* See: wpec_taxes_build_select_options()
|
291 |
-
* @param: custom_tax_band (optional) - Expects
|
292 |
-
* default option for the generated select menu will be set to this.
|
293 |
* @return: string containing html select menu
|
294 |
* */
|
295 |
function wpec_taxes_display_tax_bands( $input_settings=array( ), $custom_tax_band=false ) {
|
@@ -298,7 +298,7 @@ class wpec_taxes_controller {
|
|
298 |
//retrieve the bands and add the disabled value
|
299 |
$tax_bands = $this->wpec_taxes->wpec_taxes_get_bands();
|
300 |
if ( !empty( $tax_bands ) ) {
|
301 |
-
array_unshift( $tax_bands, __( 'Disabled' ) );
|
302 |
|
303 |
//set select settings
|
304 |
$default_select_settings = array(
|
@@ -309,16 +309,16 @@ class wpec_taxes_controller {
|
|
309 |
$band_select_settings = wp_parse_args( $input_settings, $default_select_settings );
|
310 |
|
311 |
//set the default option
|
312 |
-
$default_option = (isset( $custom_tax_band )) ? $custom_tax_band : __( 'Disabled' );
|
313 |
|
314 |
//echo select
|
315 |
-
$returnable = $this->wpec_taxes_build_select_options( $tax_bands, '
|
316 |
} else {
|
317 |
-
$returnable = '<p>' . __( 'No Tax Bands Setup. Set Tax Bands up in <a href="options-general.php?page=wpsc-settings&tab=taxes">Settings > Taxes</a>' ) . '</p>';
|
318 |
}// if
|
319 |
} elseif(!$this->wpec_taxes->wpec_taxes_get_enabled()) {
|
320 |
$returnable = '<p>';
|
321 |
-
$returnable .= __( 'Taxes are not enabled. See <a href="options-general.php?page=wpsc-settings&tab=taxes">Settings > Taxes</a>' );
|
322 |
$returnable .= '</p>';
|
323 |
}// if
|
324 |
|
@@ -328,7 +328,7 @@ class wpec_taxes_controller {
|
|
328 |
/**
|
329 |
* @description: wpec_taxes_product_rate_percentage - returns the percentage for the specified tax band.
|
330 |
*
|
331 |
-
* @param: tax_band - the
|
332 |
* @return: percentage rate
|
333 |
* */
|
334 |
function wpec_taxes_product_rate_percentage( $tax_band ) {
|
@@ -518,6 +518,12 @@ class wpec_taxes_controller {
|
|
518 |
'class' => 'taxes-band',
|
519 |
'label' => __( 'Name' )
|
520 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
521 |
} elseif ( $type == 'rates' ) {
|
522 |
$shipping_input_settings = array(
|
523 |
'type' => 'checkbox',
|
@@ -574,11 +580,16 @@ class wpec_taxes_controller {
|
|
574 |
'isocode' => $country_code,
|
575 |
'country' => $this->wpec_taxes->wpec_taxes_get_country_information( 'country', array( 'isocode' => $country_code ) )
|
576 |
);
|
|
|
|
|
|
|
|
|
|
|
577 |
} else {
|
578 |
//select All Markets by default
|
579 |
$selected_country = array(
|
580 |
'isocode' => 'all-markets',
|
581 |
-
'country' => 'All Markets'
|
582 |
);
|
583 |
}// if
|
584 |
//get countries
|
@@ -587,6 +598,7 @@ class wpec_taxes_controller {
|
|
587 |
//build the rate form based on the information gathered
|
588 |
if ( $type == 'bands' ) {
|
589 |
$returnable[] = $this->wpec_taxes_build_input( $bands_input_settings ) . '<br />'; //add a break for the html formatting
|
|
|
590 |
}// if
|
591 |
$returnable[] = $this->wpec_taxes_build_input( $rate_input_settings );
|
592 |
$returnable[] = $this->wpec_taxes_build_select_options( $countries, 'isocode', 'country', $selected_country, $country_select_settings );
|
@@ -596,7 +608,7 @@ class wpec_taxes_controller {
|
|
596 |
if ( $type == 'rates' ) {
|
597 |
$returnable[] = $this->wpec_taxes_build_input( $shipping_input_settings );
|
598 |
}// if
|
599 |
-
$returnable[] = "<a class='taxes-{$type}-delete' id='delete-{$key}' href='#'>" . __( 'Delete' ) . "</a>";
|
600 |
|
601 |
$returnable = "<p id='{$type}-row-{$key}' class='wpec-tax-{$type}'>" . implode( "\n", $returnable ) . '</p>';
|
602 |
|
288 |
* @param: input_settings (optional) - Expects an array of settings for the
|
289 |
* select menu generated.
|
290 |
* See: wpec_taxes_build_select_options()
|
291 |
+
* @param: custom_tax_band (optional) - Expects an array. If this is set then the
|
292 |
+
* default option for the generated select menu will be set to this band.
|
293 |
* @return: string containing html select menu
|
294 |
* */
|
295 |
function wpec_taxes_display_tax_bands( $input_settings=array( ), $custom_tax_band=false ) {
|
298 |
//retrieve the bands and add the disabled value
|
299 |
$tax_bands = $this->wpec_taxes->wpec_taxes_get_bands();
|
300 |
if ( !empty( $tax_bands ) ) {
|
301 |
+
array_unshift( $tax_bands, __( 'Disabled', 'wpsc' ) );
|
302 |
|
303 |
//set select settings
|
304 |
$default_select_settings = array(
|
309 |
$band_select_settings = wp_parse_args( $input_settings, $default_select_settings );
|
310 |
|
311 |
//set the default option
|
312 |
+
$default_option = (isset( $custom_tax_band )) ? $custom_tax_band : __( 'Disabled', 'wpsc' );
|
313 |
|
314 |
//echo select
|
315 |
+
$returnable = $this->wpec_taxes_build_select_options( $tax_bands, 'index', 'name', $default_option, $band_select_settings );
|
316 |
} else {
|
317 |
+
$returnable = '<p>' . __( 'No Tax Bands Setup. Set Tax Bands up in <a href="options-general.php?page=wpsc-settings&tab=taxes">Settings > Taxes</a>', 'wpsc' ) . '</p>';
|
318 |
}// if
|
319 |
} elseif(!$this->wpec_taxes->wpec_taxes_get_enabled()) {
|
320 |
$returnable = '<p>';
|
321 |
+
$returnable .= __( 'Taxes are not enabled. See <a href="options-general.php?page=wpsc-settings&tab=taxes">Settings > Taxes</a>', 'wpsc' );
|
322 |
$returnable .= '</p>';
|
323 |
}// if
|
324 |
|
328 |
/**
|
329 |
* @description: wpec_taxes_product_rate_percentage - returns the percentage for the specified tax band.
|
330 |
*
|
331 |
+
* @param: tax_band - the index of the band you wish to retrieve a percentage for
|
332 |
* @return: percentage rate
|
333 |
* */
|
334 |
function wpec_taxes_product_rate_percentage( $tax_band ) {
|
518 |
'class' => 'taxes-band',
|
519 |
'label' => __( 'Name' )
|
520 |
);
|
521 |
+
$bands_hidden_index = array(
|
522 |
+
'type' => 'hidden',
|
523 |
+
'id' => "band-index-{$key}",
|
524 |
+
'name' => "wpsc_options[wpec_taxes_{$type}][{$key}][index]",
|
525 |
+
'value' => $key
|
526 |
+
);
|
527 |
} elseif ( $type == 'rates' ) {
|
528 |
$shipping_input_settings = array(
|
529 |
'type' => 'checkbox',
|
580 |
'isocode' => $country_code,
|
581 |
'country' => $this->wpec_taxes->wpec_taxes_get_country_information( 'country', array( 'isocode' => $country_code ) )
|
582 |
);
|
583 |
+
|
584 |
+
if(isset($tax_rate['index']))
|
585 |
+
{
|
586 |
+
$bands_hidden_index['value'] = $tax_rate['index'];
|
587 |
+
}
|
588 |
} else {
|
589 |
//select All Markets by default
|
590 |
$selected_country = array(
|
591 |
'isocode' => 'all-markets',
|
592 |
+
'country' => __('All Markets', 'wpsc')
|
593 |
);
|
594 |
}// if
|
595 |
//get countries
|
598 |
//build the rate form based on the information gathered
|
599 |
if ( $type == 'bands' ) {
|
600 |
$returnable[] = $this->wpec_taxes_build_input( $bands_input_settings ) . '<br />'; //add a break for the html formatting
|
601 |
+
$returnable[] = $this->wpec_taxes_build_input( $bands_hidden_index );
|
602 |
}// if
|
603 |
$returnable[] = $this->wpec_taxes_build_input( $rate_input_settings );
|
604 |
$returnable[] = $this->wpec_taxes_build_select_options( $countries, 'isocode', 'country', $selected_country, $country_select_settings );
|
608 |
if ( $type == 'rates' ) {
|
609 |
$returnable[] = $this->wpec_taxes_build_input( $shipping_input_settings );
|
610 |
}// if
|
611 |
+
$returnable[] = "<a class='taxes-{$type}-delete' id='delete-{$key}' href='#'>" . __( 'Delete', 'wpsc' ) . "</a>";
|
612 |
|
613 |
$returnable = "<p id='{$type}-row-{$key}' class='wpec-tax-{$type}'>" . implode( "\n", $returnable ) . '</p>';
|
614 |
|
wpsc-taxes/models/taxes.class.php
CHANGED
@@ -148,23 +148,47 @@ class wpec_taxes {
|
|
148 |
|
149 |
return $returnable;
|
150 |
} // wpec_taxes_get_band_from_name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
|
152 |
/**
|
153 |
-
* @description: wpec_taxes_get_included_rate - returns the precentage rate for the given tax band
|
154 |
* country code and region code. This retrieves the rate based on the current
|
155 |
* tax settings.
|
156 |
*
|
157 |
-
* @param:
|
158 |
* @param: country_code - isocode of the country that you wish to retrieve a percentage rate for
|
159 |
* @param: region_code(optional) - the code code for the region that you wish to retrieve a
|
160 |
* percentage rate for
|
161 |
* */
|
162 |
-
function wpec_taxes_get_included_rate( $
|
163 |
//set the tax_rate
|
164 |
$tax_rate = 0;
|
165 |
|
166 |
//get the tax band
|
167 |
-
$tax_band = $this->
|
168 |
|
169 |
//set the tax rate depending on product rate settings
|
170 |
switch ( $this->wpec_taxes_get_product() ) {
|
148 |
|
149 |
return $returnable;
|
150 |
} // wpec_taxes_get_band_from_name
|
151 |
+
|
152 |
+
/**
|
153 |
+
* @author: Jeremy Smith
|
154 |
+
* @description: wpec_taxes_get_band_from_index - retrieves the tax band for the given name
|
155 |
+
*
|
156 |
+
* @param: index - the index of the tax band you wish to retrieve.
|
157 |
+
* @return: array or false
|
158 |
+
* */
|
159 |
+
function wpec_taxes_get_band_from_index( $index ) {
|
160 |
+
//initialize return value
|
161 |
+
$returnable = false;
|
162 |
+
|
163 |
+
//search bands for index
|
164 |
+
if ( !empty( $this->taxes_options['wpec_taxes_bands'] ) ) {
|
165 |
+
foreach ( $this->taxes_options['wpec_taxes_bands'] as $tax_band ) {
|
166 |
+
if ( $tax_band['index'] == $index ) {
|
167 |
+
$returnable = $tax_band;
|
168 |
+
break;
|
169 |
+
}// if
|
170 |
+
}// foreach
|
171 |
+
}// if
|
172 |
+
|
173 |
+
return $returnable;
|
174 |
+
} // wpec_taxes_get_band_from_index
|
175 |
|
176 |
/**
|
177 |
+
* @description: wpec_taxes_get_included_rate - returns the precentage rate for the given tax band index,
|
178 |
* country code and region code. This retrieves the rate based on the current
|
179 |
* tax settings.
|
180 |
*
|
181 |
+
* @param: taxes_band_index - the index of the tax band you wish to retrieve a percentage rate for
|
182 |
* @param: country_code - isocode of the country that you wish to retrieve a percentage rate for
|
183 |
* @param: region_code(optional) - the code code for the region that you wish to retrieve a
|
184 |
* percentage rate for
|
185 |
* */
|
186 |
+
function wpec_taxes_get_included_rate( $taxes_band_index, $country_code, $region_code='' ) {
|
187 |
//set the tax_rate
|
188 |
$tax_rate = 0;
|
189 |
|
190 |
//get the tax band
|
191 |
+
$tax_band = $this->wpec_taxes_get_band_from_index( $taxes_band_index );
|
192 |
|
193 |
//set the tax rate depending on product rate settings
|
194 |
switch ( $this->wpec_taxes_get_product() ) {
|
wpsc-taxes/taxes_module.php
CHANGED
@@ -52,6 +52,11 @@ function wpec_taxes_ajax_controller() {
|
|
52 |
break;
|
53 |
case 'wpec_taxes_build_band_form':
|
54 |
$key = $_REQUEST['current_key'];
|
|
|
|
|
|
|
|
|
|
|
55 |
$returnable = $wpec_taxes_controller->wpec_taxes_build_form( $key, false, 'bands' );
|
56 |
break;
|
57 |
}// switch
|
52 |
break;
|
53 |
case 'wpec_taxes_build_band_form':
|
54 |
$key = $_REQUEST['current_key'];
|
55 |
+
//get a new key if a band is already defined for this key
|
56 |
+
while($wpec_taxes_controller->wpec_taxes->wpec_taxes_get_band_from_index($key))
|
57 |
+
{
|
58 |
+
$key++;
|
59 |
+
}
|
60 |
$returnable = $wpec_taxes_controller->wpec_taxes_build_form( $key, false, 'bands' );
|
61 |
break;
|
62 |
}// switch
|
wpsc-theme/functions/wpsc-transaction_results_functions.php
CHANGED
@@ -121,9 +121,9 @@ function transaction_results( $sessionid, $display_to_screen = true, $transactio
|
|
121 |
$cart = $wpdb->get_results( "SELECT * FROM `" . WPSC_TABLE_CART_CONTENTS . "` WHERE `purchaseid` = '{$purchase_log['id']}'" , ARRAY_A );
|
122 |
//echo '<pre>'.print_r($wpsc_cart,1).'</pre>';
|
123 |
if ( ($cart != null) && ($errorcode == 0) ) {
|
124 |
-
$link = array( );
|
125 |
$total_shipping = '';
|
126 |
foreach ( $cart as $row ) {
|
|
|
127 |
if ( $purchase_log['email_sent'] != 1 )
|
128 |
$wpdb->update(WPSC_TABLE_DOWNLOAD_STATUS, array('active' => '1'), array('cartid' => $row['id'], 'purchid'=>$purchase_log['id']) );
|
129 |
do_action( 'wpsc_transaction_result_cart_item', array( "purchase_id" => $purchase_log['id'], "cart_item" => $row, "purchase_log" => $purchase_log ) );
|
@@ -189,18 +189,21 @@ function transaction_results( $sessionid, $display_to_screen = true, $transactio
|
|
189 |
|
190 |
$product_list.= " - " . $row['quantity'] . " " . $row['name'] . " " . $message_price . "\n\r";
|
191 |
if ( $shipping > 0 )
|
192 |
-
$product_list .=
|
|
|
193 |
$product_list_html.= "\n\r - " . $row['quantity'] . " " . $row['name'] . " " . $message_price_html . "\n\r";
|
194 |
if ( $shipping > 0 )
|
195 |
-
$product_list_html .=
|
|
|
196 |
}
|
197 |
|
198 |
//add tax if included
|
199 |
if($wpec_taxes_controller->wpec_taxes_isenabled() && $wpec_taxes_controller->wpec_taxes_isincluded())
|
200 |
{
|
201 |
$taxes_text = ' - - '.__('Tax Included', 'wpsc').': '.wpsc_currency_display( $row['tax_charged'], array( 'display_as_html' => false ) )."\n\r";
|
|
|
202 |
$product_list .= $taxes_text;
|
203 |
-
$product_list_html .= $
|
204 |
}// if
|
205 |
|
206 |
$report = get_option( 'wpsc_email_admin' );
|
@@ -221,22 +224,24 @@ function transaction_results( $sessionid, $display_to_screen = true, $transactio
|
|
221 |
$total_shipping += $purchase_log['base_shipping'];
|
222 |
|
223 |
$total = $purchase_log['totalprice'];
|
224 |
-
|
225 |
-
$discount_email.= __( 'Discount', 'wpsc' ) . "\n\r: ";
|
226 |
-
$discount_email .=$purchase_log['discount_data'] . ' : ' . wpsc_currency_display( $purchase_log['discount_value'], array( 'display_as_html' => false ) ) . "\n\r";
|
227 |
-
}
|
228 |
$total_price_email = '';
|
229 |
$total_price_html = '';
|
230 |
$total_tax_html = '';
|
231 |
$total_tax = '';
|
232 |
$total_shipping_html = '';
|
233 |
$total_shipping_email = '';
|
234 |
-
$total_shipping_email.= __( 'Total Shipping
|
235 |
-
|
236 |
-
|
|
|
237 |
if ( $purchase_log['discount_value'] > 0 ) {
|
|
|
|
|
|
|
238 |
$report.= $discount_email . "\n\r";
|
239 |
-
$
|
|
|
240 |
}
|
241 |
|
242 |
//only show total tax if tax is not included
|
@@ -244,9 +249,12 @@ function transaction_results( $sessionid, $display_to_screen = true, $transactio
|
|
244 |
$total_tax_html .= __('Total Tax', 'wpsc').': '. wpsc_currency_display( $purchase_log['wpec_taxes_total'] )."\n\r";
|
245 |
$total_tax .= __('Total Tax', 'wpsc').': '. wpsc_currency_display( $purchase_log['wpec_taxes_total'] , array( 'display_as_html' => false ) )."\n\r";
|
246 |
}
|
247 |
-
$total_shipping_html.= __( 'Total Shipping
|
248 |
-
|
249 |
-
$
|
|
|
|
|
|
|
250 |
|
251 |
if ( isset( $_GET['ti'] ) ) {
|
252 |
$message.= "\n\r" . __( 'Your Transaction ID', 'wpsc' ) . ": " . $_GET['ti'];
|
121 |
$cart = $wpdb->get_results( "SELECT * FROM `" . WPSC_TABLE_CART_CONTENTS . "` WHERE `purchaseid` = '{$purchase_log['id']}'" , ARRAY_A );
|
122 |
//echo '<pre>'.print_r($wpsc_cart,1).'</pre>';
|
123 |
if ( ($cart != null) && ($errorcode == 0) ) {
|
|
|
124 |
$total_shipping = '';
|
125 |
foreach ( $cart as $row ) {
|
126 |
+
$link = array( );
|
127 |
if ( $purchase_log['email_sent'] != 1 )
|
128 |
$wpdb->update(WPSC_TABLE_DOWNLOAD_STATUS, array('active' => '1'), array('cartid' => $row['id'], 'purchid'=>$purchase_log['id']) );
|
129 |
do_action( 'wpsc_transaction_result_cart_item', array( "purchase_id" => $purchase_log['id'], "cart_item" => $row, "purchase_log" => $purchase_log ) );
|
189 |
|
190 |
$product_list.= " - " . $row['quantity'] . " " . $row['name'] . " " . $message_price . "\n\r";
|
191 |
if ( $shipping > 0 )
|
192 |
+
$product_list .= sprintf(__( ' - Shipping: %s
|
193 |
+
', 'wpsc' ), $shipping_price);
|
194 |
$product_list_html.= "\n\r - " . $row['quantity'] . " " . $row['name'] . " " . $message_price_html . "\n\r";
|
195 |
if ( $shipping > 0 )
|
196 |
+
$product_list_html .= sprintf(__( ' Shipping: %s
|
197 |
+
', 'wpsc' ), $shipping_price);
|
198 |
}
|
199 |
|
200 |
//add tax if included
|
201 |
if($wpec_taxes_controller->wpec_taxes_isenabled() && $wpec_taxes_controller->wpec_taxes_isincluded())
|
202 |
{
|
203 |
$taxes_text = ' - - '.__('Tax Included', 'wpsc').': '.wpsc_currency_display( $row['tax_charged'], array( 'display_as_html' => false ) )."\n\r";
|
204 |
+
$taxes_text_html = ' - - '.__('Tax Included', 'wpsc').': '.wpsc_currency_display( $row['tax_charged'] );
|
205 |
$product_list .= $taxes_text;
|
206 |
+
$product_list_html .= $taxes_text_html;
|
207 |
}// if
|
208 |
|
209 |
$report = get_option( 'wpsc_email_admin' );
|
224 |
$total_shipping += $purchase_log['base_shipping'];
|
225 |
|
226 |
$total = $purchase_log['totalprice'];
|
227 |
+
|
|
|
|
|
|
|
228 |
$total_price_email = '';
|
229 |
$total_price_html = '';
|
230 |
$total_tax_html = '';
|
231 |
$total_tax = '';
|
232 |
$total_shipping_html = '';
|
233 |
$total_shipping_email = '';
|
234 |
+
$total_shipping_email.= sprintf(__( 'Total Shipping: %s
|
235 |
+
', 'wpsc' ), wpsc_currency_display( $total_shipping, array( 'display_as_html' => false ) ) );
|
236 |
+
$total_price_email.= sprintf(__( 'Total: %s
|
237 |
+
', 'wpsc' ), wpsc_currency_display( $total, array( 'display_as_html' => false ) ));
|
238 |
if ( $purchase_log['discount_value'] > 0 ) {
|
239 |
+
$discount_email.= __( 'Discount', 'wpsc' ) . "\n\r: ";
|
240 |
+
$discount_email .=$purchase_log['discount_data'] . ' : ' . wpsc_currency_display( $purchase_log['discount_value'], array( 'display_as_html' => false ) ) . "\n\r";
|
241 |
+
|
242 |
$report.= $discount_email . "\n\r";
|
243 |
+
$total_shipping_email .= $discount_email;
|
244 |
+
$total_shipping_html.= __( 'Discount', 'wpsc' ) . ": " . wpsc_currency_display( $purchase_log['discount_value'] ) . "\n\r";
|
245 |
}
|
246 |
|
247 |
//only show total tax if tax is not included
|
249 |
$total_tax_html .= __('Total Tax', 'wpsc').': '. wpsc_currency_display( $purchase_log['wpec_taxes_total'] )."\n\r";
|
250 |
$total_tax .= __('Total Tax', 'wpsc').': '. wpsc_currency_display( $purchase_log['wpec_taxes_total'] , array( 'display_as_html' => false ) )."\n\r";
|
251 |
}
|
252 |
+
$total_shipping_html.= sprintf(__( 'Total Shipping: %s
|
253 |
+
', 'wpsc' ), wpsc_currency_display( $total_shipping ));
|
254 |
+
$total_price_html.= sprintf(__( 'Total: %s
|
255 |
+
', 'wpsc' ), wpsc_currency_display( $total ) );
|
256 |
+
$report_id = sprintf(__("Purchase # %s
|
257 |
+
"), $purchase_log['id']);
|
258 |
|
259 |
if ( isset( $_GET['ti'] ) ) {
|
260 |
$message.= "\n\r" . __( 'Your Transaction ID', 'wpsc' ) . ": " . $_GET['ti'];
|
wpsc-theme/functions/wpsc-user_log_functions.php
CHANGED
@@ -141,11 +141,11 @@ function wpsc_display_form_fields() {
|
|
141 |
if ( !empty( $form_field['unique_name'] ) ) {
|
142 |
$ff_tag = $form_field['unique_name'];
|
143 |
} else {
|
144 |
-
$ff_tag = htmlentities( stripslashes( strtolower( str_replace( ' ', '-', $form_field['name'] ) ) ) );
|
145 |
}
|
146 |
|
147 |
if(!empty($meta_data[$form_field['id']]) && !is_array($meta_data[$form_field['id']]))
|
148 |
-
$meta_data[$form_field['id']] = htmlentities( stripslashes( $meta_data[$form_field['id']] ), ENT_QUOTES );
|
149 |
|
150 |
if ( $form_field['type'] == 'heading' ) {
|
151 |
echo "
|
@@ -314,21 +314,9 @@ function wpsc_has_purchases() {
|
|
314 |
* this finds the earliest timedit-profile in the shopping cart and sorts out the timestamp system for the month by month display
|
315 |
*/
|
316 |
|
317 |
-
/* $sql = "SELECT COUNT(*) AS `count` FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `date`!='' ORDER BY `date` DESC";
|
318 |
-
$purchase_count = $wpdb->get_results( $sql, ARRAY_A );*/
|
319 |
-
|
320 |
$earliest_record_sql = "SELECT MIN(`date`) AS `date` FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `date`!=''";
|
321 |
$earliest_record = $wpdb->get_results( $earliest_record_sql, ARRAY_A );
|
322 |
|
323 |
-
/*$current_timestamp = time();
|
324 |
-
$earliest_timestamp = $earliest_record[0]['date'];
|
325 |
-
|
326 |
-
$current_year = date( "Y" );
|
327 |
-
$earliest_year = date( "Y", $earliest_timestamp );
|
328 |
-
|
329 |
-
$date_list[0]['start'] = $start_timestamp;
|
330 |
-
$date_list[0]['end'] = $end_timestamp;*/
|
331 |
-
|
332 |
if ( $earliest_record[0]['date'] != null ) {
|
333 |
$form_sql = "SELECT * FROM `" . WPSC_TABLE_CHECKOUT_FORMS . "` WHERE `active` = '1' AND `display_log` = '1';";
|
334 |
$col_count = 4; //+ count( $form_data );
|
@@ -449,7 +437,7 @@ function wpsc_user_details() {
|
|
449 |
$parsed = $parsed[0]['children'][0]['children'];
|
450 |
if ( $purchase['track_id'] != null ) {
|
451 |
echo "<br /><br />";
|
452 |
-
echo " <strong class='form_group'>" . __( 'Shipping
|
453 |
echo "<table>";
|
454 |
foreach ( (array)$parsed as $parse ) {
|
455 |
if ( $parse['name'] == "TRACKSUMMARY" )
|
@@ -541,8 +529,7 @@ function wpsc_user_details() {
|
|
541 |
$gst = $cart_row['tax_charged'];
|
542 |
if($gst > 0)
|
543 |
$endtotal += $gst * $cart_row['quantity'];
|
544 |
-
|
545 |
-
$endtotal += $cart_row['quantity'];
|
546 |
echo wpsc_currency_display( $gst , array('display_as_html' => false) );
|
547 |
echo " </td>";
|
548 |
|
141 |
if ( !empty( $form_field['unique_name'] ) ) {
|
142 |
$ff_tag = $form_field['unique_name'];
|
143 |
} else {
|
144 |
+
$ff_tag = htmlentities( stripslashes( strtolower( str_replace( ' ', '-', $form_field['name'] ) ) ), ENT_QUOTES, 'UTF-8' );
|
145 |
}
|
146 |
|
147 |
if(!empty($meta_data[$form_field['id']]) && !is_array($meta_data[$form_field['id']]))
|
148 |
+
$meta_data[$form_field['id']] = htmlentities( stripslashes( $meta_data[$form_field['id']] ), ENT_QUOTES, 'UTF-8' );
|
149 |
|
150 |
if ( $form_field['type'] == 'heading' ) {
|
151 |
echo "
|
314 |
* this finds the earliest timedit-profile in the shopping cart and sorts out the timestamp system for the month by month display
|
315 |
*/
|
316 |
|
|
|
|
|
|
|
317 |
$earliest_record_sql = "SELECT MIN(`date`) AS `date` FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `date`!=''";
|
318 |
$earliest_record = $wpdb->get_results( $earliest_record_sql, ARRAY_A );
|
319 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
if ( $earliest_record[0]['date'] != null ) {
|
321 |
$form_sql = "SELECT * FROM `" . WPSC_TABLE_CHECKOUT_FORMS . "` WHERE `active` = '1' AND `display_log` = '1';";
|
322 |
$col_count = 4; //+ count( $form_data );
|
437 |
$parsed = $parsed[0]['children'][0]['children'];
|
438 |
if ( $purchase['track_id'] != null ) {
|
439 |
echo "<br /><br />";
|
440 |
+
echo " <strong class='form_group'>" . __( 'Shipping Address', 'wpsc' ) . "</strong>\n\r";
|
441 |
echo "<table>";
|
442 |
foreach ( (array)$parsed as $parse ) {
|
443 |
if ( $parse['name'] == "TRACKSUMMARY" )
|
529 |
$gst = $cart_row['tax_charged'];
|
530 |
if($gst > 0)
|
531 |
$endtotal += $gst * $cart_row['quantity'];
|
532 |
+
|
|
|
533 |
echo wpsc_currency_display( $gst , array('display_as_html' => false) );
|
534 |
echo " </td>";
|
535 |
|
wpsc-theme/wpsc-cart_widget.php
CHANGED
@@ -64,7 +64,7 @@
|
|
64 |
<a target="_parent" href="<?php echo get_option('shopping_cart_url'); ?>" title="Checkout" class="gocheckout"><?php _e('Checkout', 'wpsc'); ?></a>
|
65 |
<form action="" method="post" class="wpsc_empty_the_cart">
|
66 |
<input type="hidden" name="wpsc_ajax_action" value="empty_cart" />
|
67 |
-
<a target="_parent" href="<?php echo htmlentities(add_query_arg('wpsc_ajax_action', 'empty_cart', remove_query_arg('ajax')), ENT_QUOTES); ?>" class="emptycart" title="Empty Your Cart"><?php _e('Clear cart', 'wpsc'); ?></a>
|
68 |
</form>
|
69 |
</td>
|
70 |
</tr>
|
64 |
<a target="_parent" href="<?php echo get_option('shopping_cart_url'); ?>" title="Checkout" class="gocheckout"><?php _e('Checkout', 'wpsc'); ?></a>
|
65 |
<form action="" method="post" class="wpsc_empty_the_cart">
|
66 |
<input type="hidden" name="wpsc_ajax_action" value="empty_cart" />
|
67 |
+
<a target="_parent" href="<?php echo htmlentities(add_query_arg('wpsc_ajax_action', 'empty_cart', remove_query_arg('ajax')), ENT_QUOTES, 'UTF-8'); ?>" class="emptycart" title="Empty Your Cart"><?php _e('Clear cart', 'wpsc'); ?></a>
|
68 |
</form>
|
69 |
</td>
|
70 |
</tr>
|
wpsc-theme/wpsc-category-list.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* wpsc-category-shortcode is the code trigered by using the [showcategories] shortcode
|
4 |
+
* @package wp-e-commerce
|
5 |
+
* @since 3.8
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<div class="wpsc_categories wpsc_category_grid group">
|
9 |
+
<?php wpsc_start_category_query(array('category_group'=> get_option('wpsc_default_category'), 'show_thumbnails'=> 1)); ?>
|
10 |
+
<a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name(); ?>">
|
11 |
+
<?php wpsc_print_category_image(get_option('category_image_width'),get_option('category_image_height')); ?>
|
12 |
+
</a>
|
13 |
+
<?php wpsc_print_subcategory("", ""); ?>
|
14 |
+
<?php wpsc_end_category_query(); ?>
|
15 |
+
|
16 |
+
</div><!--close wpsc_categories-->
|
17 |
+
|
18 |
+
<?php
|
19 |
+
?>
|
wpsc-theme/wpsc-category_widget.php
CHANGED
@@ -26,7 +26,7 @@
|
|
26 |
<div class="wpsc_categorisation_group" id="categorisation_group_<?php echo $category_id; ?>">
|
27 |
<ul class="wpsc_categories wpsc_top_level_categories <?php echo implode( ' ', (array)$provided_classes ); ?>">
|
28 |
<li class="wpsc_category_<?php echo $curr_cat['term_id']; wpsc_print_category_classes($curr_cat); ?>">
|
29 |
-
<?php if(
|
30 |
<a href="<?php echo $link; ?>" class="wpsc_category_image_link"><?php
|
31 |
wpsc_parent_category_image( $show_thumbnails, $category_image , $width, $height, false, $show_name ); ?></a>
|
32 |
<?php } ?>
|
26 |
<div class="wpsc_categorisation_group" id="categorisation_group_<?php echo $category_id; ?>">
|
27 |
<ul class="wpsc_categories wpsc_top_level_categories <?php echo implode( ' ', (array)$provided_classes ); ?>">
|
28 |
<li class="wpsc_category_<?php echo $curr_cat['term_id']; wpsc_print_category_classes($curr_cat); ?>">
|
29 |
+
<?php if(! ($category_image == WPSC_CATEGORY_URL) ){ ?>
|
30 |
<a href="<?php echo $link; ?>" class="wpsc_category_image_link"><?php
|
31 |
wpsc_parent_category_image( $show_thumbnails, $category_image , $width, $height, false, $show_name ); ?></a>
|
32 |
<?php } ?>
|
wpsc-theme/wpsc-default.css
CHANGED
@@ -6,6 +6,7 @@ Version: 3.5
|
|
6 |
Author: Roy Ho
|
7 |
Author URI: http://instinct.co.nz
|
8 |
*/
|
|
|
9 |
/*
|
10 |
* If you delete this file, you can expect your WP e-Commerce installation to break in some manner
|
11 |
* to create your own theme copy, and paste this file, change the names and alter to your tastes
|
@@ -45,7 +46,7 @@ Author URI: http://instinct.co.nz
|
|
45 |
|
46 |
/*-----DEFAULT PRODUCT DISPLAY-----*/
|
47 |
#default_products_page_container {
|
48 |
-
width:
|
49 |
position:relative;
|
50 |
line-height:1.2em;
|
51 |
}
|
@@ -87,7 +88,6 @@ Author URI: http://instinct.co.nz
|
|
87 |
|
88 |
.default_product_display {
|
89 |
margin-bottom:20px;
|
90 |
-
border: 10px solid #efefef;
|
91 |
padding:10px;
|
92 |
position:relative;
|
93 |
}
|
@@ -95,7 +95,7 @@ Author URI: http://instinct.co.nz
|
|
95 |
.default_product_display .imagecol {
|
96 |
margin:0px 5px 0px 0px;
|
97 |
float:left;
|
98 |
-
|
99 |
position:relative;
|
100 |
}
|
101 |
|
@@ -109,48 +109,24 @@ Author URI: http://instinct.co.nz
|
|
109 |
}
|
110 |
|
111 |
.default_product_display .productcol {
|
112 |
-
float:
|
113 |
-
width:70%;
|
114 |
position:relative;
|
115 |
}
|
116 |
|
117 |
.default_product_display h2.prodtitle, #content .default_product_display h2.prodtitle {
|
118 |
-
font-size:20px;
|
119 |
margin:0 0 5px 0;
|
120 |
line-height:1;
|
121 |
clear:none;
|
122 |
}
|
123 |
|
124 |
.default_product_display span.sale {
|
125 |
-
background:url(wpsc-images/sale.png) no-repeat scroll 0 0 transparent;
|
126 |
position:absolute;
|
127 |
top:-10px;
|
128 |
left:-10px;
|
129 |
text-indent:-9999px;
|
130 |
display:block;
|
131 |
-
width:72px;
|
132 |
-
height:72px;
|
133 |
-
}
|
134 |
-
|
135 |
-
.default_product_display h2.prodtitle a,
|
136 |
-
#content .default_product_display h2.prodtitle a{
|
137 |
-
text-decoration:none;
|
138 |
-
color:#000;
|
139 |
-
font-family: Arial, sans-serif;
|
140 |
-
font-weight: bold;
|
141 |
-
}
|
142 |
-
|
143 |
-
.default_product_display h2.prodtitle a.wpsc_edit_product,
|
144 |
-
#content .default_product_display h2.prodtitle a.wpsc_edit_product {
|
145 |
-
color:#069;
|
146 |
}
|
147 |
|
148 |
-
|
149 |
-
.default_product_display h2.prodtitle a:hover, #content .default_product_display h2.prodtitle a:hover, .default_product_display h2.prodtitle a:active, #content .default_product_display h2.prodtitle a:active {
|
150 |
-
text-decoration:none;
|
151 |
-
}
|
152 |
-
|
153 |
-
|
154 |
.default_product_display .wpsc_description, #content .default_product_display .wpsc_description {
|
155 |
font-size:13px;
|
156 |
line-height:1.4em;
|
@@ -289,14 +265,6 @@ Author URI: http://instinct.co.nz
|
|
289 |
color:#666;
|
290 |
}
|
291 |
|
292 |
-
.default_product_display .wpsc_product_price span.currentprice {
|
293 |
-
color:#000;
|
294 |
-
}
|
295 |
-
|
296 |
-
.default_product_display .wpsc_product_price span.pp_price {
|
297 |
-
color:#000;
|
298 |
-
}
|
299 |
-
|
300 |
.default_product_display p.soldout, #content .default_product_display p.soldout {
|
301 |
font-weight:bold;
|
302 |
font-size:14px;
|
@@ -345,40 +313,12 @@ Author URI: http://instinct.co.nz
|
|
345 |
#content .default_product_display .wpsc_buy_button_container,
|
346 |
.single_product_display form.product_form .wpsc_buy_button_container,
|
347 |
#content .single_product_display form.product_form .wpsc_buy_button_container{
|
348 |
-
position:absolute;
|
349 |
-
bottom:0px;
|
350 |
-
right:0px;
|
351 |
text-align: right;
|
352 |
}
|
353 |
|
354 |
-
.default_product_display .wpsc_buy_button,
|
355 |
-
#content .default_product_display .wpsc_buy_button,
|
356 |
-
.single_product_display form.product_form input.wpsc_buy_button,
|
357 |
-
#content .single_product_display form.product_form input.wpsc_buy_button {
|
358 |
-
cursor: pointer;
|
359 |
-
font-size:12px;
|
360 |
-
line-height: 1.5;
|
361 |
-
border:1px solid #777;
|
362 |
-
border-radius:50px;
|
363 |
-
-moz-border-radius:50px;
|
364 |
-
-webkit-border-radius:50px;
|
365 |
-
color:#333;
|
366 |
-
text-decoration:none;
|
367 |
-
background-color: #fff;
|
368 |
-
margin:10px 0px;
|
369 |
-
padding: 2px 6px 3px;
|
370 |
-
}
|
371 |
-
|
372 |
-
.default_product_display .wpsc_buy_button:active,
|
373 |
-
#content .default_product_display .wpsc_buy_button:active,
|
374 |
-
.single_product_display form.product_form input.wpsc_buy_button:active,
|
375 |
-
#content .single_product_display form.product_form input.wpsc_buy_button:active {
|
376 |
-
border:1px solid #bbb;
|
377 |
-
}
|
378 |
-
|
379 |
/*-----LIST VIEW PRODUCT DISPLAY-----*/
|
380 |
#list_view_products_page_container {
|
381 |
-
|
382 |
position:relative;
|
383 |
line-height:1.2em;
|
384 |
}
|
@@ -479,6 +419,10 @@ table.list_productdisplay .quantity_container {
|
|
479 |
display:inline;
|
480 |
}
|
481 |
|
|
|
|
|
|
|
|
|
482 |
table.list_productdisplay .wpsc_buy_button_container {
|
483 |
display:inline;
|
484 |
position:relative;
|
@@ -507,37 +451,10 @@ table.list_productdisplay .oldprice {
|
|
507 |
}
|
508 |
|
509 |
#list_view_products_page_container table.list_productdisplay input.wpsc_buy_button, #content #list_view_products_page_container table.list_productdisplay input.wpsc_buy_button {
|
510 |
-
background-color:#006699;
|
511 |
-
background:-webkit-gradient(
|
512 |
-
linear,
|
513 |
-
left bottom,
|
514 |
-
left top,
|
515 |
-
color-stop(0.76, rgb(73,166,192)),
|
516 |
-
color-stop(1, rgb(125,195,215))
|
517 |
-
);
|
518 |
-
background:-moz-linear-gradient(
|
519 |
-
center bottom,
|
520 |
-
rgb(73,166,192) 76%,
|
521 |
-
rgb(125,195,215) 100%
|
522 |
-
);
|
523 |
-
color:#ffffff;
|
524 |
-
font-size:12px;
|
525 |
-
border-radius:3px;
|
526 |
-
-moz-border-radius:3px;
|
527 |
-
-webkit-border-radius:3px;
|
528 |
-
border:1px solid #29bade;
|
529 |
-
text-shadow:1px 1px 1px rgba(0,0,0,0.8);
|
530 |
padding:5px;
|
531 |
-
*padding:1px;
|
532 |
-
cursor:pointer;
|
533 |
-
line-height:1.2em;
|
534 |
-
}
|
535 |
|
536 |
-
#list_view_products_page_container table.list_productdisplay input.wpsc_buy_button, #content #list_view_products_page_container table.list_productdisplay input.wpsc_buy_button:hover {
|
537 |
-
background:#369;
|
538 |
}
|
539 |
|
540 |
-
|
541 |
table.list_productdisplay h2.prodtitle, #content table.list_productdisplay h2.prodtitle {
|
542 |
font-size:15px;
|
543 |
line-height:1.2em;
|
@@ -574,14 +491,13 @@ table.list_productdisplay p.soldout {
|
|
574 |
|
575 |
.single_product_display {
|
576 |
margin-bottom:20px;
|
577 |
-
border:10px solid #efefef;
|
578 |
padding:10px;
|
579 |
position:relative;
|
580 |
}
|
581 |
|
582 |
-
.
|
583 |
margin-right:5px;
|
584 |
-
|
585 |
float:left;
|
586 |
position:relative;
|
587 |
}
|
@@ -596,9 +512,9 @@ table.list_productdisplay p.soldout {
|
|
596 |
display:block;
|
597 |
}
|
598 |
|
599 |
-
.
|
600 |
float:left;
|
601 |
-
|
602 |
position:relative;
|
603 |
}
|
604 |
|
@@ -664,12 +580,6 @@ table.list_productdisplay p.soldout {
|
|
664 |
padding:2px;
|
665 |
}
|
666 |
|
667 |
-
.single_product_display .wpsc_variation_forms label {
|
668 |
-
color: black;
|
669 |
-
font-family: Georgia, 'Bitstream Charter', serif;
|
670 |
-
font-size: 14px;
|
671 |
-
}
|
672 |
-
|
673 |
.single_product_display .wpsc_variation_forms select {
|
674 |
margin:0;
|
675 |
min-width:100px;
|
@@ -710,15 +620,6 @@ table.list_productdisplay p.soldout {
|
|
710 |
|
711 |
.single_product_display .wpsc_product_price span.oldprice {
|
712 |
text-decoration:line-through;
|
713 |
-
color:#666;
|
714 |
-
}
|
715 |
-
|
716 |
-
.single_product_display .wpsc_product_price span.currentprice {
|
717 |
-
color:#000;
|
718 |
-
}
|
719 |
-
|
720 |
-
.single_product_display .wpsc_product_price span.pp_price {
|
721 |
-
color:#000;
|
722 |
}
|
723 |
|
724 |
.single_product_display p.soldout {
|
@@ -850,9 +751,7 @@ span.rating_saved{
|
|
850 |
|
851 |
/*-----SHOPPING CART-----*/
|
852 |
.shopping-cart-wrapper {
|
853 |
-
font-size:12px;
|
854 |
line-height:1.2em;
|
855 |
-
color:#000000;
|
856 |
position:relative;
|
857 |
}
|
858 |
|
@@ -877,8 +776,6 @@ span.rating_saved{
|
|
877 |
}
|
878 |
|
879 |
.shopping-cart-wrapper .shoppingcart table th {
|
880 |
-
background-color:#F5F5F5;
|
881 |
-
color:#737373;
|
882 |
font-family: Arial, sans-serif;
|
883 |
padding:2px;
|
884 |
}
|
@@ -897,7 +794,6 @@ span.rating_saved{
|
|
897 |
}
|
898 |
|
899 |
.shopping-cart-wrapper .shoppingcart table tbody td, .shopping-cart-wrapper .shoppingcart table tbody td a {
|
900 |
-
color:#0066CC;
|
901 |
text-decoration: none;
|
902 |
}
|
903 |
|
@@ -932,10 +828,6 @@ span.rating_saved{
|
|
932 |
}
|
933 |
|
934 |
.shopping-cart-wrapper .shoppingcart table tbody td.product-name{
|
935 |
-
padding-left:10px;
|
936 |
-
background-image: url(wpsc-images/bulletpoint.gif);
|
937 |
-
background-repeat: no-repeat;
|
938 |
-
background-position: 0 12px;
|
939 |
text-align: left;
|
940 |
max-width: 90px;
|
941 |
word-wrap: break-word;
|
@@ -944,7 +836,6 @@ span.rating_saved{
|
|
944 |
|
945 |
.widget_wpsc_shopping_cart .cart-widget-total td {
|
946 |
border-top:solid 2px #000;
|
947 |
-
background-color: #F5F5F5;
|
948 |
padding: 5px 6px 5px 5px;
|
949 |
}
|
950 |
|
@@ -962,21 +853,6 @@ span.rating_saved{
|
|
962 |
font-size:11px;
|
963 |
}
|
964 |
|
965 |
-
.shopping-cart-wrapper .gocheckout:link, .shopping-cart-wrapper .gocheckout:visited {
|
966 |
-
border:1px solid #aaa;
|
967 |
-
border-radius:20px;
|
968 |
-
-moz-border-radius:20px;
|
969 |
-
-webkit-border-radius:20px;
|
970 |
-
color:#333;
|
971 |
-
padding:2px 5px;
|
972 |
-
text-decoration:none;
|
973 |
-
line-height: 2;
|
974 |
-
}
|
975 |
-
|
976 |
-
.emptycart{
|
977 |
-
padding-right:5px;
|
978 |
-
}
|
979 |
-
|
980 |
.shopping-cart-wrapper .gocheckout:active {
|
981 |
border:1px solid #ccc;
|
982 |
}
|
@@ -984,6 +860,7 @@ span.rating_saved{
|
|
984 |
.shopping-cart-wrapper .empty {
|
985 |
margin-top:10px;
|
986 |
}
|
|
|
987 |
|
988 |
.shopping-cart-wrapper a.visitshop:link, .shopping-cart-wrapper a.visitshop:visited {
|
989 |
text-decoration:underline;
|
@@ -994,6 +871,7 @@ span.rating_saved{
|
|
994 |
.shopping-cart-wrapper .empty {
|
995 |
margin-bottom:5px;
|
996 |
}
|
|
|
997 |
|
998 |
.shopping-cart-wrapper a.visitshop:hover, .shopping-cart-wrapper a.visitshop:active {
|
999 |
text-decoration:none;
|
@@ -1014,17 +892,14 @@ span.rating_saved{
|
|
1014 |
|
1015 |
#checkout_page_container table.checkout_cart tr.header th{
|
1016 |
text-align: center;
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
}
|
1022 |
|
1023 |
#checkout_page_container table.checkout_cart tr.wpsc_total_before_shipping td {
|
1024 |
-
|
1025 |
-
border-top:4px solid #000;
|
1026 |
-
border-bottom: 0px;
|
1027 |
-
font-weight: bold;
|
1028 |
}
|
1029 |
|
1030 |
#checkout_page_container table.checkout_cart tr.wpsc_coupon_row td.coupon_code form{
|
@@ -1056,15 +931,6 @@ span.rating_saved{
|
|
1056 |
margin-bottom: 0px;
|
1057 |
}
|
1058 |
|
1059 |
-
#checkout_page_container h3,
|
1060 |
-
#checkout_page_container h2,
|
1061 |
-
#checkout_page_container label.wpsc_email_address,
|
1062 |
-
#checkout_page_container h4 {
|
1063 |
-
margin: 0px 0px 10px 0px;
|
1064 |
-
font-size: 1.17em;
|
1065 |
-
color:#000;
|
1066 |
-
}
|
1067 |
-
|
1068 |
.wpsc_checkout_table input.text{
|
1069 |
width:255px;
|
1070 |
}
|
@@ -1078,14 +944,8 @@ span.rating_saved{
|
|
1078 |
background-color: #f5f5f5;
|
1079 |
}
|
1080 |
|
1081 |
-
#checkout_page_container .total_price.total_shipping,
|
1082 |
-
#checkout_page_container .total_price {
|
1083 |
-
background-color: #f5f5f5;
|
1084 |
-
}
|
1085 |
-
|
1086 |
#checkout_page_container .total_price td.wpsc_totals{
|
1087 |
-
|
1088 |
-
font-weight: bold;
|
1089 |
}
|
1090 |
|
1091 |
#checkout_page_container .wpsc_make_purchase{
|
@@ -1125,11 +985,6 @@ background-color: #f5f5f5;
|
|
1125 |
border: none;
|
1126 |
}
|
1127 |
|
1128 |
-
#checkout_page_container table.checkout_cart tr td {
|
1129 |
-
border-top:0px;
|
1130 |
-
border-bottom: 1px solid #e1e1e1;
|
1131 |
-
}
|
1132 |
-
|
1133 |
#checkout_page_container table.checkout_cart tr.wpsc_coupon_row tr {
|
1134 |
border-bottom: 0px;
|
1135 |
}
|
@@ -1164,10 +1019,6 @@ background-color: #f5f5f5;
|
|
1164 |
padding:0;
|
1165 |
}
|
1166 |
|
1167 |
-
#checkout_page_container table.checkout_cart tr.alt, #content #checkout_page_container table.checkout_cart tr.alt {
|
1168 |
-
background-color:#f8f8f8;
|
1169 |
-
}
|
1170 |
-
|
1171 |
#content #checkout_page_container table.checkout_cart tr.wpsc_coupon_row td{
|
1172 |
padding-top:15px;
|
1173 |
padding-bottom: 15px;
|
@@ -1259,6 +1110,19 @@ background-color: #f5f5f5;
|
|
1259 |
|
1260 |
}
|
1261 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1262 |
.clear{
|
1263 |
clear:both;
|
1264 |
}
|
6 |
Author: Roy Ho
|
7 |
Author URI: http://instinct.co.nz
|
8 |
*/
|
9 |
+
|
10 |
/*
|
11 |
* If you delete this file, you can expect your WP e-Commerce installation to break in some manner
|
12 |
* to create your own theme copy, and paste this file, change the names and alter to your tastes
|
46 |
|
47 |
/*-----DEFAULT PRODUCT DISPLAY-----*/
|
48 |
#default_products_page_container {
|
49 |
+
width:100%;
|
50 |
position:relative;
|
51 |
line-height:1.2em;
|
52 |
}
|
88 |
|
89 |
.default_product_display {
|
90 |
margin-bottom:20px;
|
|
|
91 |
padding:10px;
|
92 |
position:relative;
|
93 |
}
|
95 |
.default_product_display .imagecol {
|
96 |
margin:0px 5px 0px 0px;
|
97 |
float:left;
|
98 |
+
|
99 |
position:relative;
|
100 |
}
|
101 |
|
109 |
}
|
110 |
|
111 |
.default_product_display .productcol {
|
112 |
+
float:right;
|
|
|
113 |
position:relative;
|
114 |
}
|
115 |
|
116 |
.default_product_display h2.prodtitle, #content .default_product_display h2.prodtitle {
|
|
|
117 |
margin:0 0 5px 0;
|
118 |
line-height:1;
|
119 |
clear:none;
|
120 |
}
|
121 |
|
122 |
.default_product_display span.sale {
|
|
|
123 |
position:absolute;
|
124 |
top:-10px;
|
125 |
left:-10px;
|
126 |
text-indent:-9999px;
|
127 |
display:block;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
}
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
.default_product_display .wpsc_description, #content .default_product_display .wpsc_description {
|
131 |
font-size:13px;
|
132 |
line-height:1.4em;
|
265 |
color:#666;
|
266 |
}
|
267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
.default_product_display p.soldout, #content .default_product_display p.soldout {
|
269 |
font-weight:bold;
|
270 |
font-size:14px;
|
313 |
#content .default_product_display .wpsc_buy_button_container,
|
314 |
.single_product_display form.product_form .wpsc_buy_button_container,
|
315 |
#content .single_product_display form.product_form .wpsc_buy_button_container{
|
|
|
|
|
|
|
316 |
text-align: right;
|
317 |
}
|
318 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
319 |
/*-----LIST VIEW PRODUCT DISPLAY-----*/
|
320 |
#list_view_products_page_container {
|
321 |
+
/* width:650px; */
|
322 |
position:relative;
|
323 |
line-height:1.2em;
|
324 |
}
|
419 |
display:inline;
|
420 |
}
|
421 |
|
422 |
+
#content, #content input.wpsc_buy_button{
|
423 |
+
font-size: 12px;
|
424 |
+
}
|
425 |
+
|
426 |
table.list_productdisplay .wpsc_buy_button_container {
|
427 |
display:inline;
|
428 |
position:relative;
|
451 |
}
|
452 |
|
453 |
#list_view_products_page_container table.list_productdisplay input.wpsc_buy_button, #content #list_view_products_page_container table.list_productdisplay input.wpsc_buy_button {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
454 |
padding:5px;
|
|
|
|
|
|
|
|
|
455 |
|
|
|
|
|
456 |
}
|
457 |
|
|
|
458 |
table.list_productdisplay h2.prodtitle, #content table.list_productdisplay h2.prodtitle {
|
459 |
font-size:15px;
|
460 |
line-height:1.2em;
|
491 |
|
492 |
.single_product_display {
|
493 |
margin-bottom:20px;
|
|
|
494 |
padding:10px;
|
495 |
position:relative;
|
496 |
}
|
497 |
|
498 |
+
.imagecol {
|
499 |
margin-right:5px;
|
500 |
+
/* width:25%; */
|
501 |
float:left;
|
502 |
position:relative;
|
503 |
}
|
512 |
display:block;
|
513 |
}
|
514 |
|
515 |
+
.productcol {
|
516 |
float:left;
|
517 |
+
/* width:70%; */
|
518 |
position:relative;
|
519 |
}
|
520 |
|
580 |
padding:2px;
|
581 |
}
|
582 |
|
|
|
|
|
|
|
|
|
|
|
|
|
583 |
.single_product_display .wpsc_variation_forms select {
|
584 |
margin:0;
|
585 |
min-width:100px;
|
620 |
|
621 |
.single_product_display .wpsc_product_price span.oldprice {
|
622 |
text-decoration:line-through;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
623 |
}
|
624 |
|
625 |
.single_product_display p.soldout {
|
751 |
|
752 |
/*-----SHOPPING CART-----*/
|
753 |
.shopping-cart-wrapper {
|
|
|
754 |
line-height:1.2em;
|
|
|
755 |
position:relative;
|
756 |
}
|
757 |
|
776 |
}
|
777 |
|
778 |
.shopping-cart-wrapper .shoppingcart table th {
|
|
|
|
|
779 |
font-family: Arial, sans-serif;
|
780 |
padding:2px;
|
781 |
}
|
794 |
}
|
795 |
|
796 |
.shopping-cart-wrapper .shoppingcart table tbody td, .shopping-cart-wrapper .shoppingcart table tbody td a {
|
|
|
797 |
text-decoration: none;
|
798 |
}
|
799 |
|
828 |
}
|
829 |
|
830 |
.shopping-cart-wrapper .shoppingcart table tbody td.product-name{
|
|
|
|
|
|
|
|
|
831 |
text-align: left;
|
832 |
max-width: 90px;
|
833 |
word-wrap: break-word;
|
836 |
|
837 |
.widget_wpsc_shopping_cart .cart-widget-total td {
|
838 |
border-top:solid 2px #000;
|
|
|
839 |
padding: 5px 6px 5px 5px;
|
840 |
}
|
841 |
|
853 |
font-size:11px;
|
854 |
}
|
855 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
856 |
.shopping-cart-wrapper .gocheckout:active {
|
857 |
border:1px solid #ccc;
|
858 |
}
|
860 |
.shopping-cart-wrapper .empty {
|
861 |
margin-top:10px;
|
862 |
}
|
863 |
+
/*
|
864 |
|
865 |
.shopping-cart-wrapper a.visitshop:link, .shopping-cart-wrapper a.visitshop:visited {
|
866 |
text-decoration:underline;
|
871 |
.shopping-cart-wrapper .empty {
|
872 |
margin-bottom:5px;
|
873 |
}
|
874 |
+
*/
|
875 |
|
876 |
.shopping-cart-wrapper a.visitshop:hover, .shopping-cart-wrapper a.visitshop:active {
|
877 |
text-decoration:none;
|
892 |
|
893 |
#checkout_page_container table.checkout_cart tr.header th{
|
894 |
text-align: center;
|
895 |
+
}
|
896 |
+
|
897 |
+
#checkout_page_container table.checkout_cart tr.header th:first-child{
|
898 |
+
text-align: left;
|
899 |
}
|
900 |
|
901 |
#checkout_page_container table.checkout_cart tr.wpsc_total_before_shipping td {
|
902 |
+
|
|
|
|
|
|
|
903 |
}
|
904 |
|
905 |
#checkout_page_container table.checkout_cart tr.wpsc_coupon_row td.coupon_code form{
|
931 |
margin-bottom: 0px;
|
932 |
}
|
933 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
934 |
.wpsc_checkout_table input.text{
|
935 |
width:255px;
|
936 |
}
|
944 |
background-color: #f5f5f5;
|
945 |
}
|
946 |
|
|
|
|
|
|
|
|
|
|
|
947 |
#checkout_page_container .total_price td.wpsc_totals{
|
948 |
+
|
|
|
949 |
}
|
950 |
|
951 |
#checkout_page_container .wpsc_make_purchase{
|
985 |
border: none;
|
986 |
}
|
987 |
|
|
|
|
|
|
|
|
|
|
|
988 |
#checkout_page_container table.checkout_cart tr.wpsc_coupon_row tr {
|
989 |
border-bottom: 0px;
|
990 |
}
|
1019 |
padding:0;
|
1020 |
}
|
1021 |
|
|
|
|
|
|
|
|
|
1022 |
#content #checkout_page_container table.checkout_cart tr.wpsc_coupon_row td{
|
1023 |
padding-top:15px;
|
1024 |
padding-bottom: 15px;
|
1110 |
|
1111 |
}
|
1112 |
|
1113 |
+
#shippingSameBilling{
|
1114 |
+
position:relative;
|
1115 |
+
right:10px;
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
#shippingsameasbillingmessage{
|
1119 |
+
display:none;
|
1120 |
+
}
|
1121 |
+
|
1122 |
+
.wpsc_no_image{
|
1123 |
+
display: none;
|
1124 |
+
}
|
1125 |
+
|
1126 |
.clear{
|
1127 |
clear:both;
|
1128 |
}
|
wpsc-theme/wpsc-grid_view.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
global $
|
3 |
$image_width = get_option('product_image_width');
|
4 |
$image_height = get_option('product_image_height');
|
5 |
?>
|
@@ -86,7 +86,7 @@ $image_height = get_option('product_image_height');
|
|
86 |
<?php endif; ?>
|
87 |
<div class="price_container">
|
88 |
<?php if(wpsc_product_on_special()) : ?>
|
89 |
-
<p class="pricedisplay <?php echo wpsc_the_product_id(); ?>"><?php _e('Price', 'wpsc'); ?>:<span class="oldprice"><?php echo wpsc_product_normal_price(); ?></span></p>
|
90 |
<?php endif; ?>
|
91 |
<p class="pricedisplay <?php echo wpsc_the_product_id(); ?>"><?php _e('Price', 'wpsc'); ?>:<span class="currentprice"><?php echo wpsc_the_product_price(); ?></span></p>
|
92 |
<?php if(wpsc_show_pnp()) : ?>
|
@@ -134,7 +134,7 @@ $image_height = get_option('product_image_height');
|
|
134 |
|
135 |
|
136 |
<div class="wpsc_loading_animation">
|
137 |
-
<img title="Loading" alt="Loading" src="<?php echo
|
138 |
<?php _e('Updating cart...', 'wpsc'); ?>
|
139 |
</div><!--close wpsc_loading_animation-->
|
140 |
</form>
|
1 |
<?php
|
2 |
+
global $wp_query;
|
3 |
$image_width = get_option('product_image_width');
|
4 |
$image_height = get_option('product_image_height');
|
5 |
?>
|
86 |
<?php endif; ?>
|
87 |
<div class="price_container">
|
88 |
<?php if(wpsc_product_on_special()) : ?>
|
89 |
+
<p class="pricedisplay <?php echo wpsc_the_product_id(); ?>"><?php _e('Old Price', 'wpsc'); ?>:<span class="oldprice"><?php echo wpsc_product_normal_price(); ?></span></p>
|
90 |
<?php endif; ?>
|
91 |
<p class="pricedisplay <?php echo wpsc_the_product_id(); ?>"><?php _e('Price', 'wpsc'); ?>:<span class="currentprice"><?php echo wpsc_the_product_price(); ?></span></p>
|
92 |
<?php if(wpsc_show_pnp()) : ?>
|
134 |
|
135 |
|
136 |
<div class="wpsc_loading_animation">
|
137 |
+
<img title="Loading" alt="Loading" src="<?php echo wpsc_loading_animation_url(); ?>" />
|
138 |
<?php _e('Updating cart...', 'wpsc'); ?>
|
139 |
</div><!--close wpsc_loading_animation-->
|
140 |
</form>
|
wpsc-theme/wpsc-list_view.php
CHANGED
@@ -88,7 +88,7 @@ global $wp_query, $wpdb;
|
|
88 |
<td>
|
89 |
<?php do_action('wpsc_product_before_description', wpsc_the_product_id(), $wp_query->post); ?>
|
90 |
</td>
|
91 |
-
<td>
|
92 |
<?php if(wpsc_product_on_special()) : ?>
|
93 |
<p class="oldprice"><?php echo wpsc_product_normal_price(); ?></p>
|
94 |
<?php endif; ?>
|
@@ -124,7 +124,7 @@ global $wp_query, $wpdb;
|
|
124 |
<input type="submit" value="<?php _e('Add To Cart', 'wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button" />
|
125 |
<?php endif; ?>
|
126 |
<div class="wpsc_loading_animation">
|
127 |
-
<img title="Loading" alt="Loading" src="<?php echo
|
128 |
<?php _e('Updating cart...', 'wpsc'); ?>
|
129 |
</div><!--close wpsc_loading_animation-->
|
130 |
</div><!--close wpsc_buy_button_container-->
|
88 |
<td>
|
89 |
<?php do_action('wpsc_product_before_description', wpsc_the_product_id(), $wp_query->post); ?>
|
90 |
</td>
|
91 |
+
<td class='wpsc_price_td'>
|
92 |
<?php if(wpsc_product_on_special()) : ?>
|
93 |
<p class="oldprice"><?php echo wpsc_product_normal_price(); ?></p>
|
94 |
<?php endif; ?>
|
124 |
<input type="submit" value="<?php _e('Add To Cart', 'wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button" />
|
125 |
<?php endif; ?>
|
126 |
<div class="wpsc_loading_animation">
|
127 |
+
<img title="Loading" alt="Loading" src="<?php echo wpsc_loading_animation_url(); ?>" />
|
128 |
<?php _e('Updating cart...', 'wpsc'); ?>
|
129 |
</div><!--close wpsc_loading_animation-->
|
130 |
</div><!--close wpsc_buy_button_container-->
|
wpsc-theme/wpsc-products_page.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
global $
|
3 |
/*
|
4 |
* Most functions called in this page can be found in the wpsc_query.php file
|
5 |
*/
|
@@ -13,7 +13,7 @@ global $wpsc_query, $wpdb, $wp_query;
|
|
13 |
<?php if(wpsc_category_grid_view()) :?>
|
14 |
<div class="wpsc_categories wpsc_category_grid group">
|
15 |
<?php wpsc_start_category_query(array('category_group'=> get_option('wpsc_default_category'), 'show_thumbnails'=> 1)); ?>
|
16 |
-
<a href="<?php wpsc_print_category_url(
|
17 |
<?php wpsc_print_category_image(get_option('category_image_width'),get_option('category_image_height')); ?>
|
18 |
</a>
|
19 |
<?php wpsc_print_subcategory("", ""); ?>
|
@@ -69,12 +69,19 @@ global $wpsc_query, $wpdb, $wp_query;
|
|
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 |
<?php if(wpsc_show_thumbnails()) :?>
|
74 |
<div class="imagecol" id="imagecol_<?php echo wpsc_the_product_id(); ?>">
|
75 |
<?php if(wpsc_the_product_thumbnail()) :
|
76 |
?>
|
77 |
-
<a rel="
|
78 |
<img class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_thumbnail(); ?>"/>
|
79 |
|
80 |
</a>
|
@@ -91,14 +98,7 @@ global $wpsc_query, $wpdb, $wp_query;
|
|
91 |
</div><!--close imagecol-->
|
92 |
<?php endif; ?>
|
93 |
<div class="productcol">
|
94 |
-
|
95 |
-
<?php if(get_option('hide_name_link') == 1) : ?>
|
96 |
-
<?php echo wpsc_the_product_title(); ?>
|
97 |
-
<?php else: ?>
|
98 |
-
<a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?>"><?php echo wpsc_the_product_title(); ?></a>
|
99 |
-
<?php endif; ?>
|
100 |
-
<?php echo wpsc_edit_the_product_link(); ?>
|
101 |
-
</h2>
|
102 |
|
103 |
|
104 |
<?php
|
@@ -125,7 +125,7 @@ global $wpsc_query, $wpdb, $wp_query;
|
|
125 |
<?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
|
126 |
<?php $action = wpsc_product_external_link(wpsc_the_product_id()); ?>
|
127 |
<?php else: ?>
|
128 |
-
<?php $action = htmlentities(wpsc_this_page_url(),ENT_QUOTES); ?>
|
129 |
<?php endif; ?>
|
130 |
<form class="product_form" enctype="multipart/form-data" action="<?php echo $action; ?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>" id="product_<?php echo wpsc_the_product_id(); ?>" >
|
131 |
<?php /** the variation group HTML and loop */?>
|
@@ -174,7 +174,7 @@ global $wpsc_query, $wpdb, $wp_query;
|
|
174 |
|
175 |
<?php else : ?>
|
176 |
<?php if(wpsc_product_on_special()) : ?>
|
177 |
-
<p class="pricedisplay product_<?php echo wpsc_the_product_id(); ?>"><?php _e('Old
|
178 |
<?php endif; ?>
|
179 |
<p class="pricedisplay product_<?php echo wpsc_the_product_id(); ?>"><?php _e('Price', 'wpsc'); ?>: <span id='product_price_<?php echo wpsc_the_product_id(); ?>' class="currentprice pricedisplay"><?php echo wpsc_the_product_price(); ?></span></p>
|
180 |
<?php if(wpsc_product_on_special()) : ?>
|
@@ -200,7 +200,7 @@ global $wpsc_query, $wpdb, $wp_query;
|
|
200 |
<?php if(wpsc_product_has_stock()) : ?>
|
201 |
<div class="wpsc_buy_button_container">
|
202 |
<div class="wpsc_loading_animation">
|
203 |
-
<img title="Loading" alt="Loading" src="<?php echo
|
204 |
<?php _e('Updating cart...', 'wpsc'); ?>
|
205 |
</div><!--close wpsc_loading_animation-->
|
206 |
<?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
|
@@ -212,6 +212,9 @@ global $wpsc_query, $wpdb, $wp_query;
|
|
212 |
</div><!--close wpsc_buy_button_container-->
|
213 |
<?php endif ; ?>
|
214 |
<?php endif ; ?>
|
|
|
|
|
|
|
215 |
</form><!--close product_form-->
|
216 |
|
217 |
<?php if((get_option('hide_addtocart_button') == 0) && (get_option('addtocart_or_buynow')=='1')) : ?>
|
1 |
<?php
|
2 |
+
global $wp_query;
|
3 |
/*
|
4 |
* Most functions called in this page can be found in the wpsc_query.php file
|
5 |
*/
|
13 |
<?php if(wpsc_category_grid_view()) :?>
|
14 |
<div class="wpsc_categories wpsc_category_grid group">
|
15 |
<?php wpsc_start_category_query(array('category_group'=> get_option('wpsc_default_category'), 'show_thumbnails'=> 1)); ?>
|
16 |
+
<a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name(); ?>">
|
17 |
<?php wpsc_print_category_image(get_option('category_image_width'),get_option('category_image_height')); ?>
|
18 |
</a>
|
19 |
<?php wpsc_print_subcategory("", ""); ?>
|
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) : ?>
|
75 |
+
<?php echo wpsc_the_product_title(); ?>
|
76 |
+
<?php else: ?>
|
77 |
+
<a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?>"><?php echo wpsc_the_product_title(); ?></a>
|
78 |
+
<?php endif; ?>
|
79 |
+
</h2>
|
80 |
<?php if(wpsc_show_thumbnails()) :?>
|
81 |
<div class="imagecol" id="imagecol_<?php echo wpsc_the_product_id(); ?>">
|
82 |
<?php if(wpsc_the_product_thumbnail()) :
|
83 |
?>
|
84 |
+
<a rel="<?php echo wpsc_the_product_title(); ?>" class="<?php echo wpsc_the_product_image_link_classes(); ?>" href="<?php echo wpsc_the_product_image(); ?>">
|
85 |
<img class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_thumbnail(); ?>"/>
|
86 |
|
87 |
</a>
|
98 |
</div><!--close imagecol-->
|
99 |
<?php endif; ?>
|
100 |
<div class="productcol">
|
101 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
|
104 |
<?php
|
125 |
<?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
|
126 |
<?php $action = wpsc_product_external_link(wpsc_the_product_id()); ?>
|
127 |
<?php else: ?>
|
128 |
+
<?php $action = htmlentities(wpsc_this_page_url(), ENT_QUOTES, 'UTF-8' ); ?>
|
129 |
<?php endif; ?>
|
130 |
<form class="product_form" enctype="multipart/form-data" action="<?php echo $action; ?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>" id="product_<?php echo wpsc_the_product_id(); ?>" >
|
131 |
<?php /** the variation group HTML and loop */?>
|
174 |
|
175 |
<?php else : ?>
|
176 |
<?php if(wpsc_product_on_special()) : ?>
|
177 |
+
<p class="pricedisplay product_<?php echo wpsc_the_product_id(); ?>"><?php _e('Old Price', 'wpsc'); ?>: <span class="oldprice" id="old_product_price_<?php echo wpsc_the_product_id(); ?>"><?php echo wpsc_product_normal_price(); ?></span></p>
|
178 |
<?php endif; ?>
|
179 |
<p class="pricedisplay product_<?php echo wpsc_the_product_id(); ?>"><?php _e('Price', 'wpsc'); ?>: <span id='product_price_<?php echo wpsc_the_product_id(); ?>' class="currentprice pricedisplay"><?php echo wpsc_the_product_price(); ?></span></p>
|
180 |
<?php if(wpsc_product_on_special()) : ?>
|
200 |
<?php if(wpsc_product_has_stock()) : ?>
|
201 |
<div class="wpsc_buy_button_container">
|
202 |
<div class="wpsc_loading_animation">
|
203 |
+
<img title="Loading" alt="Loading" src="<?php echo wpsc_loading_animation_url(); ?>" />
|
204 |
<?php _e('Updating cart...', 'wpsc'); ?>
|
205 |
</div><!--close wpsc_loading_animation-->
|
206 |
<?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
|
212 |
</div><!--close wpsc_buy_button_container-->
|
213 |
<?php endif ; ?>
|
214 |
<?php endif ; ?>
|
215 |
+
<div class="entry-utility wpsc_product_utility">
|
216 |
+
<?php edit_post_link( __( 'Edit', 'wpsc' ), '<span class="edit-link">', '</span>' ); ?>
|
217 |
+
</div>
|
218 |
</form><!--close product_form-->
|
219 |
|
220 |
<?php if((get_option('hide_addtocart_button') == 0) && (get_option('addtocart_or_buynow')=='1')) : ?>
|
wpsc-theme/wpsc-shopping_cart_page.php
CHANGED
@@ -232,7 +232,7 @@ endif;
|
|
232 |
</fieldset>
|
233 |
</div>
|
234 |
<?php endif; ?>
|
235 |
-
<form class='wpsc_checkout_forms' action='' method='post' enctype="multipart/form-data">
|
236 |
|
237 |
<?php
|
238 |
/**
|
@@ -275,7 +275,7 @@ endif;
|
|
275 |
<?php
|
276 |
endif;
|
277 |
$_SESSION['wpsc_checkout_misc_error_messages'] = array(); ?>
|
278 |
-
|
279 |
<table class='wpsc_checkout_table table-1'>
|
280 |
<?php $i = 0;
|
281 |
while (wpsc_have_checkout_items()) : wpsc_the_checkout_item(); ?>
|
@@ -296,8 +296,19 @@ endif;
|
|
296 |
<?php if(wpsc_is_shipping_details()):?>
|
297 |
<tr class='same_as_shipping_row'>
|
298 |
<td colspan ='2'>
|
299 |
-
|
300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
</td>
|
302 |
</tr>
|
303 |
<?php endif;
|
@@ -336,20 +347,21 @@ endif;
|
|
336 |
</tr>
|
337 |
<?php
|
338 |
}elseif( $wpsc_checkout->checkout_item->unique_name == 'billingemail'){ ?>
|
339 |
-
|
|
|
340 |
<p class='<?php echo wpsc_checkout_form_element_id(); ?>'>
|
341 |
-
<label class='wpsc_email_address' for='
|
342 |
-
|
343 |
</label>
|
344 |
-
<p class=
|
345 |
-
<img src=
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
</div>
|
351 |
}else{ ?>
|
352 |
-
|
353 |
<td class='<?php echo wpsc_checkout_form_element_id(); ?>'>
|
354 |
<label for='<?php echo wpsc_checkout_form_element_id(); ?>'>
|
355 |
<?php echo wpsc_checkout_form_name();?>
|
@@ -366,6 +378,14 @@ endif;
|
|
366 |
<?php }//endif; ?>
|
367 |
|
368 |
<?php endwhile; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
|
370 |
<?php if (wpsc_show_find_us()) : ?>
|
371 |
<tr>
|
@@ -402,7 +422,9 @@ endif;
|
|
402 |
<?php endif; ?>
|
403 |
</div>
|
404 |
<?php endwhile; ?>
|
|
|
405 |
<?php else: // otherwise, there is no choice, stick in a hidden form ?>
|
|
|
406 |
<?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?>
|
407 |
<input name='custom_gateway' value='<?php echo wpsc_gateway_internal_name();?>' type='hidden' />
|
408 |
|
232 |
</fieldset>
|
233 |
</div>
|
234 |
<?php endif; ?>
|
235 |
+
<form class='wpsc_checkout_forms' action='<?php echo get_option('shopping_cart_url'); ?>' method='post' enctype="multipart/form-data">
|
236 |
|
237 |
<?php
|
238 |
/**
|
275 |
<?php
|
276 |
endif;
|
277 |
$_SESSION['wpsc_checkout_misc_error_messages'] = array(); ?>
|
278 |
+
<?php ob_start(); ?>
|
279 |
<table class='wpsc_checkout_table table-1'>
|
280 |
<?php $i = 0;
|
281 |
while (wpsc_have_checkout_items()) : wpsc_the_checkout_item(); ?>
|
296 |
<?php if(wpsc_is_shipping_details()):?>
|
297 |
<tr class='same_as_shipping_row'>
|
298 |
<td colspan ='2'>
|
299 |
+
<?php $checked = '';
|
300 |
+
if(isset($_POST['shippingSameBilling']) && $_POST['shippingSameBilling'])
|
301 |
+
$_SESSION['shippingSameBilling'] = true;
|
302 |
+
elseif(isset($_POST['submit']) && !isset($_POST['shippingSameBilling']))
|
303 |
+
$_SESSION['shippingSameBilling'] = false;
|
304 |
+
|
305 |
+
|
306 |
+
if($_SESSION['shippingSameBilling'])
|
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; ?> />
|
311 |
+
<br/><span id="shippingsameasbillingmessage"><?php _e('Your order will be shipped to the billing address', 'wpsc'); ?></span>
|
312 |
</td>
|
313 |
</tr>
|
314 |
<?php endif;
|
347 |
</tr>
|
348 |
<?php
|
349 |
}elseif( $wpsc_checkout->checkout_item->unique_name == 'billingemail'){ ?>
|
350 |
+
<?php $email_markup =
|
351 |
+
"<div class='wpsc_email_address'>
|
352 |
<p class='<?php echo wpsc_checkout_form_element_id(); ?>'>
|
353 |
+
<label class='wpsc_email_address' for='" . wpsc_checkout_form_element_id() . "'>
|
354 |
+
" . __('Enter your email address', 'wpsc') . "
|
355 |
</label>
|
356 |
+
<p class='wpsc_email_address_p'>
|
357 |
+
<img src='https://secure.gravatar.com/avatar/empty?s=60&d=mm' id='wpsc_checkout_gravatar' />
|
358 |
+
" . wpsc_checkout_form_field();
|
359 |
+
|
360 |
+
if(wpsc_the_checkout_item_error() != '')
|
361 |
+
$email_markup .= "<p class='validation-error'>" . wpsc_the_checkout_item_error() . "</p>";
|
362 |
+
$email_markup .= "</div>";
|
363 |
}else{ ?>
|
364 |
+
<tr>
|
365 |
<td class='<?php echo wpsc_checkout_form_element_id(); ?>'>
|
366 |
<label for='<?php echo wpsc_checkout_form_element_id(); ?>'>
|
367 |
<?php echo wpsc_checkout_form_name();?>
|
378 |
<?php }//endif; ?>
|
379 |
|
380 |
<?php endwhile; ?>
|
381 |
+
|
382 |
+
<?php
|
383 |
+
$buffer_contents = ob_get_contents();
|
384 |
+
ob_end_clean();
|
385 |
+
if(isset($email_markup))
|
386 |
+
echo $email_markup;
|
387 |
+
echo $buffer_contents;
|
388 |
+
?>
|
389 |
|
390 |
<?php if (wpsc_show_find_us()) : ?>
|
391 |
<tr>
|
422 |
<?php endif; ?>
|
423 |
</div>
|
424 |
<?php endwhile; ?>
|
425 |
+
</tr></td>
|
426 |
<?php else: // otherwise, there is no choice, stick in a hidden form ?>
|
427 |
+
<tr><td colspan="2" class='wpsc_gateway_container'>
|
428 |
<?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?>
|
429 |
<input name='custom_gateway' value='<?php echo wpsc_gateway_internal_name();?>' type='hidden' />
|
430 |
|
wpsc-theme/wpsc-single_product.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
// Setup globals
|
3 |
// @todo: Get these out of template
|
4 |
-
global $
|
5 |
|
6 |
// Setup image width and height variables
|
7 |
// @todo: Investigate if these are still needed here
|
@@ -29,7 +29,7 @@
|
|
29 |
while ( wpsc_have_products() ) : wpsc_the_product(); ?>
|
30 |
<div class="imagecol">
|
31 |
<?php if ( wpsc_the_product_thumbnail() ) : ?>
|
32 |
-
<a rel="
|
33 |
<img class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_thumbnail(get_option('product_image_width'),get_option('product_image_height'),'','single'); ?>"/>
|
34 |
</a>
|
35 |
<?php
|
@@ -51,23 +51,7 @@
|
|
51 |
<?php do_action( 'wpsc_product_addons', wpsc_the_product_id() ); ?>
|
52 |
<?php if ( wpsc_the_product_additional_description() ) : ?>
|
53 |
<div class="single_additional_description">
|
54 |
-
|
55 |
-
$value = '';
|
56 |
-
$the_addl_desc = wpsc_the_product_additional_description();
|
57 |
-
|
58 |
-
if ( is_serialized( $the_addl_desc ) )
|
59 |
-
$addl_descriptions = @unserialize( $the_addl_desc );
|
60 |
-
else
|
61 |
-
$addl_descriptions = array( 'addl_desc', $the_addl_desc );
|
62 |
-
|
63 |
-
if ( isset( $addl_descriptions['addl_desc'] ) )
|
64 |
-
$value = $addl_descriptions['addl_desc'];
|
65 |
-
|
66 |
-
if( function_exists( 'wpsc_addl_desc_show' ) )
|
67 |
-
echo wpsc_addl_desc_show( $addl_descriptions );
|
68 |
-
else
|
69 |
-
echo stripslashes( wpautop( $the_addl_desc, $br = 1) );
|
70 |
-
?>
|
71 |
</div><!--close single_additional_description-->
|
72 |
<?php endif; ?>
|
73 |
<?php do_action( 'wpsc_product_addon_after_descr', wpsc_the_product_id() ); ?>
|
@@ -153,7 +137,7 @@
|
|
153 |
<input type="text" id="donation_price_<?php echo wpsc_the_product_id(); ?>" name="donation_price" value="<?php echo wpsc_calculate_price(wpsc_the_product_id()); ?>" size="6" />
|
154 |
<?php else : ?>
|
155 |
<?php if(wpsc_product_on_special()) : ?>
|
156 |
-
<p class="pricedisplay <?php echo wpsc_the_product_id(); ?>"><?php _e('Price', 'wpsc'); ?>: <span class="oldprice" id="old_product_price_<?php echo wpsc_the_product_id(); ?>"><?php echo wpsc_product_normal_price(); ?></span></p>
|
157 |
<?php endif; ?>
|
158 |
<p class="pricedisplay <?php echo wpsc_the_product_id(); ?>"><?php _e('Price', 'wpsc'); ?>: <span id='product_price_<?php echo wpsc_the_product_id(); ?>' class="currentprice pricedisplay"><?php echo wpsc_the_product_price(); ?></span></p>
|
159 |
<?php if(wpsc_product_on_special()) : ?>
|
@@ -195,7 +179,7 @@
|
|
195 |
<input type="submit" value="<?php _e('Add To Cart', 'wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
|
196 |
<?php endif; ?>
|
197 |
<div class="wpsc_loading_animation">
|
198 |
-
<img title="Loading" alt="Loading" src="<?php echo
|
199 |
<?php _e('Updating cart...', 'wpsc'); ?>
|
200 |
</div><!--close wpsc_loading_animation-->
|
201 |
</div><!--close wpsc_buy_button_container-->
|
1 |
<?php
|
2 |
// Setup globals
|
3 |
// @todo: Get these out of template
|
4 |
+
global $wp_query;
|
5 |
|
6 |
// Setup image width and height variables
|
7 |
// @todo: Investigate if these are still needed here
|
29 |
while ( wpsc_have_products() ) : wpsc_the_product(); ?>
|
30 |
<div class="imagecol">
|
31 |
<?php if ( wpsc_the_product_thumbnail() ) : ?>
|
32 |
+
<a rel="<?php echo wpsc_the_product_title(); ?>" class="<?php echo wpsc_the_product_image_link_classes(); ?>" href="<?php echo wpsc_the_product_image(); ?>">
|
33 |
<img class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_thumbnail(get_option('product_image_width'),get_option('product_image_height'),'','single'); ?>"/>
|
34 |
</a>
|
35 |
<?php
|
51 |
<?php do_action( 'wpsc_product_addons', wpsc_the_product_id() ); ?>
|
52 |
<?php if ( wpsc_the_product_additional_description() ) : ?>
|
53 |
<div class="single_additional_description">
|
54 |
+
<p><?php echo wpsc_the_product_additional_description(); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
</div><!--close single_additional_description-->
|
56 |
<?php endif; ?>
|
57 |
<?php do_action( 'wpsc_product_addon_after_descr', wpsc_the_product_id() ); ?>
|
137 |
<input type="text" id="donation_price_<?php echo wpsc_the_product_id(); ?>" name="donation_price" value="<?php echo wpsc_calculate_price(wpsc_the_product_id()); ?>" size="6" />
|
138 |
<?php else : ?>
|
139 |
<?php if(wpsc_product_on_special()) : ?>
|
140 |
+
<p class="pricedisplay <?php echo wpsc_the_product_id(); ?>"><?php _e('Old Price', 'wpsc'); ?>: <span class="oldprice" id="old_product_price_<?php echo wpsc_the_product_id(); ?>"><?php echo wpsc_product_normal_price(); ?></span></p>
|
141 |
<?php endif; ?>
|
142 |
<p class="pricedisplay <?php echo wpsc_the_product_id(); ?>"><?php _e('Price', 'wpsc'); ?>: <span id='product_price_<?php echo wpsc_the_product_id(); ?>' class="currentprice pricedisplay"><?php echo wpsc_the_product_price(); ?></span></p>
|
143 |
<?php if(wpsc_product_on_special()) : ?>
|
179 |
<input type="submit" value="<?php _e('Add To Cart', 'wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
|
180 |
<?php endif; ?>
|
181 |
<div class="wpsc_loading_animation">
|
182 |
+
<img title="Loading" alt="Loading" src="<?php echo wpsc_loading_animation_url(); ?>" />
|
183 |
<?php _e('Updating cart...', 'wpsc'); ?>
|
184 |
</div><!--close wpsc_loading_animation-->
|
185 |
</div><!--close wpsc_buy_button_container-->
|
wpsc-theme/wpsc-transaction_results.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* @since WPSC 3.8
|
9 |
*/
|
10 |
|
11 |
-
global $
|
12 |
?>
|
13 |
<div class="wrap">
|
14 |
|
8 |
* @since WPSC 3.8
|
9 |
*/
|
10 |
|
11 |
+
global $purchase_log, $errorcode, $sessionid, $echo_to_screen, $cart, $message_html;
|
12 |
?>
|
13 |
<div class="wrap">
|
14 |
|
wpsc-updates/currency_list.php
CHANGED
@@ -1,158 +1,158 @@
|
|
1 |
<?php
|
2 |
-
$currency_sql="INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (1, '" . __('Mauritania') ."', 'MR', '" . __('Mauritanian Ouguiya') ."', '', '', 'MRO', '0', '0','africa','1');
|
3 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (2, '" . __('Martinique (French)') ."', 'MQ', '" . __('Euro') ."', '€', '€', 'EUR', '0', '0','southamerica','1');
|
4 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (3, '" . __('Malta') ."', 'MT', '" . __('Maltese Lira') ."', '', '', 'MTL', '0', '0' ,'europe','1');
|
5 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (4, '" . __('Marshall Islands') ."', 'MH', '" . __('US Dollar') ."', '$', '$', 'USD', '0', '0' ,'asiapacific','1');
|
6 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (5, '" . __('Mali') ."', 'ML', '" . __('CFA Franc BCEAO') ."', '', '', 'XOF', '0', '0' ,'africa','1');
|
7 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (6, '" . __('Maldives') ."', 'MV', '" . __('Maldive Rufiyaa') ."', '', '', 'MVR', '0', '0' , 'asiapacific','1');
|
8 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (7, '" . __('Malaysia') ."', 'MY', '" . __('Malaysian Ringgit') ."', '', '', 'MYR', '0', '0', 'asiapacific','1');
|
9 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (8, '" . __('Malawi') ."', 'MW', '" . __('Malawi Kwacha') ."', '', '', 'MWK', '0', '0','africa','1');
|
10 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (9, '" . __('Madagascar') ."', 'MG', '" . __('Malagasy Franc') ."', '', '', 'MGF', '0', '0','africa','1');
|
11 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (10, '" . __('Macau') ."', 'MO', '" . __('Macau Pataca') ."', '', '', 'MOP', '0', '0', 'asiapacific','1');
|
12 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (11, '" . __('Macedonia') ."', 'MK', '" . __('Denar') ."', '', '', 'MKD', '0', '0','europe','1');
|
13 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (12, '" . __('Luxembourg') ."', 'LU', '" . __('Euro') ."', '€', '€', 'EUR', '0', '0','europe','1');
|
14 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (13, '" . __('Lithuania') ."', 'LT', '" . __('Lithuanian Litas') ."', '', '', 'LTL', '0', '0','europe','1');
|
15 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (14, '" . __('Liechtenstein') ."', 'LI', '" . __('Swiss Franc') ."', '', '', 'CHF', '0', '0','europe','1');
|
16 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (15, '" . __('Libya') ."', 'LY', '" . __('Libyan Dinar') ."', '', '', 'LYD', '0', '0','africa','1');
|
17 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (16, '" . __('Liberia') ."', 'LR', '" . __('Liberian Dollar') ."', '$', '$', 'LRD', '0', '0','africa','1');
|
18 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (17, '" . __('Lesotho') ."', 'LS', '" . __('Lesotho Loti') ."', '', '', 'LSL', '0', '0','africa','1');
|
19 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (18, '" . __('Lebanon') ."', 'LB', '" . __('Lebanese Pound') ."', '', '', 'LBP', '0', '0', 'asiapacific','1');
|
20 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (19, '" . __('Latvia') ."', 'LV', '" . __('Latvian Lats') ."', '', '', 'LVL', '0', '0','europe','1');
|
21 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (20, '" . __('Laos') ."', 'LA', '" . __('Lao Kip') ."', '', '', 'LAK', '0', '0', 'asiapacific','1');
|
22 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (21, '" . __('Kyrgyzstan') ."', 'KG', '" . __('Som') ."', '', '', 'KGS', '0', '0', 'asiapacific','1');
|
23 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (22, '" . __('Kuwait') ."', 'KW', '" . __('Kuwaiti Dinar') ."', '', '', 'KWD', '0', '0', 'asiapacific','1');
|
24 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (23, '" . __('Korea, South') ."', 'KR', '" . __('Korean Won') ."', '', '', 'KRW', '0', '0', 'asiapacific','1');
|
25 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (24, '" . __('Korea, North') ."', 'KP', '" . __('North Korean Won') ."', '', '', 'KPW', '0', '0', 'asiapacific','1');
|
26 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (25, '" . __('Kiribati') ."', 'KI', '" . __('Australian Dollar') ."', '$', '$', 'AUD', '0', '0', 'asiapacific','1');
|
27 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (26, '" . __('Kenya') ."', 'KE', '" . __('Kenyan Shilling') ."', '', '', 'KES', '0', '0','africa','1');
|
28 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (27, '" . __('Kazakhstan') ."', 'KZ', '" . __('Kazakhstan Tenge') ."', '', '', 'KZT', '0', '0' ,'asiapacific','1');
|
29 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (28, '" . __('Jordan') ."', 'JO', '" . __('Jordanian Dinar') ."', '', '', 'JOD', '0', '0', 'asiapacific','1');
|
30 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (29, '" . __('Jersey') ."', 'JE', '" . __('Pound Sterling') ."', '£', '£', 'GBP', '0', '0','europe','1');
|
31 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (30, '" . __('Japan') ."', 'JP', '" . __('Japanese Yen') ."', '¥', '¥', 'JPY', '0', '0', 'asiapacific','1');
|
32 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (31, '" . __('Jamaica') ."', 'JM', '" . __('Jamaican Dollar') ."', '$', '$', 'JMD', '0', '0' ,'southamerica','1');
|
33 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (32, '" . __('Ivory Coast') ."', 'CI', '" . __('CFA Franc BCEAO') ."', '', '', 'XOF', '0', '0' ,'africa','1');
|
34 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (33, '" . __('Italy') ."', 'IT', '" . __('Euro') ."', '€', '€', 'EUR', '0', '0','europe','1');
|
35 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (34, '" . __('Isle of Man') ."', 'IM', '" . __('Pound Sterling') ."', '£', '£', 'GBP', '0', '0','europe','1');
|
36 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (35, '" . __('Israel') ."', 'IL', '" . __('Israeli New Shekel') ."', '', '', 'ILS', '0', '0', 'asiapacific','1');
|
37 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (36, '" . __('Ireland') ."', 'IE', '" . __('Euro') ."', '€', '€', 'EUR', '0', '0','europe','1');
|
38 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (37, '" . __('Iraq') ."', 'IQ', '" . __('Iraqi Dinar') ."', '', '', 'IQD', '0', '0', 'asiapacific','1');
|
39 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (38, '" . __('Indonesia') ."', 'ID', '" . __('Indonesian Rupiah') ."', '', '', 'IDR', '0', '0', 'asiapacific','1');
|
40 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (39, '" . __('Iran') ."', 'IR', '" . __('Iranian Rial') ."', '', '', 'IRR', '0', '0', 'asiapacific','1');
|
41 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (40, '" . __('India') ."', 'IN', '" . __('Indian Rupee') ."', '', '', 'INR', '0', '0', 'asiapacific','1');
|
42 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (41, '" . __('Iceland') ."', 'IS', '" . __('Iceland Krona') ."', '', '', 'ISK', '0', '0', 'europe','1');
|
43 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (42, '" . __('Hungary') ."', 'HU', '" . __('Hungarian Forint') ."', '', '', 'HUF', '0', '0', 'europe','1');
|
44 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (43, '" . __('Hong Kong') ."', 'HK', '" . __('Hong Kong Dollar') ."', '$', '$', 'HKD', '0', '0', 'asiapacific','1');
|
45 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (44, '" . __('Honduras') ."', 'HN', '" . __('Honduran Lempira') ."', '', '', 'HNL', '0', '0' , 'southamerica','1');
|
46 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (45, '" . __('Heard Island and McDonald Islands') ."', 'HM', '" . __('Australian Dollar') ."', '$', '$', 'AUD', '0', '0','asiapacific','1');
|
47 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (46, '" . __('Haiti') ."', 'HT', '" . __('Haitian Gourde') ."', '', '', 'HTG', '0', '0', 'southamerica','1');
|
48 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (47, '" . __('Guyana') ."', 'GY', '" . __('Guyana Dollar') ."', '$', '$', 'GYD', '0', '0', 'southamerica','1');
|
49 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (48, '" . __('Guinea Bissau') ."', 'GW', '" . __('Guinea-Bissau Peso') ."', '', '', 'GWP', '0', '0' ,'africa','1');
|
50 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (49, '" . __('Guinea') ."', 'GN', '" . __('Guinea Franc') ."', '', '', 'GNF', '0', '0','africa','1');
|
51 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (50, '" . __('Guernsey') ."', 'GF', '" . __('Pound Sterling') ."', '£', '£', 'GBP', '0', '0' ,'europe','1');
|
52 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (51, '" . __('Guatemala') ."', 'GT', '" . __('Guatemalan Quetzal') ."', '', '', 'QTQ', '0', '0', 'southamerica','1');
|
53 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (52, '" . __('Guam (USA)') ."', 'GU', '" . __('US Dollar') ."', '$', '$', 'USD', '0', '0', 'asiapacific','1');
|
54 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (53, '" . __('Grenada') ."', 'GD', '" . __('East Carribean Dollar') ."', '$', '$', 'XCD', '0', '0','africa','1');
|
55 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (54, '" . __('Guadeloupe (French)') ."', 'GP', '" . __('Euro') ."', '€', '€', 'EUR', '0', '0', 'southamerica','1');
|
56 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (55, '" . __('Greenland') ."', 'GL', '" . __('Danish Krone') ."', '', '', 'DKK', '0', '0','europe','1');
|
57 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (56, '" . __('Greece') ."', 'GR', '" . __('Euro') ."', '€', '€', 'EUR', '0', '19','europe','1');
|
58 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (57, '" . __('Gibraltar') ."', 'GI', '" . __('Gibraltar Pound') ."', '', '', 'GIP', '0', '0', 'europe','1');
|
59 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (58, '" . __('Ghana') ."', 'GH', '" . __('Ghanaian Cedi') ."', '', '', 'GHC', '0', '0','africa','1');
|
60 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (59, '" . __('Germany') ."', 'DE', '" . __('Euro') ."', '€', '€', 'EUR', '0', '0','europe','1');
|
61 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (60, '" . __('Georgia') ."', 'GE', '" . __('Georgian Lari') ."', '', '', 'GEL', '0', '0','europe','1');
|
62 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (61, '" . __('Gambia') ."', 'GM', '" . __('Gambian Dalasi') ."', '', '', 'GMD', '0', '0','africa','1');
|
63 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (62, '" . __('Gabon') ."', 'GA', '" . __('CFA Franc BEAC') ."', '', '', 'XAF', '0', '0','africa','1');
|
64 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (63, '" . __('French Southern Territories') ."', 'TF', '" . __('Euro') ."', '€', '€', 'EUR', '0', '0','africa','1');
|
65 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (64, '" . __('France') ."', 'FR', '" . __('Euro') ."', '€', '€', 'EUR', '0', '0', 'europe','1');
|
66 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (65, '" . __('Finland') ."', 'FI', '" . __('Euro') ."', '€', '€', 'EUR', '0', '0', 'europe','1');
|
67 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (66, '" . __('Fiji') ."', 'FJ', '" . __('Fiji Dollar') ."', '$', '$', 'FJD', '0', '0', 'asiapacific','1');
|
68 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (67, '" . __('Faroe Islands') ."', 'FO', '" . __('Danish Krone') ."', '', '', 'DKK', '0', '0' ,'europe','1');
|
69 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (68, '" . __('Falkland Islands') ."', 'FK', '" . __('Falkland Islands Pound') ."', '', '', 'FKP', '0', '0' ,'southamerica','1');
|
70 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (69, '" . __('Ethiopia') ."', 'ET', '" . __('Ethiopian Birr') ."', '', '', 'ETB', '0', '0','africa','1');
|
71 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (70, '" . __('Estonia') ."', 'EE', '" . __('Estonian Kroon') ."', '', '', 'EEK', '0', '0', 'europe','1');
|
72 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (71, '" . __('Eritrea') ."', 'ER', '" . __('Eritrean Nakfa') ."', '', '', 'ERN', '0', '0','africa','1');
|
73 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (72, '" . __('Equatorial Guinea') ."', 'GQ', '" . __('CFA Franc BEAC') ."', '', '', 'XAF', '0', '0','africa','1');
|
74 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (73, '" . __('El Salvador') ."', 'SV', '" . __('El Salvador Colon') ."', '', '', 'SVC', '0', '0','southamerica','1');
|
75 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (74, '" . __('Egypt') ."', 'EG', '" . __('Egyptian Pound') ."', '', '', 'EGP', '0', '0','africa','1');
|
76 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (75, '" . __('Ecuador') ."', 'EC', '" . __('Ecuador Sucre') ."', '', '', 'ECS', '0', '0','southamerica','1');
|
77 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (76, '" . __('East Timor') ."', 'TP', '" . __('Timor Escudo') ."', '', '', 'TPE', '0', '0','asiapacific','1');
|
78 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (77, '" . __('Dominican Republic') ."', 'DO', '" . __('Dominican Peso') ."', '', '', 'DOP', '0', '0','southamerica','1');
|
79 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (78, '" . __('Dominica') ."', 'DM', '" . __('East Caribbean Dollar') ."', '$', '$', 'XCD', '0', '0','southamerica','1');
|
80 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (79, '" . __('Djibouti') ."', 'DJ', '" . __('Djibouti Franc') ."', '', '', 'DJF', '0', '0','africa','1');
|
81 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (80, '" . __('Denmark') ."', 'DK', '" . __('Danish Krone') ."', '', '', 'DKK', '0', '0','europe','1');
|
82 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (81, '" . __('Democratic Republic of Congo') ."', 'CD', '" . __('Francs') ."', '', '', 'CDF', '0', '0','africa','1');
|
83 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (82, '" . __('Czech Rep.') ."', 'CZ', '" . __('Czech Koruna') ."', '', '', 'CZK', '0', '0','europe','1');
|
84 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (83, '" . __('Cyprus') ."', 'CY', '" . __('Cyprus Pound') ."', '', '', 'CYP', '0', '0','europe','1');
|
85 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (84, '" . __('Cuba') ."', 'CU', '" . __('Cuban Peso') ."', '', '', 'CUP', '0', '0','northamerica','1');
|
86 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (85, '" . __('Croatia') ."', 'HR', '" . __('Croatian Kuna') ."', '', '', 'HRK', '0', '0','europe','1');
|
87 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (86, '" . __('Costa Rica') ."', 'CR', '" . __('Costa Rican Colon') ."', '', '', 'CRC', '0', '0','southamerica','1');
|
88 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (87, '" . __('Cook Islands') ."', 'CK', '" . __('New Zealand Dollar') ."', '$', '$', 'NZD', '0', '0' ,'asiapacific','1');
|
89 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (88, '" . __('Congo') ."', 'CG', '" . __('CFA Franc BEAC') ."', '', '', 'XAF', '0', '0','africa','1');
|
90 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (89, '" . __('Comoros') ."', 'KM', '" . __('Comoros Franc') ."', '', '', 'KMF', '0', '0','africa','1');
|
91 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (90, '" . __('Colombia') ."', 'CO', '" . __('Colombian Peso') ."', '', '', 'COP', '0', '0','southamerica','1');
|
92 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (91, '" . __('Cocos (Keeling) Islands') ."', 'CC', '" . __('Australian Dollar') ."', '$', '$', 'AUD', '0', '0','asiapacific','1');
|
93 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (92, '" . __('Christmas Island') ."', 'CX', '" . __('Australian Dollar') ."', '$', '$', 'AUD', '0', '0','asiapacific','1');
|
94 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (93, '" . __('Chile') ."', 'CL', '" . __('Chilean Peso') ."', '', '', 'CLP', '0', '0','asiapacific','1');
|
95 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (94, '" . __('China') ."', 'CN', '" . __('Yuan Renminbi') ."', '', '', 'CNY', '0', '0' ,'asiapacific','1');
|
96 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (95, '" . __('Chad') ."', 'TD', '" . __('CFA Franc BEAC') ."', '', '', 'XAF', '0', '0','africa','1');
|
97 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (96, '" . __('Central African Republic') ."', 'CF', '" . __('CFA Franc BEAC') ."', '', '', 'XAF', '0', '0','africa','1');
|
98 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (97, '" . __('Cayman Islands') ."', 'KY', '" . __('Cayman Islands Dollar') ."', '$', '$', 'KYD', '0', '0','northamerica','1');
|
99 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (98, '" . __('Cape Verde') ."', 'CV', '" . __('Cape Verde Escudo') ."', '', '', 'CVE', '0', '0','africa','1');
|
100 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (99, '" . __('Cameroon') ."', 'CM', '" . __('CFA Franc BEAC') ."', '', '', 'XAF', '0', '0','africa','1');
|
101 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (100, '" . __('Canada') ."', 'CA', '" . __('Canadian Dollar') ."', '$', '$', 'CAD', '1', '','northamerica','1');
|
102 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (101, '" . __('Cambodia') ."', 'KH', '" . __('Kampuchean Riel') ."', '', '', 'KHR', '0', '0','asiapacific','1');
|
103 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (102, '" . __('Burundi') ."', 'BI', '" . __('Burundi Franc') ."', '', '', 'BIF', '0', '0','africa','1');
|
104 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (103, '" . __('Burkina Faso') ."', 'BF', '" . __('CFA Franc BCEAO') ."', '', '', 'XOF', '0', '0','africa','1');
|
105 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (104, '" . __('Bulgaria') ."', 'BG', '" . __('Bulgarian Lev') ."', '', '', 'BGL', '0', '0','europe','1');
|
106 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (105, '" . __('Brunei Darussalam') ."', 'BN', '" . __('Brunei Dollar') ."', '$', '$', 'BND', '0', '0','asiapacific','1');
|
107 |
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (106, '" . __('British Indian Ocean Territory') ."', 'IO', '" . __('US Dollar') ."', '$', '$', 'USD', '0', '0','asiapacific','1');
|
108 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (107, '" . __('Brazil') ."', 'BR', '" . __('Brazilian Real') ."', '', '', 'BRL', '0', '0','southamerica','1');
|
109 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (108, '" . __('Bouvet Island') ."', 'BV', '" . __('Norwegian Krone') ."', '', '', 'NOK', '0', '0','africa','1');
|
110 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (109, '" . __('Botswana') ."', 'BW', '" . __('Botswana Pula') ."', '', '', 'BWP', '0', '0','africa','1');
|
111 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (110, '" . __('Bosnia-Herzegovina') ."', 'BA', '" . __('Marka') ."', '', '', 'BAM', '0', '0','europe','1');
|
112 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (111, '" . __('Bolivia') ."', 'BO', '" . __('Boliviano') . "', '', '', 'BOB', '0', '0','southamerica','1');
|
113 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (112, '" . __('Bhutan') ."', 'BT', '" . __('Bhutan Ngultrum') . "', '', '', 'BTN', '0', '0','asiapacific','1');
|
114 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (113, '" . __('Bermuda') ."', 'BM', '" . __('Bermudian Dollar') . "', '$', '$', 'BMD', '0', '0','europe','1');
|
115 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (114, '" . __('Benin') ."', 'BJ', '" . __('CFA Franc BCEAO') . "', '', '', 'XOF', '0', '0','africa','1');
|
116 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (115, '" . __('Belize') ."', 'BZ', '" . __('Belize Dollar') . "', '$', '$', 'BZD', '0', '0','northamerica','1');
|
117 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (116, '" . __('Belgium') ."', 'BE', '" . __('Euro') . "', '€', '€', 'EUR', '0', '0','europe','1');
|
118 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (117, '" . __('Belarus') ."', 'BY', '" . __('Belarussian Ruble') . "', '', '', 'BYB', '0', '0','europe','1');
|
119 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (118, '" . __('Barbados') ."', 'BB', '" . __('Barbados Dollar') . "', '$', '$', 'BBD', '0', '0','southamerica','1');
|
120 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (119, '" . __('Bangladesh') ."', 'BD', '" . __('Bangladeshi Taka') . "', '', '', 'BDT', '0', '0','asiapacific','1');
|
121 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (120, '" . __('Bahrain') ."', 'BH', '" . __('Bahraini Dinar') . "', '', '', 'BHD', '0', '0','asiapacific','1');
|
122 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (121, '" . __('Bahamas') ."', 'BS', '" . __('Bahamian Dollar') . "', '$', '$', 'BSD', '0', '0','northamerica','1');
|
123 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (122, '" . __('Azerbaijan') ."', 'AZ', '" . __('Azerbaijanian Manat') . "', '', '', 'AZM', '0', '0','asiapacific','1');
|
124 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (123, '" . __('Austria') ."', 'AT', '" . __('Euro') . "', '€', '€', 'EUR', '0', '0','europe','1');
|
125 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (124, '" . __('Aruba') ."', 'AW', '" . __('Aruban Guilder') . "', '', '', 'AWG', '0', '0','southamerica','1');
|
126 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (125, '" . __('Armenia') ."', 'AM', '" . __('Armenian Dram') . "', '', '', 'AMD', '0', '0','asiapacific','1');
|
127 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (126, '" . __('Argentina') ."', 'AR', '" . __('Argentine Peso') . "', '', '', 'ARS', '0', '0','southamerica','1');
|
128 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (127, '" . __('Antigua and Barbuda') ."', 'AG', '" . __('East Caribbean Dollar') . "', '$', '$', 'XCD', '0', '0','africa','1');
|
129 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (128, '" . __('Antarctica') ."', 'AQ', '" . __('Dollar') . "', '$', '$', 'ATA', '0', '0','antarctica','1');
|
130 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (129, '" . __('Anguilla') ."', 'AI', '" . __('East Caribbean Dollar') . "', '$', '$', 'XCD', '0', '0','northamerica','1');
|
131 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (130, '" . __('Angola') ."', 'AO', '" . __('Angolan New Kwanza') . "', '', '', 'AON', '0', '0','africa','1');
|
132 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (131, '" . __('Andorra') ."', 'AD', '" . __('Euro') . "', '€', '€', 'EUR', '0', '0','europe','1');
|
133 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (132, '" . __('American Samoa') ."', 'AS', '" . __('US Dollar') . "', '$', '$', 'USD', '0', '0','asiapacific','1');
|
134 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (133, '" . __('Algeria') ."', 'DZ', '" . __('Algerian Dinar') . "', '', '', 'DZD', '0', '0','africa','1');
|
135 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (134, '" . __('Albania') ."', 'AL', '" . __('Albanian Lek') . "', '', '', 'ALL', '0', '0','europe','1');
|
136 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (135, '" . __('Afghanistan') ."', 'AF', '" . __('Afghanistan Afghani') . "', '', '', 'AFA', '0', '0','asiapacific','1');
|
137 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (136, '" . __('USA') ."', 'US', '" . __('US Dollar') . "', '$', '$', 'USD', '1', '','northamerica','1');
|
138 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (137, '" . __('Australia') ."', 'AU', '" . __('Australian Dollar') . "', '$', '$', 'AUD', '0', '0','asiapacific','1');
|
139 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (138, '" . __('Great Britain') ."', 'GB', '" . __('Pound Sterling') . "', '£', '£', 'GBP', '0', '0','europe','1');
|
140 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (139, '" . __('Mauritius') ."', 'MU', '" . __('Mauritius Rupee') . "', '', '', 'MUR', '0', '0','africa','1');
|
141 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (140, '" . __('Mayotte') ."', 'YT', '" . __('Euro') . "', '€', '€', 'EUR', '0', '0','europe','1');
|
142 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (141, '" . __('Mexico') ."', 'MX', '" . __('Mexican Nuevo Peso') . "', '', '', 'MXN', '0', '0','northamerica','1');
|
143 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (142, '" . __('Micronesia') ."', 'FM', '" . __('US Dollar') . "', '$', '$', 'USD', '0', '0','asiapacific','1');
|
144 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (143, '" . __('Moldova') ."', 'MD', '" . __('Moldovan Leu') . "', '', '', 'MDL', '0', '0','europe','1');
|
145 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (144, '" . __('Monaco') ."', 'MC', '" . __('Euro') . "', '€', '€', 'EUR', '0', '0','europe','1');
|
146 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (145, '" . __('Mongolia') ."', 'MN', '" . __('Mongolian Tugrik') . "', '', '', 'MNT', '0', '0','asiapacific','1');
|
147 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (146, '" . __('Montserrat') ."', 'MS', '" . __('East Caribbean Dollar') . "', '$', '$', 'XCD', '0', '0','africa','1');
|
148 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (147, '" . __('Morocco') ."', 'MA', '" . __('Moroccan Dirham') . "', '', '', 'MAD', '0', '0','africa','1');
|
149 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (148, '" . __('Mozambique') ."', 'MZ', '" . __('Mozambique Metical') . "', '', '', 'MZM', '0', '0','africa','1');
|
150 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (149, '" . __('Myanmar') ."', 'MM', '" . __('Myanmar Kyat') . "', '', '', 'MMK', '0', '0','asiapacific','1');
|
151 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (150, '" . __('Namibia') ."', 'NA', '" . __('Namibian Dollar') . "', '$', '$', 'NAD', '0', '0','africa','1');
|
152 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (151, '" . __('Nauru') ."', 'NR', '" . __('Australian Dollar') . "', '$', '$', 'AUD', '0', '0','asiapacific','1');
|
153 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (152, '" . __('Nepal') ."', 'NP', '" . __('Nepalese Rupee') . "', '', '', 'NPR', '0', '0','asiapacific','1');
|
154 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (153, '" . __('Netherlands') ."', 'NL', '" . __('Euro') . "', '€', '€', 'EUR', '0', '0','europe','1');
|
155 |
-
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (154, '" . __('Netherlands Antilles') ."', 'AN', '" . __('Netherlands Antillean Guilder') . "', '', '', 'ANG', '0', '0','africa','1');
|
156 |
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (155, '" . __('New Caledonia (French)') ."', 'NC', '" . __('CFP Franc') . "', '', '', 'XPF', '0', '0','asiapacific','1');
|
157 |
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (156, '" . __('New Zealand') ."', 'NZ', '" . __('New Zealand Dollar') . "', '$', '$', 'NZD', '0', '12.5','asiapacific','1');
|
158 |
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (157, '" . __('Nicaragua') ."', 'NI', '" . __('Nicaraguan Cordoba Oro') . "', '', '', 'NIC', '0', '0','northamerica','1');
|
1 |
<?php
|
2 |
+
$currency_sql="INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (1, '" . __('Mauritania') ."', 'MR', '" . __('Mauritanian Ouguiya') ."', '', '', '" . __('MRO', 'wpsc') . "', '0', '0','africa','1');
|
3 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (2, '" . __('Martinique (French)') ."', 'MQ', '" . __('Euro') ."', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','southamerica','1');
|
4 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (3, '" . __('Malta') ."', 'MT', '" . __('Maltese Lira') ."', '', '', '" . __('MTL', 'wpsc') . "', '0', '0' ,'europe','1');
|
5 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (4, '" . __('Marshall Islands') ."', 'MH', '" . __('US Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('USD', 'wpsc') . "', '0', '0' ,'asiapacific','1');
|
6 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (5, '" . __('Mali') ."', 'ML', '" . __('CFA Franc BCEAO') ."', '', '', '" . __('XOF', 'wpsc') . "', '0', '0' ,'africa','1');
|
7 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (6, '" . __('Maldives') ."', 'MV', '" . __('Maldive Rufiyaa') ."', '', '', '" . __('MVR', 'wpsc') . "', '0', '0' , 'asiapacific','1');
|
8 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (7, '" . __('Malaysia') ."', 'MY', '" . __('Malaysian Ringgit') ."', '', '', '" . __('MYR', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
9 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (8, '" . __('Malawi') ."', 'MW', '" . __('Malawi Kwacha') ."', '', '', '" . __('MWK', 'wpsc') . "', '0', '0','africa','1');
|
10 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (9, '" . __('Madagascar') ."', 'MG', '" . __('Malagasy Franc') ."', '', '', '" . __('MGF', 'wpsc') . "', '0', '0','africa','1');
|
11 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (10, '" . __('Macau') ."', 'MO', '" . __('Macau Pataca') ."', '', '', '" . __('MOP', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
12 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (11, '" . __('Macedonia') ."', 'MK', '" . __('Denar') ."', '', '', '" . __('MKD', 'wpsc') . "', '0', '0','europe','1');
|
13 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (12, '" . __('Luxembourg') ."', 'LU', '" . __('Euro') ."', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','europe','1');
|
14 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (13, '" . __('Lithuania') ."', 'LT', '" . __('Lithuanian Litas') ."', '', '', '" . __('LTL', 'wpsc') . "', '0', '0','europe','1');
|
15 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (14, '" . __('Liechtenstein') ."', 'LI', '" . __('Swiss Franc') ."', '', '', '" . __('CHF', 'wpsc') . "', '0', '0','europe','1');
|
16 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (15, '" . __('Libya') ."', 'LY', '" . __('Libyan Dinar') ."', '', '', '" . __('LYD', 'wpsc') . "', '0', '0','africa','1');
|
17 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (16, '" . __('Liberia') ."', 'LR', '" . __('Liberian Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('LRD', 'wpsc') . "', '0', '0','africa','1');
|
18 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (17, '" . __('Lesotho') ."', 'LS', '" . __('Lesotho Loti') ."', '', '', '" . __('LSL', 'wpsc') . "', '0', '0','africa','1');
|
19 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (18, '" . __('Lebanon') ."', 'LB', '" . __('Lebanese Pound') ."', '', '', '" . __('LBP', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
20 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (19, '" . __('Latvia') ."', 'LV', '" . __('Latvian Lats') ."', '', '', '" . __('LVL', 'wpsc') . "', '0', '0','europe','1');
|
21 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (20, '" . __('Laos') ."', 'LA', '" . __('Lao Kip') ."', '', '', '" . __('LAK', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
22 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (21, '" . __('Kyrgyzstan') ."', 'KG', '" . __('Som') ."', '', '', '" . __('KGS', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
23 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (22, '" . __('Kuwait') ."', 'KW', '" . __('Kuwaiti Dinar') ."', '', '', '" . __('KWD', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
24 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (23, '" . __('Korea, South') ."', 'KR', '" . __('Korean Won') ."', '', '', '" . __('KRW', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
25 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (24, '" . __('Korea, North') ."', 'KP', '" . __('North Korean Won') ."', '', '', '" . __('KPW', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
26 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (25, '" . __('Kiribati') ."', 'KI', '" . __('Australian Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('AUD', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
27 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (26, '" . __('Kenya') ."', 'KE', '" . __('Kenyan Shilling') ."', '', '', '" . __('KES', 'wpsc') . "', '0', '0','africa','1');
|
28 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (27, '" . __('Kazakhstan') ."', 'KZ', '" . __('Kazakhstan Tenge') ."', '', '', '" . __('KZT', 'wpsc') . "', '0', '0' ,'asiapacific','1');
|
29 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (28, '" . __('Jordan') ."', 'JO', '" . __('Jordanian Dinar') ."', '', '', '" . __('JOD', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
30 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (29, '" . __('Jersey') ."', 'JE', '" . __('Pound Sterling') ."', '" . __('£', 'wpsc') . "', '" . __('£', 'wpsc') . "', '" . __('GBP', 'wpsc') . "', '0', '0','europe','1');
|
31 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (30, '" . __('Japan') ."', 'JP', '" . __('Japanese Yen') ."', '" . __('¥', 'wpsc') . "', '" . __('¥', 'wpsc') . "', '" . __('JPY', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
32 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (31, '" . __('Jamaica') ."', 'JM', '" . __('Jamaican Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('JMD', 'wpsc') . "', '0', '0' ,'southamerica','1');
|
33 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (32, '" . __('Ivory Coast') ."', 'CI', '" . __('CFA Franc BCEAO') ."', '', '', '" . __('XOF', 'wpsc') . "', '0', '0' ,'africa','1');
|
34 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (33, '" . __('Italy') ."', 'IT', '" . __('Euro') ."', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','europe','1');
|
35 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (34, '" . __('Isle of Man') ."', 'IM', '" . __('Pound Sterling') ."', '" . __('£', 'wpsc') . "', '" . __('£', 'wpsc') . "', '" . __('GBP', 'wpsc') . "', '0', '0','europe','1');
|
36 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (35, '" . __('Israel') ."', 'IL', '" . __('Israeli New Shekel') ."', '', '', '" . __('ILS', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
37 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (36, '" . __('Ireland') ."', 'IE', '" . __('Euro') ."', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','europe','1');
|
38 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (37, '" . __('Iraq') ."', 'IQ', '" . __('Iraqi Dinar') ."', '', '', '" . __('IQD', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
39 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (38, '" . __('Indonesia') ."', 'ID', '" . __('Indonesian Rupiah') ."', '', '', '" . __('IDR', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
40 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (39, '" . __('Iran') ."', 'IR', '" . __('Iranian Rial') ."', '', '', '" . __('IRR', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
41 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (40, '" . __('India') ."', 'IN', '" . __('Indian Rupee') ."', '', '', '" . __('INR', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
42 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (41, '" . __('Iceland') ."', 'IS', '" . __('Iceland Krona') ."', '', '', '" . __('ISK', 'wpsc') . "', '0', '0', 'europe','1');
|
43 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (42, '" . __('Hungary') ."', 'HU', '" . __('Hungarian Forint') ."', '', '', '" . __('HUF', 'wpsc') . "', '0', '0', 'europe','1');
|
44 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (43, '" . __('Hong Kong') ."', 'HK', '" . __('Hong Kong Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('HKD', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
45 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (44, '" . __('Honduras') ."', 'HN', '" . __('Honduran Lempira') ."', '', '', '" . __('HNL', 'wpsc') . "', '0', '0' , 'southamerica','1');
|
46 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (45, '" . __('Heard Island and McDonald Islands') ."', 'HM', '" . __('Australian Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('AUD', 'wpsc') . "', '0', '0','asiapacific','1');
|
47 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (46, '" . __('Haiti') ."', 'HT', '" . __('Haitian Gourde') ."', '', '', '" . __('HTG', 'wpsc') . "', '0', '0', 'southamerica','1');
|
48 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (47, '" . __('Guyana') ."', 'GY', '" . __('Guyana Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('GYD', 'wpsc') . "', '0', '0', 'southamerica','1');
|
49 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (48, '" . __('Guinea Bissau') ."', 'GW', '" . __('Guinea-Bissau Peso') ."', '', '', '" . __('GWP', 'wpsc') . "', '0', '0' ,'africa','1');
|
50 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (49, '" . __('Guinea') ."', 'GN', '" . __('Guinea Franc') ."', '', '', '" . __('GNF', 'wpsc') . "', '0', '0','africa','1');
|
51 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (50, '" . __('Guernsey') ."', 'GF', '" . __('Pound Sterling') ."', '" . __('£', 'wpsc') . "', '" . __('£', 'wpsc') . "', '" . __('GBP', 'wpsc') . "', '0', '0' ,'europe','1');
|
52 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (51, '" . __('Guatemala') ."', 'GT', '" . __('Guatemalan Quetzal') ."', '', '', '" . __('QTQ', 'wpsc') . "', '0', '0', 'southamerica','1');
|
53 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (52, '" . __('Guam (USA)') ."', 'GU', '" . __('US Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('USD', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
54 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (53, '" . __('Grenada') ."', 'GD', '" . __('East Carribean Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('XCD', 'wpsc') . "', '0', '0','africa','1');
|
55 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (54, '" . __('Guadeloupe (French)') ."', 'GP', '" . __('Euro') ."', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0', 'southamerica','1');
|
56 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (55, '" . __('Greenland') ."', 'GL', '" . __('Danish Krone') ."', '', '', '" . __('DKK', 'wpsc') . "', '0', '0','europe','1');
|
57 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (56, '" . __('Greece') ."', 'GR', '" . __('Euro') ."', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '19','europe','1');
|
58 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (57, '" . __('Gibraltar') ."', 'GI', '" . __('Gibraltar Pound') ."', '', '', '" . __('GIP', 'wpsc') . "', '0', '0', 'europe','1');
|
59 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (58, '" . __('Ghana') ."', 'GH', '" . __('Ghanaian Cedi') ."', '', '', '" . __('GHC', 'wpsc') . "', '0', '0','africa','1');
|
60 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (59, '" . __('Germany') ."', 'DE', '" . __('Euro') ."', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','europe','1');
|
61 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (60, '" . __('Georgia') ."', 'GE', '" . __('Georgian Lari') ."', '', '', '" . __('GEL', 'wpsc') . "', '0', '0','europe','1');
|
62 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (61, '" . __('Gambia') ."', 'GM', '" . __('Gambian Dalasi') ."', '', '', '" . __('GMD', 'wpsc') . "', '0', '0','africa','1');
|
63 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (62, '" . __('Gabon') ."', 'GA', '" . __('CFA Franc BEAC') ."', '', '', '" . __('XAF', 'wpsc') . "', '0', '0','africa','1');
|
64 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (63, '" . __('French Southern Territories') ."', 'TF', '" . __('Euro') ."', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','africa','1');
|
65 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (64, '" . __('France') ."', 'FR', '" . __('Euro') ."', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0', 'europe','1');
|
66 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (65, '" . __('Finland') ."', 'FI', '" . __('Euro') ."', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0', 'europe','1');
|
67 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (66, '" . __('Fiji') ."', 'FJ', '" . __('Fiji Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('FJD', 'wpsc') . "', '0', '0', 'asiapacific','1');
|
68 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (67, '" . __('Faroe Islands') ."', 'FO', '" . __('Danish Krone') ."', '', '', '" . __('DKK', 'wpsc') . "', '0', '0' ,'europe','1');
|
69 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (68, '" . __('Falkland Islands') ."', 'FK', '" . __('Falkland Islands Pound') ."', '', '', '" . __('FKP', 'wpsc') . "', '0', '0' ,'southamerica','1');
|
70 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (69, '" . __('Ethiopia') ."', 'ET', '" . __('Ethiopian Birr') ."', '', '', '" . __('ETB', 'wpsc') . "', '0', '0','africa','1');
|
71 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (70, '" . __('Estonia') ."', 'EE', '" . __('Estonian Kroon') ."', '', '', '" . __('EEK', 'wpsc') . "', '0', '0', 'europe','1');
|
72 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (71, '" . __('Eritrea') ."', 'ER', '" . __('Eritrean Nakfa') ."', '', '', '" . __('ERN', 'wpsc') . "', '0', '0','africa','1');
|
73 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (72, '" . __('Equatorial Guinea') ."', 'GQ', '" . __('CFA Franc BEAC') ."', '', '', '" . __('XAF', 'wpsc') . "', '0', '0','africa','1');
|
74 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (73, '" . __('El Salvador') ."', 'SV', '" . __('El Salvador Colon') ."', '', '', '" . __('SVC', 'wpsc') . "', '0', '0','southamerica','1');
|
75 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (74, '" . __('Egypt') ."', 'EG', '" . __('Egyptian Pound') ."', '', '', '" . __('EGP', 'wpsc') . "', '0', '0','africa','1');
|
76 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (75, '" . __('Ecuador') ."', 'EC', '" . __('Ecuador Sucre') ."', '', '', '" . __('ECS', 'wpsc') . "', '0', '0','southamerica','1');
|
77 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (76, '" . __('East Timor') ."', 'TP', '" . __('Timor Escudo') ."', '', '', '" . __('TPE', 'wpsc') . "', '0', '0','asiapacific','1');
|
78 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (77, '" . __('Dominican Republic') ."', 'DO', '" . __('Dominican Peso') ."', '', '', '" . __('DOP', 'wpsc') . "', '0', '0','southamerica','1');
|
79 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (78, '" . __('Dominica') ."', 'DM', '" . __('East Caribbean Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('XCD', 'wpsc') . "', '0', '0','southamerica','1');
|
80 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (79, '" . __('Djibouti') ."', 'DJ', '" . __('Djibouti Franc') ."', '', '', '" . __('DJF', 'wpsc') . "', '0', '0','africa','1');
|
81 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (80, '" . __('Denmark') ."', 'DK', '" . __('Danish Krone') ."', '', '', '" . __('DKK', 'wpsc') . "', '0', '0','europe','1');
|
82 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (81, '" . __('Democratic Republic of Congo') ."', 'CD', '" . __('Francs') ."', '', '', '" . __('CDF', 'wpsc') . "', '0', '0','africa','1');
|
83 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (82, '" . __('Czech Rep.') ."', 'CZ', '" . __('Czech Koruna') ."', '', '', '" . __('CZK', 'wpsc') . "', '0', '0','europe','1');
|
84 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (83, '" . __('Cyprus') ."', 'CY', '" . __('Cyprus Pound') ."', '', '', '" . __('CYP', 'wpsc') . "', '0', '0','europe','1');
|
85 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (84, '" . __('Cuba') ."', 'CU', '" . __('Cuban Peso') ."', '', '', '" . __('CUP', 'wpsc') . "', '0', '0','northamerica','1');
|
86 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (85, '" . __('Croatia') ."', 'HR', '" . __('Croatian Kuna') ."', '', '', '" . __('HRK', 'wpsc') . "', '0', '0','europe','1');
|
87 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (86, '" . __('Costa Rica') ."', 'CR', '" . __('Costa Rican Colon') ."', '', '', '" . __('CRC', 'wpsc') . "', '0', '0','southamerica','1');
|
88 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (87, '" . __('Cook Islands') ."', 'CK', '" . __('New Zealand Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('NZD', 'wpsc') . "', '0', '0' ,'asiapacific','1');
|
89 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (88, '" . __('Congo') ."', 'CG', '" . __('CFA Franc BEAC') ."', '', '', '" . __('XAF', 'wpsc') . "', '0', '0','africa','1');
|
90 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (89, '" . __('Comoros') ."', 'KM', '" . __('Comoros Franc') ."', '', '', '" . __('KMF', 'wpsc') . "', '0', '0','africa','1');
|
91 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (90, '" . __('Colombia') ."', 'CO', '" . __('Colombian Peso') ."', '', '', '" . __('COP', 'wpsc') . "', '0', '0','southamerica','1');
|
92 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (91, '" . __('Cocos (Keeling) Islands') ."', 'CC', '" . __('Australian Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', 'AUD', '0', '0','asiapacific','1');
|
93 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (92, '" . __('Christmas Island') ."', 'CX', '" . __('Australian Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('AUD', 'wpsc') . "', '0', '0','asiapacific','1');
|
94 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (93, '" . __('Chile') ."', 'CL', '" . __('Chilean Peso') ."', '', '', '" . __('CLP', 'wpsc') . "', '0', '0','asiapacific','1');
|
95 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (94, '" . __('China') ."', 'CN', '" . __('Yuan Renminbi') ."', '', '', '" . __('CNY', 'wpsc') . "', '0', '0' ,'asiapacific','1');
|
96 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (95, '" . __('Chad') ."', 'TD', '" . __('CFA Franc BEAC') ."', '', '', '" . __('XAF', 'wpsc') . "', '0', '0','africa','1');
|
97 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (96, '" . __('Central African Republic') ."', 'CF', '" . __('CFA Franc BEAC') ."', '', '', '" . __('XAF', 'wpsc') . "', '0', '0','africa','1');
|
98 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (97, '" . __('Cayman Islands') ."', 'KY', '" . __('Cayman Islands Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('KYD', 'wpsc') . "', '0', '0','northamerica','1');
|
99 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (98, '" . __('Cape Verde') ."', 'CV', '" . __('Cape Verde Escudo') ."', '', '', '" . __('CVE', 'wpsc') . "', '0', '0','africa','1');
|
100 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (99, '" . __('Cameroon') ."', 'CM', '" . __('CFA Franc BEAC') ."', '', '', '" . __('XAF', 'wpsc') . "', '0', '0','africa','1');
|
101 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (100, '" . __('Canada') ."', 'CA', '" . __('Canadian Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('CAD', 'wpsc') . "', '1', '','northamerica','1');
|
102 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (101, '" . __('Cambodia') ."', 'KH', '" . __('Kampuchean Riel') ."', '', '', '" . __('KHR', 'wpsc') . "', '0', '0','asiapacific','1');
|
103 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (102, '" . __('Burundi') ."', 'BI', '" . __('Burundi Franc') ."', '', '', '" . __('BIF', 'wpsc') . "', '0', '0','africa','1');
|
104 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (103, '" . __('Burkina Faso') ."', 'BF', '" . __('CFA Franc BCEAO') ."', '', '', '" . __('XOF', 'wpsc') . "', '0', '0','africa','1');
|
105 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (104, '" . __('Bulgaria') ."', 'BG', '" . __('Bulgarian Lev') ."', '', '', '" . __('BGL', 'wpsc') . "', '0', '0','europe','1');
|
106 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (105, '" . __('Brunei Darussalam') ."', 'BN', '" . __('Brunei Dollar') ."', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', " . __('BND', 'wpsc') . ", '0', '0','asiapacific','1');
|
107 |
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (106, '" . __('British Indian Ocean Territory') ."', 'IO', '" . __('US Dollar') ."', '$', '$', 'USD', '0', '0','asiapacific','1');
|
108 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (107, '" . __('Brazil') ."', 'BR', '" . __('Brazilian Real') ."', '', '', '" . __('BRL', 'wpsc') . "', '0', '0','southamerica','1');
|
109 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (108, '" . __('Bouvet Island') ."', 'BV', '" . __('Norwegian Krone') ."', '', '', '" . __('NOK', 'wpsc') . "', '0', '0','africa','1');
|
110 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (109, '" . __('Botswana') ."', 'BW', '" . __('Botswana Pula') ."', '', '', '" . __('BWP', 'wpsc') . "', '0', '0','africa','1');
|
111 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (110, '" . __('Bosnia-Herzegovina') ."', 'BA', '" . __('Marka') ."', '', '', '" . __('BAM', 'wpsc') . "', '0', '0','europe','1');
|
112 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (111, '" . __('Bolivia') ."', 'BO', '" . __('Boliviano') . "', '', '', '" . __('BOB', 'wpsc') . "', '0', '0','southamerica','1');
|
113 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (112, '" . __('Bhutan') ."', 'BT', '" . __('Bhutan Ngultrum') . "', '', '', '" . __('BTN', 'wpsc') . "', '0', '0','asiapacific','1');
|
114 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (113, '" . __('Bermuda') ."', 'BM', '" . __('Bermudian Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('BMD', 'wpsc') . "', '0', '0','europe','1');
|
115 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (114, '" . __('Benin') ."', 'BJ', '" . __('CFA Franc BCEAO') . "', '', '', '" . __('XOF', 'wpsc') . "', '0', '0','africa','1');
|
116 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (115, '" . __('Belize') ."', 'BZ', '" . __('Belize Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('BZD', 'wpsc') . "', '0', '0','northamerica','1');
|
117 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (116, '" . __('Belgium') ."', 'BE', '" . __('Euro') . "', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','europe','1');
|
118 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (117, '" . __('Belarus') ."', 'BY', '" . __('Belarussian Ruble') . "', '', '', '" . __('BYB', 'wpsc') . "', '0', '0','europe','1');
|
119 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (118, '" . __('Barbados') ."', 'BB', '" . __('Barbados Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('BBD', 'wpsc') . "', '0', '0','southamerica','1');
|
120 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (119, '" . __('Bangladesh') ."', 'BD', '" . __('Bangladeshi Taka') . "', '', '', '" . __('BDT', 'wpsc') . "', '0', '0','asiapacific','1');
|
121 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (120, '" . __('Bahrain') ."', 'BH', '" . __('Bahraini Dinar') . "', '', '', '" . __('BHD', 'wpsc') . "', '0', '0','asiapacific','1');
|
122 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (121, '" . __('Bahamas') ."', 'BS', '" . __('Bahamian Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('BSD', 'wpsc') . "', '0', '0','northamerica','1');
|
123 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (122, '" . __('Azerbaijan') ."', 'AZ', '" . __('Azerbaijanian Manat') . "', '', '', '" . __('AZM', 'wpsc') . "', '0', '0','asiapacific','1');
|
124 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (123, '" . __('Austria') ."', 'AT', '" . __('Euro') . "', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','europe','1');
|
125 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (124, '" . __('Aruba') ."', 'AW', '" . __('Aruban Guilder') . "', '', '', '" . __('AWG', 'wpsc') . "', '0', '0','southamerica','1');
|
126 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (125, '" . __('Armenia') ."', 'AM', '" . __('Armenian Dram') . "', '', '', '" . __('AMD', 'wpsc') . "', '0', '0','asiapacific','1');
|
127 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (126, '" . __('Argentina') ."', 'AR', '" . __('Argentine Peso') . "', '', '', '" . __('ARS', 'wpsc') . "', '0', '0','southamerica','1');
|
128 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (127, '" . __('Antigua and Barbuda') ."', 'AG', '" . __('East Caribbean Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('XCD', 'wpsc') . "', '0', '0','africa','1');
|
129 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (128, '" . __('Antarctica') ."', 'AQ', '" . __('Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('ATA', 'wpsc') . "', '0', '0','antarctica','1');
|
130 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (129, '" . __('Anguilla') ."', 'AI', '" . __('East Caribbean Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('XCD', 'wpsc') . "', '0', '0','northamerica','1');
|
131 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (130, '" . __('Angola') ."', 'AO', '" . __('Angolan New Kwanza') . "', '', '', '" . __('AON', 'wpsc') . "', '0', '0','africa','1');
|
132 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (131, '" . __('Andorra') ."', 'AD', '" . __('Euro') . "', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','europe','1');
|
133 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (132, '" . __('American Samoa') ."', 'AS', '" . __('US Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('USD', 'wpsc') . "', '0', '0','asiapacific','1');
|
134 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (133, '" . __('Algeria') ."', 'DZ', '" . __('Algerian Dinar') . "', '', '', '" . __('DZD', 'wpsc') . "', '0', '0','africa','1');
|
135 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (134, '" . __('Albania') ."', 'AL', '" . __('Albanian Lek') . "', '', '', '" . __('ALL', 'wpsc') . "', '0', '0','europe','1');
|
136 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (135, '" . __('Afghanistan') ."', 'AF', '" . __('Afghanistan Afghani') . "', '', '', '" . __('AFA', 'wpsc') . "', '0', '0','asiapacific','1');
|
137 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (136, '" . __('USA') ."', 'US', '" . __('US Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('USD', 'wpsc') . "', '1', '','northamerica','1');
|
138 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (137, '" . __('Australia') ."', 'AU', '" . __('Australian Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('AUD', 'wpsc') . "', '0', '0','asiapacific','1');
|
139 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (138, '" . __('Great Britain') ."', 'GB', '" . __('Pound Sterling') . "', '" . __('£', 'wpsc') . "', '" . __('£', 'wpsc') . "', '" . __('GBP', 'wpsc') . "', '0', '0','europe','1');
|
140 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (139, '" . __('Mauritius') ."', 'MU', '" . __('Mauritius Rupee') . "', '', '', '" . __('MUR', 'wpsc') . "', '0', '0','africa','1');
|
141 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (140, '" . __('Mayotte') ."', 'YT', '" . __('Euro') . "', '" . __('€', 'wpsc') . "', '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','europe','1');
|
142 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (141, '" . __('Mexico') ."', 'MX', '" . __('Mexican Nuevo Peso') . "', '', '', '" . __('MXN', 'wpsc') . "', '0', '0','northamerica','1');
|
143 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (142, '" . __('Micronesia') ."', 'FM', '" . __('US Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('USD', 'wpsc') . "', '0', '0','asiapacific','1');
|
144 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (143, '" . __('Moldova') ."', 'MD', '" . __('Moldovan Leu') . "', '', '', '" . __('MDL', 'wpsc') . "', '0', '0','europe','1');
|
145 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (144, '" . __('Monaco') ."', 'MC', '" . __('Euro') . "', " . __('€', 'wpsc') . ", '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','europe','1');
|
146 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (145, '" . __('Mongolia') ."', 'MN', '" . __('Mongolian Tugrik') . "', '', '', '" . __('MNT', 'wpsc') . "', '0', '0','asiapacific','1');
|
147 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (146, '" . __('Montserrat') ."', 'MS', '" . __('East Caribbean Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('XCD', 'wpsc') . "', '0', '0','africa','1');
|
148 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (147, '" . __('Morocco') ."', 'MA', '" . __('Moroccan Dirham') . "', '', '', '" . __('MAD', 'wpsc') . "', '0', '0','africa','1');
|
149 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (148, '" . __('Mozambique') ."', 'MZ', '" . __('Mozambique Metical') . "', '', '', '" . __('MZM', 'wpsc') . "', '0', '0','africa','1');
|
150 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (149, '" . __('Myanmar') ."', 'MM', '" . __('Myanmar Kyat') . "', '', '', '" . __('MMK', 'wpsc') . "', '0', '0','asiapacific','1');
|
151 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (150, '" . __('Namibia') ."', 'NA', '" . __('Namibian Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('NAD', 'wpsc') . "', '0', '0','africa','1');
|
152 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (151, '" . __('Nauru') ."', 'NR', '" . __('Australian Dollar') . "', '" . __('$', 'wpsc') . "', '" . __('$', 'wpsc') . "', '" . __('AUD', 'wpsc') . "', '0', '0','asiapacific','1');
|
153 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (152, '" . __('Nepal') ."', 'NP', '" . __('Nepalese Rupee') . "', '', '', '" . __('NPR', 'wpsc') . "', '0', '0','asiapacific','1');
|
154 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (153, '" . __('Netherlands') ."', 'NL', '" . __('Euro') . "', " . __('€', 'wpsc') . ", '" . __('€', 'wpsc') . "', '" . __('EUR', 'wpsc') . "', '0', '0','europe','1');
|
155 |
+
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (154, '" . __('Netherlands Antilles') ."', 'AN', '" . __('Netherlands Antillean Guilder') . "', '', '', '" . __('ANG', 'wpsc') . "', '0', '0','africa','1');
|
156 |
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (155, '" . __('New Caledonia (French)') ."', 'NC', '" . __('CFP Franc') . "', '', '', 'XPF', '0', '0','asiapacific','1');
|
157 |
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (156, '" . __('New Zealand') ."', 'NZ', '" . __('New Zealand Dollar') . "', '$', '$', 'NZD', '0', '12.5','asiapacific','1');
|
158 |
INSERT INTO `".WPSC_TABLE_CURRENCY_LIST."` VALUES (157, '" . __('Nicaragua') ."', 'NI', '" . __('Nicaraguan Cordoba Oro') . "', '', '', 'NIC', '0', '0','northamerica','1');
|
wpsc-widgets/category_widget.php
CHANGED
@@ -170,7 +170,7 @@ function wpsc_category_widget_admin_category_list( $category, $level, $fieldconf
|
|
170 |
else
|
171 |
$checked = ''; ?>
|
172 |
|
173 |
-
<input type="checkbox" class="checkbox" id="<?php echo $fieldconfig['id']; ?>-<?php echo $category->term_id; ?>" name="<?php echo $fieldconfig['name']; ?>[<?php echo $category->term_id; ?>]" <?php echo $checked; ?>></input> <label for="<?php echo $fieldconfig['id']; ?>-<?php echo $category->term_id; ?>"><?php echo htmlentities($category->name); ?></label><br />
|
174 |
|
175 |
<?php
|
176 |
}
|
170 |
else
|
171 |
$checked = ''; ?>
|
172 |
|
173 |
+
<input type="checkbox" class="checkbox" id="<?php echo $fieldconfig['id']; ?>-<?php echo $category->term_id; ?>" name="<?php echo $fieldconfig['name']; ?>[<?php echo $category->term_id; ?>]" <?php echo $checked; ?>></input> <label for="<?php echo $fieldconfig['id']; ?>-<?php echo $category->term_id; ?>"><?php echo htmlentities($category->name, ENT_QUOTES, 'UTF-8' ); ?></label><br />
|
174 |
|
175 |
<?php
|
176 |
}
|