Changeset 738588
- Timestamp:
- 07/10/2013 07:14:27 AM (13 years ago)
- Location:
- wp-e-commerce/trunk
- Files:
-
- 78 added
- 20 edited
-
.gitignore (modified) (1 diff)
-
readme.txt (modified) (2 diffs, 1 prop)
-
wp-shopping-cart.php (modified) (8 diffs)
-
wpsc-admin/admin.php (modified) (1 diff)
-
wpsc-admin/ajax.php (modified) (2 diffs)
-
wpsc-admin/db-upgrades/routines/4.php (modified) (1 diff)
-
wpsc-admin/display-items.page.php (modified) (2 diffs)
-
wpsc-admin/includes/display-items-functions.php (modified) (4 diffs)
-
wpsc-components/marketplace-core-v1 (added)
-
wpsc-components/marketplace-core-v1/library (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/API (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/API.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/API/Auth.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Admin.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Library (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Library/Plugin (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Library/Plugin.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Library/Plugin/Base.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Library/Plugin/Dynamic.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Library/TwitterOAuth (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Library/TwitterOAuth.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Library/TwitterOAuth/Internal.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Library/TwitterOAuth/LICENSE (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/List (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/List/Account.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/List/Install.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/Consumer.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/DataStore.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/Exception.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/Request.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/Server.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/SignatureMethod (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/SignatureMethod.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/SignatureMethod/HMAC (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/SignatureMethod/HMAC/SHA1.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/SignatureMethod/PLAINTEXT.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/SignatureMethod/RSA (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/SignatureMethod/RSA/SHA1.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/Token.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/OAuth/Util.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Pointers.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/ThemeUpgrader.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Theme_Upgrader.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Updater.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Upgrader (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Upgrader.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/Upgrader/Skin.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Account.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Auth.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Browser (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Browser.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Browser/Grid.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Browser/List.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Info.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Install (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Install.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Install/Skin.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Mini.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/View/Upgrade.php (added)
-
wpsc-components/marketplace-core-v1/library/Sputnik/index.php (added)
-
wpsc-components/marketplace-core-v1/marketplace-core-v1.php (added)
-
wpsc-components/marketplace-core-v1/static (added)
-
wpsc-components/marketplace-core-v1/static/admin.css (added)
-
wpsc-components/marketplace-core-v1/static/admin.js (added)
-
wpsc-components/marketplace-core-v1/static/gray-star.png (added)
-
wpsc-components/marketplace-core-v1/static/grid.png (added)
-
wpsc-components/marketplace-core-v1/static/icon16.png (added)
-
wpsc-components/marketplace-core-v1/static/icon32.png (added)
-
wpsc-components/marketplace-core-v1/static/icons.png (added)
-
wpsc-components/marketplace-core-v1/static/jquery.masonry.js (added)
-
wpsc-components/marketplace-core-v1/static/logo.png (added)
-
wpsc-components/marketplace-core-v1/static/modal.css (added)
-
wpsc-components/marketplace-core-v1/static/modal.js (added)
-
wpsc-components/marketplace-core-v1/static/sputnik.css (added)
-
wpsc-components/marketplace-core-v1/static/sputnik.js (added)
-
wpsc-components/marketplace-core-v1/static/star.png (added)
-
wpsc-components/merchant-core-v2/helpers/admin.php (modified) (1 diff)
-
wpsc-components/theme-engine-v1/classes/wpsc-products-by-category.php (modified) (2 diffs)
-
wpsc-core/js/wp-e-commerce.js (modified) (2 diffs)
-
wpsc-core/wpsc-constants.php (modified) (2 diffs)
-
wpsc-core/wpsc-functions.php (modified) (5 diffs)
-
wpsc-core/wpsc-includes.php (modified) (1 diff)
-
wpsc-includes/cart.class.php (modified) (3 diffs)
-
wpsc-includes/coupons.class.php (modified) (1 diff)
-
wpsc-includes/meta.class.php (added)
-
wpsc-includes/product-template.php (modified) (1 diff)
-
wpsc-includes/wpsc-meta-cart-item.php (added)
-
wpsc-includes/wpsc-meta-functions-template.txt (added)
-
wpsc-includes/wpsc-meta-init.php (added)
-
wpsc-includes/wpsc-meta-visitor.php (added)
-
wpsc-languages/wpsc-it_IT.mo (modified) (previous)
-
wpsc-languages/wpsc-it_IT.po (modified) (1 diff)
-
wpsc-updates/database_template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-e-commerce/trunk/.gitignore
r670272 r738588 1 .idea 1 cookbooks 2 tmp -
wp-e-commerce/trunk/readme.txt
-
Property
svn:executable
set to
*
r734598 r738588 5 5 Requires at least: 3.4 6 6 Tested up to: 3.6 7 Stable tag: 3.8.12 7 Stable tag: 3.8.12.1 8 8 9 9 WP e-Commerce is a free WordPress Shopping Cart Plugin that lets customers buy your products, services and digital downloads online. … … 147 147 == Changelog == 148 148 149 = 3.8.12.1 = 150 * Fix: Fatal error in wpsc_product_list_exclude_child_categories() due to other themes 151 or plugins calling get_posts() before the main query is set up 152 149 153 = 3.8.12 = 150 154 * New: Filter to hide drafts on the front-end: "wpsc_product_display_status" 151 155 * New: Shipwire staging / production option 152 * New: Database upgrade routine to migrate product metadata from old installations153 156 * Change: Remove deprecated and unused javascript (and by extension, CSS) from core 154 157 * Change: Remove nusoap -
Property
svn:executable
set to
-
wp-e-commerce/trunk/wp-shopping-cart.php
r734596 r738588 4 4 * Plugin URI: http://getshopped.org/ 5 5 * Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://getshopped.org" target="_blank">GetShopped.org</a> | <a href="http://getshopped.org/forums/" target="_blank">Support Forum</a> | <a href="http://docs.getshopped.org/" target="_blank">Documentation</a> 6 * Version: 3.8.1 2-beta6 * Version: 3.8.13-dev 7 7 * Author: Instinct Entertainment 8 8 * Author URI: http://getshopped.org/ … … 18 18 class WP_eCommerce { 19 19 private $components = array( 20 'merchant' => array(), 20 'merchant' => array(), 21 'marketplace' => array(), 21 22 ); 22 23 … … 27 28 * @uses add_action() Attaches to 'wpsc_components' hook 28 29 */ 29 function WP_eCommerce() {30 function __construct() { 30 31 add_action( 'plugins_loaded' , array( $this, 'init' ), 8 ); 31 add_ action( 'wpsc_components', array( $this, '_register_core_components' ) );32 add_filter( 'wpsc_components', array( $this, '_register_core_components' ) ); 32 33 } 33 34 … … 57 58 58 59 /** 59 * @todo we need documentation finished here 60 * 61 * @param array $components 62 * 63 * @return array 60 * New WPSC components API. 61 * 62 * Allows for modular coupling of different functionalities within WPSC. 63 * This is the way we'll be introducing cutting-edge APIs 64 * 65 * @since 3.8.9.5 66 * 67 * @param array $components 68 * @return array $components 64 69 */ 65 70 public function _register_core_components( $components ) { 66 71 $components['merchant']['core-v2'] = array( 67 'title' => __( 'WP e-Commerce Merchant API v2', 'wpsc' ),72 'title' => __( 'WP e-Commerce Merchant API v2', 'wpsc' ), 68 73 'includes' => 69 74 WPSC_FILE_PATH . '/wpsc-components/merchant-core-v2/merchant-core-v2.php' … … 71 76 72 77 $components['theme-engine']['core-v1'] = array( 73 'title' => __( 'WP e-Commerce Theme Engine v1', 'wpsc' ),78 'title' => __( 'WP e-Commerce Theme Engine v1', 'wpsc' ), 74 79 'includes' => 75 80 WPSC_FILE_PATH . '/wpsc-components/theme-engine-v1/theme-engine-v1.php' 81 ); 82 83 $components['marketplace']['core-v1'] = array( 84 'title' => __( 'WP e-Commerce Marketplace API v1', 'wpsc' ), 85 'includes' => 86 WPSC_FILE_PATH . '/wpsc-components/marketplace-core-v1/marketplace-core-v1.php' 76 87 ); 77 88 … … 99 110 100 111 //load text domain 101 if ( !load_plugin_textdomain( 'wpsc', false, '../languages/' ) )112 if ( ! load_plugin_textdomain( 'wpsc', false, '../languages/' ) ) 102 113 load_plugin_textdomain( 'wpsc', false, dirname( plugin_basename( __FILE__ ) ) . '/wpsc-languages/' ); 103 114 … … 193 204 do_action( 'wpsc_before_init' ); 194 205 195 // Setup the customer ID just in case to make sure it's set up correctly196 _wpsc_action_create_customer_id( 'create' );197 198 206 // Setup the core WPEC globals 199 207 wpsc_core_setup_globals(); 200 208 201 // Setup the c ore WPEC cart202 wpsc_core_setup_cart();209 // Setup the customer ID just in case to make sure it's set up correctly 210 add_action( 'init', '_wpsc_action_setup_customer', 1 ); 203 211 204 212 // Load the purchase log statuses … … 227 235 function install() { 228 236 global $wp_version; 229 if((float)$wp_version < 3.0){ 230 deactivate_plugins(plugin_basename(__FILE__)); // Deactivate ourselves 231 wp_die( __('Looks like you\'re running an older version of WordPress, you need to be running at least WordPress 3.0 to use WP e-Commerce 3.8', 'wpsc'), __('WP e-Commerce 3.8 not compatible', 'wpsc'), array('back_link' => true)); 237 238 if ( ( float ) $wp_version < 3.0 ) { 239 deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate ourselves 240 wp_die( __( 'Looks like you\'re running an older version of WordPress, you need to be running at least WordPress 3.0 to use WP e-Commerce 3.8', 'wpsc' ), __( 'WP e-Commerce 3.8 not compatible', 'wpsc' ), array( 'back_link' => true ) ); 232 241 return; 233 242 } -
wp-e-commerce/trunk/wpsc-admin/admin.php
r725142 r738588 59 59 return $vars; 60 60 } 61 62 /** 63 * Admin Edit Posts Order 64 * 65 * @since 3.8.12 66 * @access public 67 * 68 * @param string $orderby_sql Order by SQL. 69 * @return string Filtered order by SQL. 70 */ 71 function wpsc_admin_edit_posts_orderby( $orderby_sql ) { 72 global $wp_query, $wpdb; 73 if ( 'dragndrop' == get_option( 'wpsc_sort_by' ) ) { 74 if ( function_exists( 'is_main_query' ) && is_main_query() && 'wpsc-product' == get_query_var( 'post_type' ) && is_tax( 'wpsc_product_category' ) ) { 75 if ( ! empty( $orderby_sql ) ) 76 $orderby_sql = ', ' . $orderby_sql; 77 $orderby_sql = " {$wpdb->term_relationships}.term_order ASC" . $orderby_sql; 78 remove_filter( 'posts_orderby', 'wpsc_admin_edit_posts_orderby' ); 79 } 80 } 81 return $orderby_sql; 82 } 83 add_filter( 'posts_orderby', 'wpsc_admin_edit_posts_orderby' ); 61 84 62 85 /** -
wp-e-commerce/trunk/wpsc-admin/ajax.php
r725142 r738588 531 531 } 532 532 533 // Validate data before exposing to action 534 $category = isset( $_POST['category_id'] ) ? get_term_by( 'slug', $_POST['category_id'], 'wpsc_product_category' ) : false; 535 do_action( 'wpsc_save_product_order', $products, $category ); 536 533 537 if ( ! empty( $failed ) ) { 534 538 $error_data = array( … … 543 547 ); 544 548 } 549 550 /** 551 * Save Category Product Order 552 * 553 * Note that this uses the 'term_order' field in the 'term_relationships' table to store 554 * the order. Although this column presently seems to be unused by WordPress, the intention 555 * is it should be used to store the order of terms associates to a post, not the order 556 * of posts as we are doing. This shouldn't be an issue for WPEC unless WordPress adds a UI 557 * for this. More info at http://core.trac.wordpress.org/ticket/9547 558 * 559 * @since 3.9 560 * @access private 561 * 562 * @uses $wpdb WordPress database object used for queries 563 */ 564 function _wpsc_save_category_product_order( $products, $category ) { 565 global $wpdb; 566 567 // Only save category product order if in category 568 if ( ! $category ) 569 return; 570 571 // Save product order in term_relationships table 572 foreach ( $products as $order => $product_id ) { 573 $wpdb->update( $wpdb->term_relationships, 574 array( 'term_order' => $order ), 575 array( 'object_id' => $product_id, 'term_taxonomy_id' => $category->term_taxonomy_id ), 576 array( '%d' ), 577 array( '%d', '%d' ) 578 ); 579 } 580 } 581 add_action( 'wpsc_save_product_order', '_wpsc_save_category_product_order', 10, 2 ); 545 582 546 583 /** -
wp-e-commerce/trunk/wpsc-admin/db-upgrades/routines/4.php
r708401 r738588 20 20 ); 21 21 22 wpsc_flush_theme_transients( true ); 22 if ( function_exists( 'wpsc_flush_theme_transients' ) ) 23 wpsc_flush_theme_transients( true ); 23 24 24 25 //Make sure the theme has actually been moved. -
wp-e-commerce/trunk/wpsc-admin/display-items.page.php
r734596 r738588 86 86 * @param boolean $has_variations Whether the product has variations 87 87 * 88 * @uses esc_html_e() Safe HTML with translation 89 * @uses get_post_meta() Gets post meta given key and post_id 90 * @uses maybe_unserialize() Unserialize value only if it was serialized. 91 * @uses wpsc_convert_weight() Does weight conversions 92 * @uses esc_html() Makes sure things are safe 88 * @uses esc_html_e() Safe HTML with translation 89 * @uses get_post_meta() Gets post meta given key and post_id 90 * @uses maybe_unserialize() Unserialize value only if it was serialized. 91 * @uses wpsc_convert_weight() Does weight conversions 92 * @uses esc_html() Makes sure things are safe 93 * @uses wpsc_weight_unit_display() Gets weight unit for display 93 94 */ 94 95 function _wpsc_manage_products_column_weight( $post, $post_id, $has_variations ) { … … 118 119 $unit = $product_data['meta']['_wpsc_product_metadata']['weight_unit']; 119 120 120 switch( $unit ) { 121 case "pound": 122 $unit = __(" lbs.", "wpsc"); 123 break; 124 case "ounce": 125 $unit = __(" oz.", "wpsc"); 126 break; 127 case "gram": 128 $unit = __(" g", "wpsc"); 129 break; 130 case "kilograms": 131 case "kilogram": 132 $unit = __(" kgs.", "wpsc"); 133 break; 134 } 135 echo $weight.$unit; 121 echo $weight . wpsc_weight_unit_display( $unit ); 136 122 echo '<div id="inline_' . $post->ID . '_weight" class="hidden">' . esc_html( $weight ) . '</div>'; 137 123 } -
wp-e-commerce/trunk/wpsc-admin/includes/display-items-functions.php
r708401 r738588 417 417 } 418 418 419 /** 420 * Dimension Units 421 * 422 * @since 3.8.13 423 * 424 * @return array List of valid dimension units. 425 */ 426 function wpsc_dimension_units() { 427 return array( 428 'in' => __( 'inches', 'wpsc' ), 429 'cm' => __( 'cm', 'wpsc' ), 430 'meter' => __( 'meters', 'wpsc' ) 431 ); 432 } 433 434 /** 435 * Weight Units 436 * 437 * @since 3.8.13 438 * 439 * @return array List of valid weight units. 440 */ 441 function wpsc_weight_units() { 442 return array( 443 'pound' => __( 'pounds', 'wpsc' ), 444 'ounce' => __( 'ounces', 'wpsc' ), 445 'gram' => __( 'grams', 'wpsc' ), 446 'kilogram' => __( 'kilograms', 'wpsc' ) 447 ); 448 } 449 450 /** 451 * Weight Unit Display 452 * 453 * Returns a weight unit abbreviation for display. 454 * 455 * @since 3.8.13 456 * 457 * @param string $unit Weight unit. 458 * @return string Weight unit string. 459 */ 460 function wpsc_weight_unit_display( $unit ) { 461 switch ( $unit ) { 462 case 'pound' : 463 return __( ' lbs.', 'wpsc' ); 464 case 'ounce' : 465 return __( ' oz.', 'wpsc' ); 466 case 'gram' : 467 return __( ' g', 'wpsc' ); 468 case 'kilograms' : 469 case 'kilogram' : 470 return __( ' kgs.', 'wpsc' ); 471 } 472 return ''; 473 } 474 475 /** 476 * Validate Dimension Unit 477 * 478 * Returns a valid dimensions unit. 479 * If the unit is not set or invalid it will be filtered using 'wpsc_default_dimension_unit' 480 * so that an alternative default unit can be set. 481 * 482 * @since 3.8.13 483 * 484 * @param string $unit Dimension unit. 485 * @return string Dimension unit string. 486 * 487 * @uses wpsc_default_dimension_unit 488 */ 489 function wpsc_validate_dimension_unit( $unit = '' ) { 490 $default_unit = apply_filters( 'wpsc_default_dimension_unit', $unit ); 491 if ( empty( $unit ) && array_key_exists( $default_unit, wpsc_dimension_units() ) ) 492 $unit = $default_unit; 493 return $unit; 494 } 495 496 /** 497 * Validate Weight Unit 498 * 499 * Returns a valid weight unit. 500 * If the unit is not set or invalid it will be filtered using 'wpsc_default_weight_unit' 501 * so that an alternative default unit can be set. 502 * 503 * @since 3.8.13 504 * 505 * @param string $unit Weight unit. 506 * @return string Weight unit string. 507 * 508 * @uses wpsc_default_weight_unit 509 */ 510 function wpsc_validate_weight_unit( $unit = '' ) { 511 $default_unit = apply_filters( 'wpsc_default_weight_unit', $unit ); 512 if ( empty( $unit ) && array_key_exists( $default_unit, wpsc_weight_units() ) ) 513 $unit = $default_unit; 514 return $unit; 515 } 516 517 /** 518 * Product Shipping Forms 519 * 520 * @uses wpsc_validate_weight_unit() 521 * @uses wpsc_validate_dimension_unit() 522 */ 419 523 function wpsc_product_shipping_forms( $product = false, $field_name_prefix = 'meta[_wpsc_product_metadata]', $bulk = false ) { 420 524 if ( ! $product ) … … 429 533 $defaults = array( 430 534 'weight' => '', 431 'weight_unit' => '',535 'weight_unit' => wpsc_validate_weight_unit(), 432 536 'dimensions' => array(), 433 537 'shipping' => array(), … … 436 540 ); 437 541 $dimensions_defaults = array( 438 'height_unit' => '',439 'width_unit' => '',440 'length_unit' => '',542 'height_unit' => wpsc_validate_dimension_unit(), 543 'width_unit' => wpsc_validate_dimension_unit(), 544 'length_unit' => wpsc_validate_dimension_unit(), 441 545 'height' => 0, 442 546 'width' => 0, … … 459 563 $weight = wpsc_convert_weight( $weight, 'pound', $weight_unit ); 460 564 461 $dimension_units = array( 462 'in' => __( 'inches', 'wpsc' ), 463 'cm' => __( 'cm', 'wpsc' ), 464 'meter' => __( 'meters', 'wpsc' ) 465 ); 466 467 $weight_units = array( 468 'pound' => __( 'pounds', 'wpsc' ), 469 'ounce' => __( 'ounces', 'wpsc' ), 470 'gram' => __( 'grams', 'wpsc' ), 471 'kilogram' => __( 'kilograms', 'wpsc' ) 472 ); 565 $dimension_units = wpsc_dimension_units(); 566 $weight_units = wpsc_weight_units(); 473 567 474 568 $measurements = $dimensions; -
wp-e-commerce/trunk/wpsc-components/merchant-core-v2/helpers/admin.php
r708401 r738588 79 79 $return = array( 80 80 'name' => $selected_gateway_data['name'], 81 'form_fields' => $output . $selected_gateway_data['form'](),81 'form_fields' => $output . call_user_func( $selected_gateway_data['form'] ), 82 82 'has_submit_button' => 0, 83 83 ); -
wp-e-commerce/trunk/wpsc-components/theme-engine-v1/classes/wpsc-products-by-category.php
r734596 r738588 57 57 58 58 $this->sql_components['join'] = $join; 59 $this->sql_components['fields'] = "{$wpdb->posts}.*, {$wpdb->term_taxonomy}.term_id ";59 $this->sql_components['fields'] = "{$wpdb->posts}.*, {$wpdb->term_taxonomy}.term_id, {$wpdb->term_relationships}.term_order"; 60 60 $this->sql_components['group_by'] = $groupby; 61 61 … … 64 64 $whichcat .= " AND $wpdb->postmeta.meta_key = '_wpsc_price'"; 65 65 }else{ 66 $this->sql_components['order_by'] = "{$wpdb->term_taxonomy}.term_id"; 66 67 67 $this->sql_components['order_by'] = "{$wpdb->term_taxonomy}.term_id"; 68 // Term Taxonomy ID Ordering 69 if ( $q['orderby'] == 'menu_order' ) { 70 if ( $term_data ) { 71 $this->sql_components['order_by'] = "{$wpdb->term_relationships}.term_order ASC"; 72 } 73 } 68 74 } 69 75 $this->sql_components['where'] = $whichcat; -
wp-e-commerce/trunk/wpsc-core/js/wp-e-commerce.js
r734596 r738588 437 437 } 438 438 439 // submit the fancy notifications forms.439 //submit the fancy notifications forms. 440 440 function wpsc_fancy_notification(parent_form){ 441 441 if(typeof(WPSC_SHOW_FANCY_NOTIFICATION) == 'undefined'){ … … 443 443 } 444 444 if((WPSC_SHOW_FANCY_NOTIFICATION == true) && (jQuery('#fancy_notification') != null)){ 445 var options = { 446 margin: 1 , 447 border: 1 , 448 padding: 1 , 449 scroll: 1 450 }; 451 452 form_button_id = jQuery(parent_form).attr('id') + "_submit_button"; 453 var button_offset = jQuery('#'+form_button_id).offset(); 454 455 jQuery('#fancy_notification').css("left", (button_offset.left - 130) + 'px'); 456 jQuery('#fancy_notification').css("top", (button_offset.top + 40) + 'px'); 457 445 jQuery('#fancy_notification').css({ 446 position:'fixed', 447 left: (jQuery(window).width() - jQuery('#fancy_notification').outerWidth())/2, 448 top: (jQuery(window).height() - jQuery('#fancy_notification').outerHeight())/2 449 }); 458 450 459 451 jQuery('#fancy_notification').css("display", 'block'); -
wp-e-commerce/trunk/wpsc-core/wpsc-constants.php
r734596 r738588 29 29 define( 'WPSC_URL', plugins_url( '', __FILE__ ) ); 30 30 // Define Plugin version 31 define( 'WPSC_VERSION', '3.8.1 2-beta' );32 define( 'WPSC_MINOR_VERSION', ' 55f8cfa0d7' );33 define( 'WPSC_PRESENTABLE_VERSION', '3.8.1 2-beta' );31 define( 'WPSC_VERSION', '3.8.13-dev' ); 32 define( 'WPSC_MINOR_VERSION', '819b5037cc' ); 33 define( 'WPSC_PRESENTABLE_VERSION', '3.8.13-dev' ); 34 34 define( 'WPSC_DB_VERSION', 5 ); 35 35 … … 260 260 else 261 261 $GLOBALS['wpsc_cart'] = new wpsc_cart(); 262 263 $GLOBALS['wpsc_cart']->get_shipping_method(); 262 264 } 263 265 -
wp-e-commerce/trunk/wpsc-core/wpsc-functions.php
r734596 r738588 206 206 */ 207 207 function wpsc_core_load_shipping_modules() { 208 global $wpsc_shipping_modules , $wpsc_cart;208 global $wpsc_shipping_modules; 209 209 210 210 $shipping_directory = WPSC_FILE_PATH . '/wpsc-shipping'; … … 219 219 $wpsc_shipping_modules = apply_filters( 'wpsc_shipping_modules', $wpsc_shipping_modules ); 220 220 221 if ( ! get_option( 'do_not_use_shipping' ) && empty( $wpsc_cart->selected_shipping_method ) ) 221 if ( ! get_option( 'do_not_use_shipping' ) ) 222 add_action( 'wpsc_setup_customer', '_wpsc_action_get_shipping_method' ); 223 } 224 225 /** 226 * If shipping is enabled and shipping methods have not been initialized, then 227 * do so. 228 * 229 * @access private 230 * @since 3.8.13 231 */ 232 function _wpsc_action_get_shipping_method() { 233 global $wpsc_cart; 234 if ( empty( $wpsc_cart->selected_shipping_method ) ) 222 235 $wpsc_cart->get_shipping_method(); 223 236 } … … 429 442 global $wpdb, $wpsc_start_time, $wpsc_cart; 430 443 444 if ( is_admin() ) 445 return; 446 431 447 // avoid flooding transients with bots hitting feeds 432 448 if ( is_feed() ) { … … 457 473 function wpsc_get_page_post_names() { 458 474 $wpsc_page['products'] = basename( get_option( 'product_list_url' ) ); 475 if ( empty($wpsc_page['products']) || false !== strpos($wpsc_page['products'], '?page_id=') ) { 476 // Products page either doesn't exist, or is a draft 477 // Default to /product/xyz permalinks for products 478 $wpsc_page['products'] = 'product'; 479 } 459 480 $wpsc_page['checkout'] = basename( get_option( 'checkout_url' ) ); 460 481 $wpsc_page['transaction_results'] = basename( get_option( 'transact_url' ) ); … … 717 738 718 739 /** 719 * Create customer ID upon 'plugins_loaded' to make sure there's one exists before 720 * anything else. 740 * Setup current user object and customer ID as well as cart. 741 * 742 * @uses do_action() Calls 'wpsc_setup_customer' after customer data is ready 721 743 * 722 744 * @access private 723 * @since 3.8. 9724 */ 725 function _wpsc_action_ create_customer_id() {745 * @since 3.8.13 746 */ 747 function _wpsc_action_setup_customer() { 726 748 wpsc_get_current_customer_id( 'create' ); 749 wpsc_core_setup_cart(); 750 do_action( 'wpsc_setup_customer' ); 727 751 } 728 752 -
wp-e-commerce/trunk/wpsc-core/wpsc-includes.php
r734596 r738588 49 49 include_once( WPSC_FILE_PATH . '/wpsc-widgets/admin_menu_widget.php' ); 50 50 51 // Meta 52 require_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-meta-init.php' ); 53 51 54 // Gregs ASH Shipping 52 55 require_once( WPSC_FILE_PATH . '/wpsc-includes/shipping.helper.php' ); -
wp-e-commerce/trunk/wpsc-includes/cart.class.php
r734596 r738588 208 208 209 209 /** 210 * Product Minimum Cart Quantity 211 * 212 * @since 3.8.13 213 * @access public 214 * 215 * @param int $prod_id Optional. Product ID. 216 * @return int The minimum quantity that can be added to the cart. 217 * 218 * @uses apply_filters Calls 'wpsc_product_min_cart_quantity' passing product ID. 219 */ 220 function wpsc_product_min_cart_quantity( $product_id = 0 ) { 221 $product_id = absint( $product_id ); 222 return apply_filters( 'wpsc_product_min_cart_quantity', 1, $product_id ); 223 } 224 225 /** 210 226 * Validate Product Cart Quantity 211 227 * Checks that the quantity is within the permitted bounds and return a valid quantity. … … 219 235 * 220 236 * @uses wpsc_product_max_cart_quantity Gets the maximum product cart quantity. 237 * @uses wpsc_product_min_cart_quantity Gets the minimum product cart quantity. 221 238 */ 222 239 function wpsc_validate_product_cart_quantity( $quantity, $product_id = 0 ) { 223 240 $max_quantity = wpsc_product_max_cart_quantity( $product_id ); 241 $min_quantity = wpsc_product_min_cart_quantity( $product_id ); 224 242 if ( $quantity > $max_quantity ) 225 243 return $max_quantity; 244 if ( $quantity < $min_quantity ) 245 return $min_quantity; 226 246 return $quantity; 227 247 } … … 367 387 $this->wpsc_refresh_cart_items(); 368 388 $this->unique_id = sha1(uniqid(rand(), true)); 369 $this->get_shipping_method();370 389 } 371 390 -
wp-e-commerce/trunk/wpsc-includes/coupons.class.php
r725142 r738588 164 164 $id = $product_data->post_parent; 165 165 166 return has_term( $condition['value'], 'wpsc_product_category', $id ); 166 $category_condition = $condition['value']; 167 if ( false !== strpos( $category_condition, ',' ) ) { 168 $category_condition = explode( ',', $condition['value'] ); 169 $category_condition = array_map( 'trim', $cond ); 170 } 171 return has_term( $category_condition, 'wpsc_product_category', $id ); 167 172 break; 168 173 -
wp-e-commerce/trunk/wpsc-includes/product-template.php
r734596 r738588 10 10 * @subpackage wpsc-template-functions 11 11 */ 12 13 /** 14 * Get The Product Excerpt 15 * 16 * WPEC uses the excerpt field in the database to store additional product details. 17 * This means that where themes output the excerpt (like in search results) the product's 18 * additional details are displayed which is not the expected behaviour. 19 * 20 * This function filters the excerpt early and returns an empty string which forces the default 21 * WordPress behaviour to use a truncated version of the content instead. 22 * 23 * Always use wpsc_the_product_additional_description() to return the addition product description. 24 * 25 * @since 3.8.13 26 * 27 * @param string $excerpt The post excerpt (which for products is the additional description). 28 * @return string The empty excerpt. 29 */ 30 function wpsc_get_the_excerpt( $excerpt ) { 31 if ( 'wpsc-product' == get_post_type() ) 32 return ''; 33 return $excerpt; 34 } 35 add_filter( 'get_the_excerpt', 'wpsc_get_the_excerpt', 2 ); 12 36 13 37 /** -
wp-e-commerce/trunk/wpsc-languages/wpsc-it_IT.po
r402326 r738588 4091 4091 4092 4092 #: wpsc-theme/wpsc-shopping_cart_page.php:88 4093 msgid "Enter coupon code "4093 msgid "Enter coupon code :" 4094 4094 msgstr "Inserire il codice coupon" 4095 4095 -
wp-e-commerce/trunk/wpsc-updates/database_template.php
r725142 r738588 209 209 $wpsc_database_template[$table_name]['indexes']['cart_submitted'] = "KEY `cart_submitted` ( `cart_submitted` )"; 210 210 211 // code to create or update the all of the wpsc custom meta tables that are managed using the wordpress meta functionalilty 212 // the meta object types should be those listed in the wpsc_meta_core_object_types() function, they are repeated here to allow 213 // the database init and upgrade to happen prior to the include of the meta function defintions 214 $meta_object_types = array( 'cart_item', 'visitor' ); 215 foreach ( $meta_object_types as $meta_object_type ) { 216 $table_name = $wpdb->prefix.$meta_object_type.'_meta'; // this is the same as the function wpsc_meta_table_name( $meta_object_type ); 217 $wpsc_database_template[$table_name]['columns']['meta_id'] = "bigint(20) unsigned NOT NULL AUTO_INCREMENT "; 218 $wpsc_database_template[$table_name]['columns'][$meta_object_type.'_id'] = "bigint(20) unsigned NOT NULL DEFAULT '0' "; 219 $wpsc_database_template[$table_name]['columns']['meta_key'] = "varchar(255) default NULL "; 220 $wpsc_database_template[$table_name]['columns']['meta_value'] = "longtext "; 221 $wpsc_database_template[$table_name]['columns']['meta_timestamp'] = "timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP "; 222 $wpsc_database_template[$table_name]['indexes']['PRIMARY'] = "PRIMARY KEY ( `meta_id` ) "; 223 $wpsc_database_template[$table_name]['indexes']['meta_key'] = "KEY `meta_key` ( `meta_key`(191) ) "; 224 $wpsc_database_template[$table_name]['indexes']['meta_value'] = "KEY `meta_value` ( `meta_value`(20) ) "; 225 $wpsc_database_template[$table_name]['indexes']['meta_key_and_value'] = "KEY `meta_key_and_value` ( `meta_key`(191), `meta_value`(32) ) "; 226 $wpsc_database_template[$table_name]['indexes']['meta_timestamp_index'] = "KEY meta_timestamp_index (meta_timestamp) "; 227 $wpsc_database_template[$table_name]['indexes'][$meta_object_type.'_id'] = 'KEY '.$meta_object_type.'_id ( `' . $meta_object_type . '_id` ) '; 228 if ( function_exists( $meta_migrate_function_name = 'wpsc_meta_migrate_'.$meta_object_type ) ) { 229 $wpsc_database_template[$table_name]['actions']['after']['all'] = $meta_migrate_function_name; 230 } 231 } 211 232 212 233 ?>
Note: See TracChangeset
for help on using the changeset viewer.