Version Description
[2017-2-17] =
- Fix: When updating a pending order, ensure that the order object's total price is updated as well.
- Fix: Update admin.js to not use deprecated size() method.
- Fix: Currency code was incorrectly cached.
- Fix: Express Checkout 3.0 JavaScript now properly enqueued.
- Enhancement: 2.0 Theme Engine now supports floating labels.
- Enhancement: Payment Gateway API now fully supports Auth/Capture workflows, in addition to refunds and partial refunds introduced in 3.11.5
- New: Addition of ProPay (TSYS) Gateway.
Download this release
Release Info
Developer | JustinSainton |
Plugin | WP eCommerce |
Version | 3.12.0 |
Comparing to | |
See all releases |
Code changes from version 3.11.7 to 3.12.0
- readme.txt +12 -2
- wp-shopping-cart.php +3 -2
- wpsc-admin/admin.php +11 -4
- wpsc-admin/ajax.php +108 -56
- wpsc-admin/css/admin.css +12 -0
- wpsc-admin/css/settingspage.css +14 -1
- wpsc-admin/display-sales-logs.php +78 -54
- wpsc-admin/display-upgrades.page.php +54 -91
- wpsc-admin/includes/duplicate-product-class.php +14 -15
- wpsc-admin/includes/purchase-log-list-table-class.php +2 -2
- wpsc-admin/includes/purchase-logs-page/item-details.php +4 -1
- wpsc-admin/init.php +6 -5
- wpsc-admin/js/admin.js +2 -5
- wpsc-admin/js/purchase-logs.js +46 -13
- wpsc-admin/js/settings-page.js +1 -0
- wpsc-components/marketplace-core-v1/library/Sputnik.php +2 -2
- wpsc-components/merchant-core-v2/helpers/checkout.php +9 -3
- wpsc-components/merchant-core-v3/classes/payment-gateway.php +35 -17
- wpsc-components/merchant-core-v3/gateways/amazon-payments.php +21 -22
- wpsc-components/merchant-core-v3/gateways/manual.php +4 -3
- wpsc-components/merchant-core-v3/gateways/paypal-digital-goods.php +22 -22
- wpsc-components/merchant-core-v3/gateways/paypal-express-checkout.php +38 -28
- wpsc-components/merchant-core-v3/gateways/paypal-pro.php +16 -15
- wpsc-components/merchant-core-v3/gateways/pro-pay.php +1164 -0
- wpsc-components/merchant-core-v3/gateways/worldpay.php +4 -4
- wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/hard-decline-email-de.php +2 -2
- wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/hard-decline-email-en.php +2 -2
- wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/hard-decline-email-es.php +2 -2
- wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/hard-decline-email-fr.php +2 -2
- wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/hard-decline-email-it.php +2 -2
- wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/soft-decline-email-de.php +2 -2
- wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/soft-decline-email-en.php +2 -2
- wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/soft-decline-email-es.php +2 -2
- wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/soft-decline-email-fr.php +2 -2
- wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/soft-decline-email-it.php +2 -2
- wpsc-components/merchant-core-v3/libraries/pro-pay/js/hpp.js +454 -0
- wpsc-components/merchant-core-v3/libraries/pro-pay/js/pro-pay-admin.js +52 -0
- wpsc-components/merchant-core-v3/libraries/pro-pay/js/pro-pay-checkout.js +273 -0
- wpsc-components/merchant-core-v3/libraries/pro-pay/js/signal-r.js +8 -0
- wpsc-components/theme-engine-v1/helpers/page.php +16 -10
- wpsc-components/theme-engine-v2/classes/template-engine.php +20 -0
- wpsc-components/theme-engine-v2/helpers/css.php +3 -0
- wpsc-components/theme-engine-v2/helpers/form.php +20 -3
- wpsc-components/theme-engine-v2/helpers/js.php +23 -0
- wpsc-components/theme-engine-v2/helpers/template-tags/product.php +16 -0
- wpsc-components/theme-engine-v2/mvc/controllers/cart.php +1 -0
- wpsc-components/theme-engine-v2/mvc/controllers/category.php +1 -0
- wpsc-components/theme-engine-v2/mvc/controllers/checkout.php +3 -0
- wpsc-components/theme-engine-v2/mvc/controllers/customer-account.php +1 -0
- wpsc-components/theme-engine-v2/mvc/controllers/login.php +1 -0
- wpsc-components/theme-engine-v2/mvc/controllers/main-store.php +1 -0
- wpsc-components/theme-engine-v2/mvc/controllers/password-reminder.php +1 -0
- wpsc-components/theme-engine-v2/mvc/controllers/register.php +3 -2
- wpsc-components/theme-engine-v2/mvc/controllers/single.php +20 -1
- wpsc-components/theme-engine-v2/snippets/cart-item-table/display.php +3 -1
- wpsc-components/theme-engine-v2/theming/assets/css/common.css +1 -1
- wpsc-components/theme-engine-v2/theming/assets/css/wpsc-fluid-box.min.css +1 -0
- wpsc-components/theme-engine-v2/theming/assets/css/wpsc-responsive.css +240 -15
- wpsc-components/theme-engine-v2/theming/assets/css/wpsc-responsive.css.map +2 -2
- wpsc-components/theme-engine-v2/theming/assets/css/wpsc-responsive.min.css +1 -1
- wpsc-components/theme-engine-v2/theming/assets/js/checkout.js +6 -0
- wpsc-components/theme-engine-v2/theming/assets/js/fluidbox.js +711 -0
- wpsc-components/theme-engine-v2/theming/assets/js/jquery.FloatLabel.js +54 -0
- wpsc-components/theme-engine-v2/theming/assets/js/products.js +25 -0
- wpsc-components/theme-engine-v2/theming/assets/scss/partials/_checkout.scss +39 -30
- wpsc-components/theme-engine-v2/theming/assets/scss/partials/_fluidbox.scss +104 -0
- wpsc-components/theme-engine-v2/theming/assets/scss/partials/_js-float-label.scss +51 -0
- wpsc-components/theme-engine-v2/theming/assets/scss/partials/_product-forms.scss +27 -0
- wpsc-components/theme-engine-v2/theming/assets/scss/partials/_product-grid.scss +5 -1
- wpsc-components/theme-engine-v2/theming/assets/scss/partials/_product-list.scss +15 -0
- wpsc-components/theme-engine-v2/theming/assets/scss/wpsc-responsive.scss +2 -0
- wpsc-components/theme-engine-v2/theming/template-parts/single.php +3 -3
- wpsc-core/js/wp-e-commerce.js +1 -1
- wpsc-core/wpsc-constants.php +2 -2
- wpsc-core/wpsc-functions.php +35 -2
- wpsc-core/wpsc-includes.php +3 -3
- wpsc-includes/cart.class.php +5 -12
- wpsc-includes/category.functions.php +1 -1
- wpsc-includes/checkout-form-data.class.php +11 -11
- wpsc-includes/coupon.class.php +30 -26
- wpsc-includes/cron.php +51 -1
- wpsc-includes/mimetype.php +2 -2
- wpsc-includes/processing.functions.php +1 -1
- wpsc-includes/product-template.php +4 -4
- wpsc-includes/purchase-log-notes.class.php +36 -13
- wpsc-includes/purchase-log.class.php +105 -27
- wpsc-includes/purchase-log.helpers.php +79 -35
- wpsc-includes/purchaselogs.functions.php +2 -2
- wpsc-includes/query-base.class.php +22 -22
- wpsc-includes/shopping_cart_functions.php +1 -1
- wpsc-includes/variations.class.php +5 -5
- wpsc-includes/wp-cli/wpsc-wp-cli-category.php +1 -1
- wpsc-includes/wp-cli/wpsc-wp-cli-product-tag.php +1 -1
- wpsc-includes/wpsc-customizer-thumbnail-control.class.php +2 -2
- wpsc-includes/wpsc-customizer.class.php +2 -2
- wpsc-includes/wpsc-logging.class.php +2 -2
- wpsc-includes/wpsc-meta-visitor.php +1 -1
- wpsc-includes/wpsc-tracking.php +10 -8
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wpecommerce.org
|
|
4 |
Tags: e-commerce, digital downloads, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 4.7.2
|
7 |
-
Stable tag: 3.
|
8 |
|
9 |
WP eCommerce is a free, powerful plugin that empowers you to sell anything online, quickly and easily.
|
10 |
|
@@ -36,6 +36,16 @@ After upgrading from earlier versions look for link "Update Store". This will up
|
|
36 |
|
37 |
== Changelog ==
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
= 3.11.7 [2017-2-05] =
|
40 |
|
41 |
* Fix: In PHP versions prior to 5.5, we caused a fatal error. Our apologies are sincere, but update your PHP! Literally the same problem resolved in 3.11.6, just in a different context. We'll get better at supporting EOL PHP, the WordPress way.
|
@@ -53,7 +63,7 @@ After upgrading from earlier versions look for link "Update Store". This will up
|
|
53 |
* Enhancement: Addition of Refund API (including partial refunds)
|
54 |
* Enhancement: Addition of ability to edit pending orders.
|
55 |
|
56 |
-
3.11.4 [2016-11-11]
|
57 |
|
58 |
* Security Fix: Under specific conditions (Gold Cart enabled, using eWay as a payment processor, and using the yet-to-be-released 2.0 Theme Engine) - a SQL vulnerability has been patched.
|
59 |
|
4 |
Tags: e-commerce, digital downloads, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 4.7.2
|
7 |
+
Stable tag: 3.12.0
|
8 |
|
9 |
WP eCommerce is a free, powerful plugin that empowers you to sell anything online, quickly and easily.
|
10 |
|
36 |
|
37 |
== Changelog ==
|
38 |
|
39 |
+
= 3.12.0 [2017-2-17] =
|
40 |
+
|
41 |
+
* Fix: When updating a pending order, ensure that the order object's total price is updated as well.
|
42 |
+
* Fix: Update admin.js to not use deprecated size() method.
|
43 |
+
* Fix: Currency code was incorrectly cached.
|
44 |
+
* Fix: Express Checkout 3.0 JavaScript now properly enqueued.
|
45 |
+
* Enhancement: 2.0 Theme Engine now supports floating labels.
|
46 |
+
* Enhancement: Payment Gateway API now fully supports Auth/Capture workflows, in addition to refunds and partial refunds introduced in 3.11.5
|
47 |
+
* New: Addition of ProPay (TSYS) Gateway.
|
48 |
+
|
49 |
= 3.11.7 [2017-2-05] =
|
50 |
|
51 |
* Fix: In PHP versions prior to 5.5, we caused a fatal error. Our apologies are sincere, but update your PHP! Literally the same problem resolved in 3.11.6, just in a different context. We'll get better at supporting EOL PHP, the WordPress way.
|
63 |
* Enhancement: Addition of Refund API (including partial refunds)
|
64 |
* Enhancement: Addition of ability to edit pending orders.
|
65 |
|
66 |
+
= 3.11.4 [2016-11-11] =
|
67 |
|
68 |
* Security Fix: Under specific conditions (Gold Cart enabled, using eWay as a payment processor, and using the yet-to-be-released 2.0 Theme Engine) - a SQL vulnerability has been patched.
|
69 |
|
wp-shopping-cart.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WP eCommerce
|
4 |
* Plugin URI: http://wpecommerce.org/
|
5 |
* Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://wpecommerce.org" target="_blank">WPeCommerce.org</a> | <a href="https://wordpress.org/support/plugin/wp-e-commerce/" target="_blank">Support Forum</a> | <a href="http://docs.wpecommerce.org/" target="_blank">Documentation</a>
|
6 |
-
* Version: 3.
|
7 |
* Author: WP eCommerce
|
8 |
* Author URI: http://wpecommerce.org/
|
9 |
* Text Domain: wp-e-commerce
|
@@ -47,6 +47,7 @@ class WP_eCommerce {
|
|
47 |
public function init() {
|
48 |
// Previous to initializing
|
49 |
do_action( 'wpsc_pre_init' );
|
|
|
50 |
// Initialize
|
51 |
$this->start();
|
52 |
$this->constants();
|
@@ -143,7 +144,7 @@ class WP_eCommerce {
|
|
143 |
/**
|
144 |
* Sets table names as WPDB properties.
|
145 |
*
|
146 |
-
* @since
|
147 |
* @return array Array of custom tables
|
148 |
*/
|
149 |
public function setup_table_names() {
|
3 |
* Plugin Name: WP eCommerce
|
4 |
* Plugin URI: http://wpecommerce.org/
|
5 |
* Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://wpecommerce.org" target="_blank">WPeCommerce.org</a> | <a href="https://wordpress.org/support/plugin/wp-e-commerce/" target="_blank">Support Forum</a> | <a href="http://docs.wpecommerce.org/" target="_blank">Documentation</a>
|
6 |
+
* Version: 3.12.0
|
7 |
* Author: WP eCommerce
|
8 |
* Author URI: http://wpecommerce.org/
|
9 |
* Text Domain: wp-e-commerce
|
47 |
public function init() {
|
48 |
// Previous to initializing
|
49 |
do_action( 'wpsc_pre_init' );
|
50 |
+
|
51 |
// Initialize
|
52 |
$this->start();
|
53 |
$this->constants();
|
144 |
/**
|
145 |
* Sets table names as WPDB properties.
|
146 |
*
|
147 |
+
* @since 3.11.5
|
148 |
* @return array Array of custom tables
|
149 |
*/
|
150 |
public function setup_table_names() {
|
wpsc-admin/admin.php
CHANGED
@@ -118,7 +118,7 @@ add_filter('set-screen-option', 'wpsc_set_screen_option', 99, 3);
|
|
118 |
* @param string $taxonomy Taxonomy.
|
119 |
* @param string $context Context.
|
120 |
*
|
121 |
-
* @since
|
122 |
*
|
123 |
* @return array Filtered dropdown args.
|
124 |
*/
|
@@ -432,6 +432,7 @@ function wpsc_admin_include_purchase_logs_css_and_js() {
|
|
432 |
'purchase_log_save_tracking_id_nonce' => _wpsc_create_ajax_nonce( 'purchase_log_save_tracking_id' ),
|
433 |
'purchase_log_send_tracking_email_nonce' => _wpsc_create_ajax_nonce( 'purchase_log_send_tracking_email' ),
|
434 |
'purchase_log_refund_items_nonce' => _wpsc_create_ajax_nonce( 'purchase_log_refund_items' ),
|
|
|
435 |
'remove_log_item_nonce' => _wpsc_create_ajax_nonce( 'remove_log_item' ),
|
436 |
'update_log_item_qty_nonce' => _wpsc_create_ajax_nonce( 'update_log_item_qty' ),
|
437 |
'add_log_item_nonce' => _wpsc_create_ajax_nonce( 'add_log_item' ),
|
@@ -1521,7 +1522,7 @@ add_filter( 'plugin_action_links_' . WPSC_PLUGIN_BASENAME, 'wpsc_support_links'
|
|
1521 |
*
|
1522 |
* @param array $args Array of removable query args.
|
1523 |
*
|
1524 |
-
* @since
|
1525 |
*
|
1526 |
* @return array $args Array of removable query args.
|
1527 |
*/
|
@@ -1538,7 +1539,7 @@ add_filter( 'removable_query_args', 'wpsc_removable_query_args' );
|
|
1538 |
* @param array $bulk_messages Array of bulk messages.
|
1539 |
* @param int $bulk_counts The amount of messages affected.
|
1540 |
*
|
1541 |
-
* @since
|
1542 |
*
|
1543 |
* @return array Array of bulk messages.
|
1544 |
*/
|
@@ -1567,7 +1568,7 @@ add_filter( 'bulk_post_updated_messages', 'wpsc_bulk_updated_messages', 10, 2 );
|
|
1567 |
*/
|
1568 |
function wpsc_admin_rate_us( $footer_text ) {
|
1569 |
global $typenow;
|
1570 |
-
|
1571 |
if ( $typenow == 'wpsc-product' ) {
|
1572 |
$rate_text = sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">WP eCommerce</a>! Please <a href="%2$s" target="_blank">rate us</a> on <a href="%2$s" target="_blank">WordPress.org</a>', 'wp-e-commerce' ),
|
1573 |
'https://wpecommerce.org',
|
@@ -1579,3 +1580,9 @@ function wpsc_admin_rate_us( $footer_text ) {
|
|
1579 |
}
|
1580 |
}
|
1581 |
add_filter( 'admin_footer_text', 'wpsc_admin_rate_us' );
|
|
|
|
|
|
|
|
|
|
|
|
118 |
* @param string $taxonomy Taxonomy.
|
119 |
* @param string $context Context.
|
120 |
*
|
121 |
+
* @since 3.11.5
|
122 |
*
|
123 |
* @return array Filtered dropdown args.
|
124 |
*/
|
432 |
'purchase_log_save_tracking_id_nonce' => _wpsc_create_ajax_nonce( 'purchase_log_save_tracking_id' ),
|
433 |
'purchase_log_send_tracking_email_nonce' => _wpsc_create_ajax_nonce( 'purchase_log_send_tracking_email' ),
|
434 |
'purchase_log_refund_items_nonce' => _wpsc_create_ajax_nonce( 'purchase_log_refund_items' ),
|
435 |
+
'purchase_log_capture_payment_nonce' => _wpsc_create_ajax_nonce( 'purchase_log_capture_payment' ),
|
436 |
'remove_log_item_nonce' => _wpsc_create_ajax_nonce( 'remove_log_item' ),
|
437 |
'update_log_item_qty_nonce' => _wpsc_create_ajax_nonce( 'update_log_item_qty' ),
|
438 |
'add_log_item_nonce' => _wpsc_create_ajax_nonce( 'add_log_item' ),
|
1522 |
*
|
1523 |
* @param array $args Array of removable query args.
|
1524 |
*
|
1525 |
+
* @since 3.11.5
|
1526 |
*
|
1527 |
* @return array $args Array of removable query args.
|
1528 |
*/
|
1539 |
* @param array $bulk_messages Array of bulk messages.
|
1540 |
* @param int $bulk_counts The amount of messages affected.
|
1541 |
*
|
1542 |
+
* @since 3.11.5
|
1543 |
*
|
1544 |
* @return array Array of bulk messages.
|
1545 |
*/
|
1568 |
*/
|
1569 |
function wpsc_admin_rate_us( $footer_text ) {
|
1570 |
global $typenow;
|
1571 |
+
|
1572 |
if ( $typenow == 'wpsc-product' ) {
|
1573 |
$rate_text = sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">WP eCommerce</a>! Please <a href="%2$s" target="_blank">rate us</a> on <a href="%2$s" target="_blank">WordPress.org</a>', 'wp-e-commerce' ),
|
1574 |
'https://wpecommerce.org',
|
1580 |
}
|
1581 |
}
|
1582 |
add_filter( 'admin_footer_text', 'wpsc_admin_rate_us' );
|
1583 |
+
|
1584 |
+
function wpsc_product_category_edit_form_tag() {
|
1585 |
+
echo 'enctype="multipart/form-data" ';
|
1586 |
+
}
|
1587 |
+
add_action( 'wpsc_product_category_term_new_form_tag', 'wpsc_product_category_edit_form_tag' );
|
1588 |
+
add_action( 'wpsc_product_category_term_edit_form_tag', 'wpsc_product_category_edit_form_tag' );
|
wpsc-admin/ajax.php
CHANGED
@@ -1,66 +1,118 @@
|
|
1 |
<?php
|
2 |
function _wpsc_ajax_purchase_log_refund_items() {
|
3 |
-
if ( isset( $_POST['order_id'] ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
-
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
|
22 |
-
// Validate that the refund can occur
|
23 |
-
$refund_amount = $refund_amount ? $refund_amount : $log->get( 'totalprice' );
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
28 |
|
29 |
-
|
|
|
|
|
|
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
* @since 4.0.0
|
43 |
-
*/
|
44 |
-
do_action( 'wpsc_order_partially_refunded', $log );
|
45 |
-
$response_data['status'] = 'partially_refunded';
|
46 |
-
|
47 |
-
} else {
|
48 |
-
/**
|
49 |
-
* wpsc_order_fully_refunded.
|
50 |
-
*
|
51 |
-
* @since 4.0.0
|
52 |
-
*/
|
53 |
-
do_action( 'wpsc_order_fully_refunded', $log );
|
54 |
-
$response_data['status'] = 'fully_refunded';
|
55 |
}
|
56 |
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
-
|
60 |
-
|
|
|
61 |
}
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
-
return new WP_Error( 'wpsc_ajax_invalid_purchase_log_refund_items', __( 'Refund failed.', 'wp-e-commerce' ) );
|
64 |
}
|
65 |
|
66 |
/**
|
@@ -521,7 +573,7 @@ function _wpsc_ajax_purchase_log_action_link() {
|
|
521 |
/**
|
522 |
* Remove purchase log item.
|
523 |
*
|
524 |
-
* @since
|
525 |
* @access private
|
526 |
*
|
527 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
@@ -532,7 +584,7 @@ function _wpsc_ajax_remove_log_item() {
|
|
532 |
|
533 |
$item_id = absint( $_POST['item_id'] );
|
534 |
$log_id = absint( $_POST['log_id'] );
|
535 |
-
$log =
|
536 |
|
537 |
if ( $log->remove_item( $item_id ) ) {
|
538 |
return _wpsc_init_log_items( $log );
|
@@ -545,7 +597,7 @@ function _wpsc_ajax_remove_log_item() {
|
|
545 |
/**
|
546 |
* Update purchase log item quantity.
|
547 |
*
|
548 |
-
* @since
|
549 |
* @access private
|
550 |
*
|
551 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
@@ -560,7 +612,7 @@ function _wpsc_ajax_update_log_item_qty() {
|
|
560 |
|
561 |
$item_id = absint( $_POST['item_id'] );
|
562 |
$log_id = absint( $_POST['log_id'] );
|
563 |
-
$log =
|
564 |
$result = $log->update_item( $item_id, array( 'quantity' => absint( $_POST['qty'] ) ) );
|
565 |
|
566 |
if ( 0 === $result ) {
|
@@ -576,7 +628,7 @@ function _wpsc_ajax_update_log_item_qty() {
|
|
576 |
/**
|
577 |
* Add purchase log item.
|
578 |
*
|
579 |
-
* @since
|
580 |
* @access private
|
581 |
*
|
582 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
@@ -600,7 +652,7 @@ function _wpsc_ajax_add_log_item() {
|
|
600 |
foreach ( $_POST['product_ids'] as $product_id ) {
|
601 |
$product_id = absint( $product_id );
|
602 |
$log_id = absint( $_POST['log_id'] );
|
603 |
-
$log =
|
604 |
|
605 |
// Is product is already in item list?
|
606 |
if ( $existing && in_array( $product_id, $existing, true ) ) {
|
@@ -661,7 +713,7 @@ function _wpsc_init_log_items( WPSC_Purchase_Log $log, $item_ids = array() ) {
|
|
661 |
/**
|
662 |
* Edit log contact details.
|
663 |
*
|
664 |
-
* @since
|
665 |
* @access private
|
666 |
*
|
667 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
@@ -674,7 +726,7 @@ function _wpsc_ajax_edit_contact_details() {
|
|
674 |
parse_str( $_POST['fields'], $fields );
|
675 |
|
676 |
$log_id = absint( $_POST['log_id'] );
|
677 |
-
$log =
|
678 |
|
679 |
if ( isset( $fields['wpsc_checkout_details'] ) && is_array( $fields['wpsc_checkout_details'] ) ) {
|
680 |
$details = wp_unslash( $fields['wpsc_checkout_details'] );
|
@@ -717,7 +769,7 @@ function _wpsc_ajax_edit_contact_details() {
|
|
717 |
/**
|
718 |
* Add a note to a log.
|
719 |
*
|
720 |
-
* @since
|
721 |
* @access private
|
722 |
*
|
723 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
@@ -753,7 +805,7 @@ function _wpsc_ajax_add_note() {
|
|
753 |
/**
|
754 |
* Delete a note from a log.
|
755 |
*
|
756 |
-
* @since
|
757 |
* @access private
|
758 |
*
|
759 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
@@ -774,7 +826,7 @@ function _wpsc_ajax_delete_note() {
|
|
774 |
/**
|
775 |
* Search for products.
|
776 |
*
|
777 |
-
* @since
|
778 |
* @access private
|
779 |
*
|
780 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
1 |
<?php
|
2 |
function _wpsc_ajax_purchase_log_refund_items() {
|
3 |
+
if ( ! isset( $_POST['order_id'] ) ) {
|
4 |
+
return new WP_Error( 'wpsc_ajax_invalid_purchase_log_refund_items', __( 'Refund failed.', 'wp-e-commerce' ) );
|
5 |
+
}
|
6 |
+
|
7 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
8 |
+
return new WP_Error( 'wpsc_ajax_not_allowed_purchase_log_refund', __( 'Refund failed. (Incorrect Permissions)', 'wp-e-commerce' ) );
|
9 |
+
}
|
10 |
+
|
11 |
+
$order_id = absint( $_POST['order_id'] );
|
12 |
+
$refund_reason = isset( $_POST['refund_reason'] ) ? sanitize_text_field( $_POST['refund_reason'] ) : '';
|
13 |
+
$refund_amount = isset( $_POST['refund_amount'] ) ? sanitize_text_field( $_POST['refund_amount'] ) : false;
|
14 |
+
$manual = $_POST['api_refund'] === 'true' ? false : true;
|
15 |
+
$response_data = array();
|
16 |
|
17 |
+
$log = wpsc_get_order( $order_id );
|
18 |
+
$gateway_id = $log->get( 'gateway' );
|
19 |
+
$gateway = wpsc_get_payment_gateway( $gateway_id );
|
20 |
|
21 |
+
try {
|
22 |
+
// Validate that the refund can occur
|
23 |
+
$refund_amount = $refund_amount ? $refund_amount : $log->get( 'totalprice' );
|
24 |
+
|
25 |
+
if ( wpsc_payment_gateway_supports( $gateway_id, 'refunds' ) ) {
|
26 |
+
// Send api request to process refund. Returns Refund transaction ID
|
27 |
+
$result = $gateway->process_refund( $log, $refund_amount, $refund_reason, $manual );
|
28 |
+
|
29 |
+
do_action( 'wpsc_refund_processed', $log, $result, $refund_amount, $refund_reason );
|
30 |
+
|
31 |
+
if ( is_wp_error( $result ) ) {
|
32 |
+
return $result;
|
33 |
+
}
|
34 |
+
|
35 |
+
if ( ! $result ) {
|
36 |
+
throw new Exception( __( 'Refund failed', 'wp-e-commerce' ) );
|
37 |
+
}
|
38 |
}
|
39 |
|
40 |
+
if ( $log->get_remaining_refund() > 0 ) {
|
41 |
+
/**
|
42 |
+
* wpsc_order_partially_refunded.
|
43 |
+
*
|
44 |
+
* @since 3.11.5
|
45 |
+
*/
|
46 |
+
do_action( 'wpsc_order_partially_refunded', $log );
|
47 |
+
$response_data['status'] = 'partially_refunded';
|
48 |
|
49 |
+
} else {
|
50 |
+
/**
|
51 |
+
* wpsc_order_fully_refunded.
|
52 |
+
*
|
53 |
+
* @since 3.11.5
|
54 |
+
*/
|
55 |
+
do_action( 'wpsc_order_fully_refunded', $log );
|
56 |
+
$response_data['status'] = 'fully_refunded';
|
57 |
+
}
|
58 |
|
59 |
+
return $response_data;
|
|
|
|
|
60 |
|
61 |
+
} catch ( Exception $e ) {
|
62 |
+
return new WP_Error( 'wpsc_ajax_purchase_log_refund_failed', $e->getMessage() );
|
63 |
+
}
|
64 |
+
}
|
65 |
|
66 |
+
function _wpsc_ajax_purchase_log_capture_payment() {
|
67 |
+
if ( ! isset( $_POST['order_id'] ) ) {
|
68 |
+
return new WP_Error( 'wpsc_ajax_invalid_purchase_log_capture_payment', __( 'Capture failed.', 'wp-e-commerce' ) );
|
69 |
+
}
|
70 |
|
71 |
+
if ( ! wpsc_is_store_admin() ) {
|
72 |
+
return new WP_Error( 'wpsc_ajax_not_allowed_purchase_log_capture_payment', __( 'Capture failed. (Incorrect Permissions)', 'wp-e-commerce' ) );
|
73 |
+
}
|
74 |
+
|
75 |
+
$order_id = absint( $_POST['order_id'] );
|
76 |
+
$response_data = array();
|
77 |
+
|
78 |
+
$log = wpsc_get_order( $order_id );
|
79 |
+
$gateway_id = $log->get( 'gateway' );
|
80 |
+
$gateway = wpsc_get_payment_gateway( $gateway_id );
|
81 |
+
|
82 |
+
try {
|
83 |
+
|
84 |
+
// Validate that the capture can occur
|
85 |
+
if ( wpsc_payment_gateway_supports( $gateway_id, 'auth-capture' ) ) {
|
86 |
+
|
87 |
+
if ( ! $log->is_order_received() ) {
|
88 |
+
throw new Exception( __( 'Order must be in "Order Received" status to be captured.', 'wp-e-commerce' ) );
|
89 |
}
|
90 |
|
91 |
+
$transaction_id = $log->get( 'transactid' );
|
92 |
+
|
93 |
+
if ( empty( $transaction_id ) ) {
|
94 |
+
throw new Exception( __( 'Order must have a transaction ID to be captured.', 'wp-e-commerce' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
|
97 |
+
// Send api request to process capture. Returns capture transaction ID
|
98 |
+
$result = $gateway->capture_payment( $log, $transaction_id );
|
99 |
+
|
100 |
+
do_action( 'wpsc_payment_captured', $log, $result );
|
101 |
+
|
102 |
+
if ( is_wp_error( $result ) ) {
|
103 |
+
return $result;
|
104 |
+
}
|
105 |
|
106 |
+
if ( ! $result ) {
|
107 |
+
throw new Exception( __( 'Refund failed', 'wp-e-commerce' ) );
|
108 |
+
}
|
109 |
}
|
110 |
+
|
111 |
+
return $response_data;
|
112 |
+
|
113 |
+
} catch ( Exception $e ) {
|
114 |
+
return new WP_Error( 'wpsc_ajax_purchase_log_payment_capture_failed', $e->getMessage() );
|
115 |
}
|
|
|
116 |
}
|
117 |
|
118 |
/**
|
573 |
/**
|
574 |
* Remove purchase log item.
|
575 |
*
|
576 |
+
* @since 3.11.5
|
577 |
* @access private
|
578 |
*
|
579 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
584 |
|
585 |
$item_id = absint( $_POST['item_id'] );
|
586 |
$log_id = absint( $_POST['log_id'] );
|
587 |
+
$log = wpsc_get_order( $log_id );
|
588 |
|
589 |
if ( $log->remove_item( $item_id ) ) {
|
590 |
return _wpsc_init_log_items( $log );
|
597 |
/**
|
598 |
* Update purchase log item quantity.
|
599 |
*
|
600 |
+
* @since 3.11.5
|
601 |
* @access private
|
602 |
*
|
603 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
612 |
|
613 |
$item_id = absint( $_POST['item_id'] );
|
614 |
$log_id = absint( $_POST['log_id'] );
|
615 |
+
$log = wpsc_get_order( $log_id );
|
616 |
$result = $log->update_item( $item_id, array( 'quantity' => absint( $_POST['qty'] ) ) );
|
617 |
|
618 |
if ( 0 === $result ) {
|
628 |
/**
|
629 |
* Add purchase log item.
|
630 |
*
|
631 |
+
* @since 3.11.5
|
632 |
* @access private
|
633 |
*
|
634 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
652 |
foreach ( $_POST['product_ids'] as $product_id ) {
|
653 |
$product_id = absint( $product_id );
|
654 |
$log_id = absint( $_POST['log_id'] );
|
655 |
+
$log = wpsc_get_order( $log_id );
|
656 |
|
657 |
// Is product is already in item list?
|
658 |
if ( $existing && in_array( $product_id, $existing, true ) ) {
|
713 |
/**
|
714 |
* Edit log contact details.
|
715 |
*
|
716 |
+
* @since 3.11.5
|
717 |
* @access private
|
718 |
*
|
719 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
726 |
parse_str( $_POST['fields'], $fields );
|
727 |
|
728 |
$log_id = absint( $_POST['log_id'] );
|
729 |
+
$log = wpsc_get_order( $log_id );
|
730 |
|
731 |
if ( isset( $fields['wpsc_checkout_details'] ) && is_array( $fields['wpsc_checkout_details'] ) ) {
|
732 |
$details = wp_unslash( $fields['wpsc_checkout_details'] );
|
769 |
/**
|
770 |
* Add a note to a log.
|
771 |
*
|
772 |
+
* @since 3.11.5
|
773 |
* @access private
|
774 |
*
|
775 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
805 |
/**
|
806 |
* Delete a note from a log.
|
807 |
*
|
808 |
+
* @since 3.11.5
|
809 |
* @access private
|
810 |
*
|
811 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
826 |
/**
|
827 |
* Search for products.
|
828 |
*
|
829 |
+
* @since 3.11.5
|
830 |
* @access private
|
831 |
*
|
832 |
* @return array|WP_Error $return Response args if successful, WP_Error if otherwise
|
wpsc-admin/css/admin.css
CHANGED
@@ -266,6 +266,14 @@ th#status {
|
|
266 |
border-right: 0;
|
267 |
}
|
268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
.wpsc_item_qty {
|
270 |
width: 4em;
|
271 |
}
|
@@ -2675,3 +2683,7 @@ a.wpsc_remove_meta {
|
|
2675 |
.wpsc-refund-ui {
|
2676 |
display: none;
|
2677 |
}
|
|
|
|
|
|
|
|
266 |
border-right: 0;
|
267 |
}
|
268 |
|
269 |
+
.wpsc-add-row button.button {
|
270 |
+
margin-right: 6px;
|
271 |
+
}
|
272 |
+
|
273 |
+
.wpsc-add-row .spinner.is-active {
|
274 |
+
float: none;
|
275 |
+
}
|
276 |
+
|
277 |
.wpsc_item_qty {
|
278 |
width: 4em;
|
279 |
}
|
2683 |
.wpsc-refund-ui {
|
2684 |
display: none;
|
2685 |
}
|
2686 |
+
|
2687 |
+
.wp-core-ui .wpsc-refund-ui .button {
|
2688 |
+
margin-right: 5px;
|
2689 |
+
}
|
wpsc-admin/css/settingspage.css
CHANGED
@@ -151,6 +151,19 @@ table.wpsc-edit-module-options tr td {
|
|
151 |
margin-top: 2em;
|
152 |
}
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
.gateway_settings input[type=text]{
|
155 |
width: 200px;
|
156 |
}
|
@@ -469,4 +482,4 @@ table.form-table td .updated.shipwire-update {
|
|
469 |
#wpsc-amazon-payments-client_id,
|
470 |
#wpsc-amazon-payments-ipn {
|
471 |
width: 500px;
|
472 |
-
}
|
151 |
margin-top: 2em;
|
152 |
}
|
153 |
|
154 |
+
.gateway_settings .gateway_settings_form,
|
155 |
+
.gateway_settings .gateway_settings_form tr {
|
156 |
+
background: #f8f8f8;
|
157 |
+
}
|
158 |
+
|
159 |
+
.gateway_settings.active .gateway_settings_form,
|
160 |
+
.gateway_settings.active .gateway_settings_form tr td {
|
161 |
+
background: #ecf5f9;
|
162 |
+
}
|
163 |
+
|
164 |
+
.gateway_settings .gateway_settings_form tr:last-child td {
|
165 |
+
box-shadow: none;
|
166 |
+
}
|
167 |
.gateway_settings input[type=text]{
|
168 |
width: 200px;
|
169 |
}
|
482 |
#wpsc-amazon-payments-client_id,
|
483 |
#wpsc-amazon-payments-ipn {
|
484 |
width: 500px;
|
485 |
+
}
|
wpsc-admin/display-sales-logs.php
CHANGED
@@ -36,8 +36,8 @@ class WPSC_Purchase_Log_Page {
|
|
36 |
// If individual purchase log, setup ID and action links.
|
37 |
if ( isset( $_REQUEST['id'] ) && is_numeric( $_REQUEST['id'] ) ) {
|
38 |
$this->log_id = (int) $_REQUEST['id'];
|
39 |
-
$this->log =
|
40 |
-
$this->notes =
|
41 |
$this->can_edit = $this->log->can_edit();
|
42 |
}
|
43 |
|
@@ -228,11 +228,9 @@ class WPSC_Purchase_Log_Page {
|
|
228 |
<form name="wpsc_items_ordered_form" method="post">
|
229 |
<table class="widefat" cellspacing="0">
|
230 |
<thead>
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
?>
|
235 |
-
</tr>
|
236 |
</thead>
|
237 |
|
238 |
<tbody>
|
@@ -276,56 +274,18 @@ class WPSC_Purchase_Log_Page {
|
|
276 |
<th class='right-col'><?php esc_html_e( 'Total', 'wp-e-commerce' ); ?> </th>
|
277 |
<td><span><?php echo wpsc_display_purchlog_totalprice(); ?></span> <div class="spinner"></div></td>
|
278 |
</tr>
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
<td colspan="<?php echo $this->cols + 2; ?>">
|
283 |
-
<p class="wpsc-add-row">
|
284 |
-
<button type="button" class="button refund-items"><?php _e( 'Refund', 'wp-e-commerce' ); ?></button>
|
285 |
-
</p>
|
286 |
</td>
|
287 |
</tr>
|
288 |
-
<tr class="wpsc-
|
289 |
<td colspan="<?php echo $this->cols + 2; ?>">
|
290 |
-
|
291 |
-
|
292 |
-
<tr>
|
293 |
-
<td class="label"><?php _e( 'Amount already refunded', 'wp-e-commerce' ); ?>:</td>
|
294 |
-
<td class="total"><?php echo wpsc_currency_display( $this->log->get_total_refunded() );?></td>
|
295 |
-
</tr>
|
296 |
-
<?php if ( wpsc_payment_gateway_supports( $this->log->get( 'gateway' ), 'partial-refunds' ) ) : ?>
|
297 |
-
<tr>
|
298 |
-
<td class="label"><label for="refund_amount"><?php _e( 'Refund amount', 'wp-e-commerce' ); ?>:</label></td>
|
299 |
-
<td class="total">
|
300 |
-
<input type="text" class="text" id="refund_amount" name="refund_amount" class="wpec_input_price" />
|
301 |
-
<div class="clear"></div>
|
302 |
-
</td>
|
303 |
-
</tr>
|
304 |
-
<?php endif; ?>
|
305 |
-
<tr>
|
306 |
-
<td class="label"><label for="refund_reason"><?php _e( 'Reason for refund (optional)', 'wp-e-commerce' ); ?>:</label></td>
|
307 |
-
<td class="total">
|
308 |
-
<input type="text" class="text" id="refund_reason" name="refund_reason" />
|
309 |
-
<div class="clear"></div>
|
310 |
-
</td>
|
311 |
-
</tr>
|
312 |
-
<tr>
|
313 |
-
<td>
|
314 |
-
<p>
|
315 |
-
<button type="button" class="button tips button-primary do-api-refund"><?php printf( __( 'Refund via %s', 'wp-e-commerce' ), wpsc_get_payment_gateway( $this->log->get( 'gateway' ) )->get_title() ); ?></button>
|
316 |
-
<img src="<?php echo esc_url( wpsc_get_ajax_spinner() ); ?>" class="ajax-feedback" title="" alt="" />
|
317 |
-
<button type="button" class="button button-secondary do-manual-refund tips"><?php _e( 'Manual Refund', 'wp-e-commerce' ); ?></button>
|
318 |
-
<img src="<?php echo esc_url( wpsc_get_ajax_spinner() ); ?>" class="ajax-feedback" title="" alt="" /><br class="clear" />
|
319 |
-
</p>
|
320 |
-
</td>
|
321 |
-
</tbody>
|
322 |
-
</table>
|
323 |
-
</td>
|
324 |
</tr>
|
325 |
-
<?php endif; ?>
|
326 |
</tbody>
|
327 |
</table>
|
328 |
-
|
329 |
</form>
|
330 |
|
331 |
<?php do_action( 'wpsc_purchlogitem_metabox_end', $this->log_id ); ?>
|
@@ -333,6 +293,65 @@ class WPSC_Purchase_Log_Page {
|
|
333 |
<?php
|
334 |
}
|
335 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
public function purch_notes_box() {
|
337 |
?>
|
338 |
<div class="wpsc-notes">
|
@@ -518,6 +537,11 @@ class WPSC_Purchase_Log_Page {
|
|
518 |
|
519 |
add_action( 'wpsc_display_purchase_logs_page', array( $this, 'display_purchase_log' ) );
|
520 |
add_action( 'wpsc_purchlog_before_metaboxes' , array( $this, 'register_metaboxes' ) );
|
|
|
|
|
|
|
|
|
|
|
521 |
}
|
522 |
|
523 |
public function register_metaboxes() {
|
@@ -561,7 +585,7 @@ class WPSC_Purchase_Log_Page {
|
|
561 |
if ( $note ) {
|
562 |
check_admin_referer( 'wpsc_log_add_notes_nonce', 'wpsc_log_add_notes_nonce' );
|
563 |
|
564 |
-
|
565 |
|
566 |
wp_safe_redirect( esc_url_raw( remove_query_arg( 'wpsc_log_add_notes_nonce' ) ) );
|
567 |
exit;
|
@@ -572,7 +596,7 @@ class WPSC_Purchase_Log_Page {
|
|
572 |
if ( is_numeric( $note_id ) ) {
|
573 |
check_admin_referer( 'delete-note', 'delete-note' );
|
574 |
|
575 |
-
$notes =
|
576 |
|
577 |
$notes->remove( $note_id )->save();
|
578 |
|
@@ -759,7 +783,7 @@ class WPSC_Purchase_Log_Page {
|
|
759 |
$ids = array_map( 'intval', $_REQUEST['post'] );
|
760 |
|
761 |
foreach ( $ids as $id ) {
|
762 |
-
$log =
|
763 |
$log->delete();
|
764 |
}
|
765 |
|
36 |
// If individual purchase log, setup ID and action links.
|
37 |
if ( isset( $_REQUEST['id'] ) && is_numeric( $_REQUEST['id'] ) ) {
|
38 |
$this->log_id = (int) $_REQUEST['id'];
|
39 |
+
$this->log = wpsc_get_order( $this->log_id );
|
40 |
+
$this->notes = wpsc_get_order_notes( $this->log );
|
41 |
$this->can_edit = $this->log->can_edit();
|
42 |
}
|
43 |
|
228 |
<form name="wpsc_items_ordered_form" method="post">
|
229 |
<table class="widefat" cellspacing="0">
|
230 |
<thead>
|
231 |
+
<tr>
|
232 |
+
<?php print_column_headers( 'wpsc_purchase_log_item_details' ); ?>
|
233 |
+
</tr>
|
|
|
|
|
234 |
</thead>
|
235 |
|
236 |
<tbody>
|
274 |
<th class='right-col'><?php esc_html_e( 'Total', 'wp-e-commerce' ); ?> </th>
|
275 |
<td><span><?php echo wpsc_display_purchlog_totalprice(); ?></span> <div class="spinner"></div></td>
|
276 |
</tr>
|
277 |
+
<tr class="wpsc-row-actions">
|
278 |
+
<td class="wpsc-add-row" colspan="<?php echo $this->cols + 2; ?>">
|
279 |
+
<?php do_action( 'wpsc_order_row_actions', $this->log ); ?>
|
|
|
|
|
|
|
|
|
280 |
</td>
|
281 |
</tr>
|
282 |
+
<tr class="wpsc-row-action-views">
|
283 |
<td colspan="<?php echo $this->cols + 2; ?>">
|
284 |
+
<?php do_action( 'wpsc_order_row_actions_views', $this->log ); ?>
|
285 |
+
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
</tr>
|
|
|
287 |
</tbody>
|
288 |
</table>
|
|
|
289 |
</form>
|
290 |
|
291 |
<?php do_action( 'wpsc_purchlogitem_metabox_end', $this->log_id ); ?>
|
293 |
<?php
|
294 |
}
|
295 |
|
296 |
+
public function add_refund_button( $log ) {
|
297 |
+
if ( wpsc_payment_gateway_supports( $log->get( 'gateway' ), 'refunds' ) ) :
|
298 |
+
?>
|
299 |
+
<button type="button" class="button refund-items"><?php _e( 'Refund', 'wp-e-commerce' ); ?></button>
|
300 |
+
<?php
|
301 |
+
endif;
|
302 |
+
}
|
303 |
+
|
304 |
+
public function add_refund_button_ui( $log ) {
|
305 |
+
if ( wpsc_payment_gateway_supports( $log->get( 'gateway' ), 'refunds' ) ) :
|
306 |
+
?>
|
307 |
+
<table class='wpsc-refund-ui'>
|
308 |
+
<tbody>
|
309 |
+
<tr>
|
310 |
+
<td class="label"><?php _e( 'Amount already refunded', 'wp-e-commerce' ); ?>:</td>
|
311 |
+
<td class="total"><?php echo wpsc_currency_display( $log->get_total_refunded() );?></td>
|
312 |
+
</tr>
|
313 |
+
<?php if ( wpsc_payment_gateway_supports( $log->get( 'gateway' ), 'partial-refunds' ) ) : ?>
|
314 |
+
<tr>
|
315 |
+
<td class="label"><label for="refund_amount"><?php _e( 'Refund amount', 'wp-e-commerce' ); ?>:</label></td>
|
316 |
+
<td class="total">
|
317 |
+
<input type="number" max="<?php echo floatval( $log->get_remaining_refund() ); ?>" class="text" id="refund_amount" name="refund_amount" class="wpec_input_price" />
|
318 |
+
<div class="clear"></div>
|
319 |
+
</td>
|
320 |
+
</tr>
|
321 |
+
<?php endif; // gateway supports PARTIAL refunds ?>
|
322 |
+
<tr>
|
323 |
+
<td class="label"><label for="refund_reason"><?php _e( 'Reason for refund (optional)', 'wp-e-commerce' ); ?>:</label></td>
|
324 |
+
<td class="total">
|
325 |
+
<input type="text" class="text" id="refund_reason" name="refund_reason" />
|
326 |
+
<div class="clear"></div>
|
327 |
+
</td>
|
328 |
+
</tr>
|
329 |
+
<tr>
|
330 |
+
<td>
|
331 |
+
<p>
|
332 |
+
<button type="button" class="button tips button-primary do-api-refund"><?php printf( __( 'Refund via %s', 'wp-e-commerce' ), wpsc_get_payment_gateway( $log->get( 'gateway' ) )->get_title() ); ?></button>
|
333 |
+
<button type="button" class="button button-secondary do-manual-refund tips"><?php _e( 'Manual Refund', 'wp-e-commerce' ); ?></button>
|
334 |
+
</p>
|
335 |
+
</td>
|
336 |
+
<td>
|
337 |
+
<span class="spinner"></span>
|
338 |
+
</td>
|
339 |
+
</tr>
|
340 |
+
</tbody>
|
341 |
+
</table>
|
342 |
+
<?php
|
343 |
+
endif;
|
344 |
+
}
|
345 |
+
|
346 |
+
public function add_capture_button( $log ) {
|
347 |
+
if ( wpsc_payment_gateway_supports( $log->get( 'gateway' ), 'auth-capture' ) && $log->is_order_received() ) :
|
348 |
+
?>
|
349 |
+
<button type="button" class="button-primary button capture-payment"><?php _e( 'Capture Payment', 'wp-e-commerce' ); ?></button>
|
350 |
+
<div class="spinner"></div>
|
351 |
+
<?php
|
352 |
+
endif;
|
353 |
+
}
|
354 |
+
|
355 |
public function purch_notes_box() {
|
356 |
?>
|
357 |
<div class="wpsc-notes">
|
537 |
|
538 |
add_action( 'wpsc_display_purchase_logs_page', array( $this, 'display_purchase_log' ) );
|
539 |
add_action( 'wpsc_purchlog_before_metaboxes' , array( $this, 'register_metaboxes' ) );
|
540 |
+
|
541 |
+
add_action( 'wpsc_order_row_actions' , array( $this, 'add_refund_button' ) );
|
542 |
+
add_action( 'wpsc_order_row_actions_views' , array( $this, 'add_refund_button_ui' ) );
|
543 |
+
|
544 |
+
add_action( 'wpsc_order_row_actions' , array( $this, 'add_capture_button' ) );
|
545 |
}
|
546 |
|
547 |
public function register_metaboxes() {
|
585 |
if ( $note ) {
|
586 |
check_admin_referer( 'wpsc_log_add_notes_nonce', 'wpsc_log_add_notes_nonce' );
|
587 |
|
588 |
+
$log->add_note( wp_kses_post( $note ) );
|
589 |
|
590 |
wp_safe_redirect( esc_url_raw( remove_query_arg( 'wpsc_log_add_notes_nonce' ) ) );
|
591 |
exit;
|
596 |
if ( is_numeric( $note_id ) ) {
|
597 |
check_admin_referer( 'delete-note', 'delete-note' );
|
598 |
|
599 |
+
$notes = wpsc_get_order_notes( $log );
|
600 |
|
601 |
$notes->remove( $note_id )->save();
|
602 |
|
783 |
$ids = array_map( 'intval', $_REQUEST['post'] );
|
784 |
|
785 |
foreach ( $ids as $id ) {
|
786 |
+
$log = wpsc_get_order( $id );
|
787 |
$log->delete();
|
788 |
}
|
789 |
|
wpsc-admin/display-upgrades.page.php
CHANGED
@@ -10,18 +10,24 @@ function wpsc_display_upgrades_page() {
|
|
10 |
<div class="postbox">
|
11 |
<h3 class="hndle"><?php _e( 'Product License Registration', 'wp-e-commerce' );?></h3>
|
12 |
<p>
|
13 |
-
<label for="activation_key"><?php _e( 'License Key ', 'wp-e-commerce' );
|
14 |
<input type="text" id="activation_key" name="product_license" size="48" value="" class="text" />
|
15 |
</p>
|
16 |
<p>
|
17 |
<input type="hidden" value="true" name="product_license_key" />
|
18 |
-
|
19 |
-
|
20 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
<p>
|
22 |
-
<?php _e( '
|
23 |
-
<?php _e( 'Old API Keys will not work! ', 'wp-e-commerce' ); ?>
|
24 |
</p>
|
|
|
25 |
</div>
|
26 |
</form>
|
27 |
</div>
|
@@ -53,16 +59,16 @@ function wpse_license_page_display_licenses () {
|
|
53 |
<?php }
|
54 |
} else {
|
55 |
?>
|
56 |
-
<tr class="no-items"><td class="colspanchange" colspan="4"><p><?php _e('No
|
57 |
<?php
|
58 |
}
|
59 |
?>
|
60 |
</tbody>
|
61 |
<tfoot>
|
62 |
<tr>
|
63 |
-
<th scope="col" class="manage-column column-product_name column-primary"><?php _e('Product Name', 'wp-e-commerce'); ?></th>
|
64 |
-
<th scope="col" class="manage-column column-product_license"><?php _e('License Key', 'wp-e-commerce'); ?></th>
|
65 |
-
<th scope="col" class="manage-column column-product_expiry"><?php _e('License Expiration', 'wp-e-commerce'); ?></th>
|
66 |
</tr>
|
67 |
</tfoot>
|
68 |
</table>
|
@@ -74,29 +80,29 @@ function wpse_license_page_display_licenses () {
|
|
74 |
*/
|
75 |
function wpec_licenses_action_stuff() {
|
76 |
//Activate a new Product License
|
77 |
-
|
78 |
if( ! current_user_can( 'manage_options' ) ) {
|
79 |
return;
|
80 |
}
|
81 |
-
|
82 |
if ( isset( $_POST['product_license_key'] ) && $_POST['product_license_key'] == 'true' ) {
|
83 |
if ( isset( $_POST['product_license'] ) && $_POST['product_license'] != '' ) {
|
84 |
-
|
85 |
//Do stuff
|
86 |
$params = array (
|
87 |
'license' => sanitize_text_field( $_POST['product_license'] ),
|
88 |
'url' => home_url()
|
89 |
);
|
90 |
-
|
91 |
$activation = false;
|
92 |
-
if ( isset( $_POST['submit_values'] ) && $_POST['submit_values'] == '
|
93 |
$activation = true;
|
94 |
$params['wpec_lic_action'] = 'activate_license';
|
95 |
-
} elseif ( isset( $_POST['reset_values'] ) && $_POST['reset_values'] == '
|
96 |
$params['wpec_lic_action'] = 'deactivate_license';
|
97 |
}
|
98 |
-
|
99 |
-
$response =
|
100 |
'https://wpecommerce.org/',
|
101 |
array(
|
102 |
'timeout' => 15,
|
@@ -104,17 +110,17 @@ function wpec_licenses_action_stuff() {
|
|
104 |
'body' => $params
|
105 |
)
|
106 |
);
|
107 |
-
|
108 |
// Make sure there are no errors
|
109 |
if ( is_wp_error( $response ) ) {
|
110 |
return;
|
111 |
}
|
112 |
-
|
113 |
// Decode license data
|
114 |
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
115 |
$active_licenses = get_option( 'wpec_licenses_active_products', array() );
|
116 |
|
117 |
-
if( $license_data->success === true ) {
|
118 |
if ( $activation ) {
|
119 |
// Tell WordPress to look for updates
|
120 |
set_site_transient( 'update_plugins', null );
|
@@ -127,91 +133,48 @@ function wpec_licenses_action_stuff() {
|
|
127 |
update_option( 'wpec_licenses_active_products', $active_licenses );
|
128 |
delete_option( 'wpec_product_' . $license_data->item_id . '_license_active' );
|
129 |
}
|
130 |
-
|
131 |
|
132 |
-
|
|
|
133 |
} else {
|
134 |
-
echo '<div class="error"><p>'.esc_html( $license_data->message ).'</p></div>';
|
135 |
}
|
136 |
}
|
137 |
}
|
138 |
}
|
|
|
139 |
add_action( 'wpsc_upgrades_license_activation', 'wpec_licenses_action_stuff' );
|
140 |
|
141 |
-
function
|
|
|
142 |
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
foreach ( (array) $active_licenses as $license ) {
|
153 |
-
$license_info = get_option( 'wpec_product_' . $license . '_license_active' );
|
154 |
-
|
155 |
-
// data to send in our API request
|
156 |
-
$api_params = array(
|
157 |
-
'wpec_lic_action'=> 'check_license',
|
158 |
-
'license' => $license_info->license_key,
|
159 |
-
'item_id' => $license_info->item_id,
|
160 |
-
'url' => home_url()
|
161 |
-
);
|
162 |
|
163 |
-
|
164 |
-
$response = wp_remote_post(
|
165 |
-
'https://wpecommerce.org/',
|
166 |
-
array(
|
167 |
-
'timeout' => 15,
|
168 |
-
'sslverify' => false,
|
169 |
-
'body' => $api_params
|
170 |
-
)
|
171 |
-
);
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
return false;
|
176 |
-
}
|
177 |
|
178 |
-
|
179 |
-
|
|
|
|
|
|
|
|
|
180 |
}
|
181 |
-
}
|
182 |
-
add_action( 'wpsc_weekly_cron_task', 'wpec_lic_weekly_license_check' ); // For testing use admin_init
|
183 |
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
}
|
188 |
-
|
189 |
-
$active_licenses = get_option( 'wpec_licenses_active_products', array() );
|
190 |
-
if( empty( $active_licenses ) ) {
|
191 |
-
return;
|
192 |
-
}
|
193 |
-
|
194 |
-
$messages = array();
|
195 |
-
|
196 |
-
foreach ( (array) $active_licenses as $license ) {
|
197 |
-
$license = get_option( 'wpec_product_' . $license . '_license_active' );
|
198 |
-
if( is_object( $license ) && 'valid' !== $license->license && empty( $showed_invalid_message ) ) {
|
199 |
-
if( isset( $_GET['page'] ) && 'wpsc-upgrades' !== $_GET['page'] ) {
|
200 |
-
$messages[] = sprintf(
|
201 |
-
__( 'You have invalid or expired license keys for WP eCommerce. Please go to the <a href="%s" title="Go to Licenses page">Licenses page</a> to correct this issue.', 'wp-e-commerce' ),
|
202 |
-
admin_url( 'index.php?page=wpsc-upgrades' )
|
203 |
-
);
|
204 |
-
$showed_invalid_message = true;
|
205 |
-
}
|
206 |
-
}
|
207 |
-
}
|
208 |
-
|
209 |
-
if( ! empty( $messages ) ) {
|
210 |
-
foreach( $messages as $message ) {
|
211 |
-
echo '<div class="error">';
|
212 |
-
echo '<p>' . $message . '</p>';
|
213 |
-
echo '</div>';
|
214 |
-
}
|
215 |
-
}
|
216 |
}
|
217 |
-
add_action( 'admin_notices', 'wpec_license_notices' );
|
10 |
<div class="postbox">
|
11 |
<h3 class="hndle"><?php _e( 'Product License Registration', 'wp-e-commerce' );?></h3>
|
12 |
<p>
|
13 |
+
<label for="activation_key"><?php _e( 'License Key ', 'wp-e-commerce' ); ?></label>
|
14 |
<input type="text" id="activation_key" name="product_license" size="48" value="" class="text" />
|
15 |
</p>
|
16 |
<p>
|
17 |
<input type="hidden" value="true" name="product_license_key" />
|
18 |
+
<?php submit_button( __( 'Register License', 'wp-e-commerce' ), 'primary', 'submit_values', false ); ?>
|
19 |
+
<?php submit_button( __( 'Reset License', 'wp-e-commerce' ), 'secondary', 'reset_values', false ); ?>
|
20 |
</p>
|
21 |
+
<?php
|
22 |
+
echo '<p>' . sprintf(
|
23 |
+
__( 'Enter your extension license keys here to receive updates for purchased extensions. If your license key has expired, please <a href="%s" target="_blank">renew your license</a>.', 'wp-e-commerce' ),
|
24 |
+
'http://docs.wpecommerce.org/license-renewals/'
|
25 |
+
) . '</p>';
|
26 |
+
?>
|
27 |
<p>
|
28 |
+
<?php _e( 'API keys purchased prior to November 6, 2015 will not work.', 'wp-e-commerce' ); ?>
|
|
|
29 |
</p>
|
30 |
+
|
31 |
</div>
|
32 |
</form>
|
33 |
</div>
|
59 |
<?php }
|
60 |
} else {
|
61 |
?>
|
62 |
+
<tr class="no-items"><td class="colspanchange" colspan="4"><p><?php _e('No licenses found.', 'wp-e-commerce'); ?></p></td></tr>
|
63 |
<?php
|
64 |
}
|
65 |
?>
|
66 |
</tbody>
|
67 |
<tfoot>
|
68 |
<tr>
|
69 |
+
<th scope="col" class="manage-column column-product_name column-primary"><?php _e( 'Product Name', 'wp-e-commerce' ); ?></th>
|
70 |
+
<th scope="col" class="manage-column column-product_license"><?php _e( 'License Key', 'wp-e-commerce' ); ?></th>
|
71 |
+
<th scope="col" class="manage-column column-product_expiry"><?php _e( 'License Expiration', 'wp-e-commerce' ); ?></th>
|
72 |
</tr>
|
73 |
</tfoot>
|
74 |
</table>
|
80 |
*/
|
81 |
function wpec_licenses_action_stuff() {
|
82 |
//Activate a new Product License
|
83 |
+
|
84 |
if( ! current_user_can( 'manage_options' ) ) {
|
85 |
return;
|
86 |
}
|
87 |
+
|
88 |
if ( isset( $_POST['product_license_key'] ) && $_POST['product_license_key'] == 'true' ) {
|
89 |
if ( isset( $_POST['product_license'] ) && $_POST['product_license'] != '' ) {
|
90 |
+
|
91 |
//Do stuff
|
92 |
$params = array (
|
93 |
'license' => sanitize_text_field( $_POST['product_license'] ),
|
94 |
'url' => home_url()
|
95 |
);
|
96 |
+
|
97 |
$activation = false;
|
98 |
+
if ( isset( $_POST['submit_values'] ) && $_POST['submit_values'] == __( 'Register License', 'wp-e-commerce' ) ) {
|
99 |
$activation = true;
|
100 |
$params['wpec_lic_action'] = 'activate_license';
|
101 |
+
} elseif ( isset( $_POST['reset_values'] ) && $_POST['reset_values'] == __( 'Reset License', 'wp-e-commerce' ) ) {
|
102 |
$params['wpec_lic_action'] = 'deactivate_license';
|
103 |
}
|
104 |
+
|
105 |
+
$response = wp_safe_remote_post(
|
106 |
'https://wpecommerce.org/',
|
107 |
array(
|
108 |
'timeout' => 15,
|
110 |
'body' => $params
|
111 |
)
|
112 |
);
|
113 |
+
|
114 |
// Make sure there are no errors
|
115 |
if ( is_wp_error( $response ) ) {
|
116 |
return;
|
117 |
}
|
118 |
+
|
119 |
// Decode license data
|
120 |
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
121 |
$active_licenses = get_option( 'wpec_licenses_active_products', array() );
|
122 |
|
123 |
+
if ( $license_data->success === true ) {
|
124 |
if ( $activation ) {
|
125 |
// Tell WordPress to look for updates
|
126 |
set_site_transient( 'update_plugins', null );
|
133 |
update_option( 'wpec_licenses_active_products', $active_licenses );
|
134 |
delete_option( 'wpec_product_' . $license_data->item_id . '_license_active' );
|
135 |
}
|
|
|
136 |
|
137 |
+
|
138 |
+
echo '<div class="updated"><p>' . esc_html( $license_data->message ).'</p></div>';
|
139 |
} else {
|
140 |
+
echo '<div class="error"><p>' . esc_html( $license_data->message ).'</p></div>';
|
141 |
}
|
142 |
}
|
143 |
}
|
144 |
}
|
145 |
+
|
146 |
add_action( 'wpsc_upgrades_license_activation', 'wpec_licenses_action_stuff' );
|
147 |
|
148 |
+
function wpec_license_notices() {
|
149 |
+
static $showed_invalid_message;
|
150 |
|
151 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
152 |
+
return;
|
153 |
+
}
|
154 |
|
155 |
+
$active_licenses = get_option( 'wpec_licenses_active_products', array() );
|
156 |
+
if( empty( $active_licenses ) ) {
|
157 |
+
return;
|
158 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
|
160 |
+
$messages = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
+
foreach ( (array) $active_licenses as $license ) {
|
163 |
+
$license = get_option( 'wpec_product_' . $license . '_license_active' );
|
|
|
|
|
164 |
|
165 |
+
if( is_object( $license ) && 'valid' !== $license->license && empty( $showed_invalid_message ) ) {
|
166 |
+
$messages[] = sprintf(
|
167 |
+
__( 'You have invalid or expired license keys for WP eCommerce. Please go to the <a href="%s" title="WPeC Licensing">WPeC Licensing</a> page to correct this issue.', 'wp-e-commerce' ),
|
168 |
+
admin_url( 'index.php?page=wpsc-upgrades' )
|
169 |
+
);
|
170 |
+
$showed_invalid_message = true;
|
171 |
}
|
172 |
+
}
|
|
|
173 |
|
174 |
+
if( ! empty( $messages ) ) {
|
175 |
+
foreach( $messages as $message ) {
|
176 |
+
echo '<div class="error"><p>' . $message . '</p></div>';
|
177 |
}
|
178 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
}
|
180 |
+
add_action( 'admin_notices', 'wpec_license_notices' );
|
wpsc-admin/includes/duplicate-product-class.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
*
|
6 |
* @package WP eCommerce
|
7 |
* @subpackage Duplicate Product Class
|
8 |
-
* @since
|
9 |
*/
|
10 |
|
11 |
/**
|
@@ -13,7 +13,7 @@
|
|
13 |
*
|
14 |
* Used to duplicate products.
|
15 |
*
|
16 |
-
* @since
|
17 |
*/
|
18 |
class WPSC_Duplicate_Product {
|
19 |
|
@@ -24,7 +24,7 @@ class WPSC_Duplicate_Product {
|
|
24 |
/**
|
25 |
* Create new duplicate product
|
26 |
*
|
27 |
-
* @since
|
28 |
*
|
29 |
* @param int $post_id Post ID.
|
30 |
* @param int|false $new_parent_id Optional. New post parent ID.
|
@@ -40,7 +40,7 @@ class WPSC_Duplicate_Product {
|
|
40 |
/**
|
41 |
* Duplicates a product
|
42 |
*
|
43 |
-
* @since
|
44 |
*
|
45 |
* @uses wp_insert_post() Inserts a new post to the database.
|
46 |
*
|
@@ -117,7 +117,7 @@ class WPSC_Duplicate_Product {
|
|
117 |
/**
|
118 |
* Copy the taxonomies of a post to another post
|
119 |
*
|
120 |
-
* @since
|
121 |
*
|
122 |
* @uses get_object_taxonomies() Gets taxonomies for the given object.
|
123 |
* @uses wpsc_get_product_terms() Gets terms for the product taxonomies.
|
@@ -145,7 +145,7 @@ class WPSC_Duplicate_Product {
|
|
145 |
/**
|
146 |
* Copy the meta information of a post to another post
|
147 |
*
|
148 |
-
* @since
|
149 |
*
|
150 |
* @uses $wpdb WordPress database object for queries.
|
151 |
* @uses get_results() Gets generic multirow results from the database.
|
@@ -180,7 +180,6 @@ class WPSC_Duplicate_Product {
|
|
180 |
}
|
181 |
|
182 |
$sql_query .= implode( ",", $sql_query_sel );
|
183 |
-
$sql_query = $wpdb->prepare( $sql_query, $values );
|
184 |
$wpdb->query( $sql_query );
|
185 |
clean_post_cache( $new_post_id );
|
186 |
}
|
@@ -197,7 +196,7 @@ class WPSC_Duplicate_Product {
|
|
197 |
* duplicated this function is used to update the gallery meta to
|
198 |
* refer to the IDs of any duplicated media.
|
199 |
*
|
200 |
-
* @since
|
201 |
*
|
202 |
* @param array $duplicated_children Associative array mapping original child IDs to duplicated child IDs.
|
203 |
*/
|
@@ -248,7 +247,7 @@ class WPSC_Duplicate_Product {
|
|
248 |
* the duplicated product and offers the opportunity to change the featured image
|
249 |
* of the duplicated product via the 'wpsc_duplicate_product_thumbnail' filter.
|
250 |
*
|
251 |
-
* @since
|
252 |
*/
|
253 |
private function duplicate_product_thumbnail() {
|
254 |
|
@@ -277,7 +276,7 @@ class WPSC_Duplicate_Product {
|
|
277 |
/**
|
278 |
* Duplicates product children and meta
|
279 |
*
|
280 |
-
* @since
|
281 |
*
|
282 |
* @uses get_posts() Gets an array of posts given array of arguments.
|
283 |
*
|
@@ -331,7 +330,7 @@ class WPSC_Duplicate_Product {
|
|
331 |
* Uses a portion of code from media_sideload_image() in `wp-admin/includes/media.php`
|
332 |
* to check file before downloading from URL.
|
333 |
*
|
334 |
-
* @since
|
335 |
*
|
336 |
* @uses get_post_type() Gets post type.
|
337 |
* @uses wp_get_attachment_url() Gets attachment URL.
|
@@ -411,7 +410,7 @@ class WPSC_Duplicate_Product {
|
|
411 |
/**
|
412 |
* Get Post ID
|
413 |
*
|
414 |
-
* @since
|
415 |
*
|
416 |
* @return int Post ID.
|
417 |
*/
|
@@ -423,7 +422,7 @@ class WPSC_Duplicate_Product {
|
|
423 |
/**
|
424 |
* Get New Post ID
|
425 |
*
|
426 |
-
* @since
|
427 |
*
|
428 |
* @return int Post ID.
|
429 |
*/
|
@@ -435,7 +434,7 @@ class WPSC_Duplicate_Product {
|
|
435 |
/**
|
436 |
* Get New Parent ID
|
437 |
*
|
438 |
-
* @since
|
439 |
*
|
440 |
* @param int $default Default parent ID.
|
441 |
* @return int Post ID.
|
@@ -444,4 +443,4 @@ class WPSC_Duplicate_Product {
|
|
444 |
|
445 |
return false === $this->new_parent_id ? $default : $this->new_parent_id;
|
446 |
}
|
447 |
-
}
|
5 |
*
|
6 |
* @package WP eCommerce
|
7 |
* @subpackage Duplicate Product Class
|
8 |
+
* @since 3.11.0
|
9 |
*/
|
10 |
|
11 |
/**
|
13 |
*
|
14 |
* Used to duplicate products.
|
15 |
*
|
16 |
+
* @since 3.11.0
|
17 |
*/
|
18 |
class WPSC_Duplicate_Product {
|
19 |
|
24 |
/**
|
25 |
* Create new duplicate product
|
26 |
*
|
27 |
+
* @since 3.11.0
|
28 |
*
|
29 |
* @param int $post_id Post ID.
|
30 |
* @param int|false $new_parent_id Optional. New post parent ID.
|
40 |
/**
|
41 |
* Duplicates a product
|
42 |
*
|
43 |
+
* @since 3.11.0
|
44 |
*
|
45 |
* @uses wp_insert_post() Inserts a new post to the database.
|
46 |
*
|
117 |
/**
|
118 |
* Copy the taxonomies of a post to another post
|
119 |
*
|
120 |
+
* @since 3.11.0
|
121 |
*
|
122 |
* @uses get_object_taxonomies() Gets taxonomies for the given object.
|
123 |
* @uses wpsc_get_product_terms() Gets terms for the product taxonomies.
|
145 |
/**
|
146 |
* Copy the meta information of a post to another post
|
147 |
*
|
148 |
+
* @since 3.11.0
|
149 |
*
|
150 |
* @uses $wpdb WordPress database object for queries.
|
151 |
* @uses get_results() Gets generic multirow results from the database.
|
180 |
}
|
181 |
|
182 |
$sql_query .= implode( ",", $sql_query_sel );
|
|
|
183 |
$wpdb->query( $sql_query );
|
184 |
clean_post_cache( $new_post_id );
|
185 |
}
|
196 |
* duplicated this function is used to update the gallery meta to
|
197 |
* refer to the IDs of any duplicated media.
|
198 |
*
|
199 |
+
* @since 3.11.0
|
200 |
*
|
201 |
* @param array $duplicated_children Associative array mapping original child IDs to duplicated child IDs.
|
202 |
*/
|
247 |
* the duplicated product and offers the opportunity to change the featured image
|
248 |
* of the duplicated product via the 'wpsc_duplicate_product_thumbnail' filter.
|
249 |
*
|
250 |
+
* @since 3.11.0
|
251 |
*/
|
252 |
private function duplicate_product_thumbnail() {
|
253 |
|
276 |
/**
|
277 |
* Duplicates product children and meta
|
278 |
*
|
279 |
+
* @since 3.11.0
|
280 |
*
|
281 |
* @uses get_posts() Gets an array of posts given array of arguments.
|
282 |
*
|
330 |
* Uses a portion of code from media_sideload_image() in `wp-admin/includes/media.php`
|
331 |
* to check file before downloading from URL.
|
332 |
*
|
333 |
+
* @since 3.11.0
|
334 |
*
|
335 |
* @uses get_post_type() Gets post type.
|
336 |
* @uses wp_get_attachment_url() Gets attachment URL.
|
410 |
/**
|
411 |
* Get Post ID
|
412 |
*
|
413 |
+
* @since 3.11.0
|
414 |
*
|
415 |
* @return int Post ID.
|
416 |
*/
|
422 |
/**
|
423 |
* Get New Post ID
|
424 |
*
|
425 |
+
* @since 3.11.0
|
426 |
*
|
427 |
* @return int Post ID.
|
428 |
*/
|
434 |
/**
|
435 |
* Get New Parent ID
|
436 |
*
|
437 |
+
* @since 3.11.0
|
438 |
*
|
439 |
* @param int $default Default parent ID.
|
440 |
* @return int Post ID.
|
443 |
|
444 |
return false === $this->new_parent_id ? $default : $this->new_parent_id;
|
445 |
}
|
446 |
+
}
|
wpsc-admin/includes/purchase-log-list-table-class.php
CHANGED
@@ -214,7 +214,7 @@ class WPSC_Purchase_Log_List_Table extends WP_List_Table {
|
|
214 |
* prior 3 months, this year, last year. You can insert your own custom periods by filtering
|
215 |
* either based on the $period_flag or just filter the final query setup.
|
216 |
*
|
217 |
-
* @since
|
218 |
*
|
219 |
* @param array $period_flag The period requested from $_REQUEST['m'].
|
220 |
*
|
@@ -855,7 +855,7 @@ class WPSC_Purchase_Log_List_Table extends WP_List_Table {
|
|
855 |
/**
|
856 |
* Filter the available bulk actions on the purchase log listing screen.
|
857 |
*
|
858 |
-
* @since
|
859 |
*
|
860 |
* @param array $actions The bulk actions currently defined.
|
861 |
*/
|
214 |
* prior 3 months, this year, last year. You can insert your own custom periods by filtering
|
215 |
* either based on the $period_flag or just filter the final query setup.
|
216 |
*
|
217 |
+
* @since 3.11.5
|
218 |
*
|
219 |
* @param array $period_flag The period requested from $_REQUEST['m'].
|
220 |
*
|
855 |
/**
|
856 |
* Filter the available bulk actions on the purchase log listing screen.
|
857 |
*
|
858 |
+
* @since 3.11.5
|
859 |
*
|
860 |
* @param array $actions The bulk actions currently defined.
|
861 |
*/
|
wpsc-admin/includes/purchase-logs-page/item-details.php
CHANGED
@@ -32,9 +32,11 @@
|
|
32 |
<?php self::shipping_address_output(); ?>
|
33 |
</blockquote>
|
34 |
|
|
|
|
|
35 |
<h4><?php esc_html_e( 'Shipping Details', 'wp-e-commerce' ); ?></h4>
|
36 |
<blockquote>
|
37 |
-
<strong><?php esc_html_e( 'Shipping Method:', 'wp-e-commerce' ); ?></strong> <?php echo
|
38 |
<strong><?php esc_html_e( 'Shipping Option:', 'wp-e-commerce' ); ?></strong> <?php echo wpsc_display_purchlog_shipping_option(); ?><br />
|
39 |
<?php $purchase_weight = wpsc_purchlogs_get_weight_text(); ?>
|
40 |
<?php if ( ! empty( $purchase_weight ) ) { ?>
|
@@ -56,6 +58,7 @@
|
|
56 |
<?php } ?>
|
57 |
</blockquote>
|
58 |
<?php do_action( 'wpsc_shipping_details_bottom', $this->log_id ); ?>
|
|
|
59 |
</div>
|
60 |
<?php endif ?>
|
61 |
|
32 |
<?php self::shipping_address_output(); ?>
|
33 |
</blockquote>
|
34 |
|
35 |
+
<?php $method = wpsc_display_purchlog_shipping_method(); ?>
|
36 |
+
<?php if ( ! empty( $method ) ) : ?>
|
37 |
<h4><?php esc_html_e( 'Shipping Details', 'wp-e-commerce' ); ?></h4>
|
38 |
<blockquote>
|
39 |
+
<strong><?php esc_html_e( 'Shipping Method:', 'wp-e-commerce' ); ?></strong> <?php echo $method; ?><br />
|
40 |
<strong><?php esc_html_e( 'Shipping Option:', 'wp-e-commerce' ); ?></strong> <?php echo wpsc_display_purchlog_shipping_option(); ?><br />
|
41 |
<?php $purchase_weight = wpsc_purchlogs_get_weight_text(); ?>
|
42 |
<?php if ( ! empty( $purchase_weight ) ) { ?>
|
58 |
<?php } ?>
|
59 |
</blockquote>
|
60 |
<?php do_action( 'wpsc_shipping_details_bottom', $this->log_id ); ?>
|
61 |
+
<?php endif; ?>
|
62 |
</div>
|
63 |
<?php endif ?>
|
64 |
|
wpsc-admin/init.php
CHANGED
@@ -358,7 +358,7 @@ add_action( 'wpsc_purchase_log_action-downloads_lock', 'wpsc_purchase_log_action
|
|
358 |
*/
|
359 |
function wpsc_purchase_log_action_delete( $log_id ) {
|
360 |
|
361 |
-
$log =
|
362 |
$deleted = $log->delete();
|
363 |
|
364 |
// Redirect back to purchase logs list
|
@@ -426,7 +426,7 @@ function wpsc_purchlog_resend_email( $log_id = '' ) {
|
|
426 |
$wpec_taxes_controller = new wpec_taxes_controller();
|
427 |
|
428 |
if ( is_numeric( $log_id ) ) {
|
429 |
-
$purchase_log =
|
430 |
return wpsc_send_customer_email( $purchase_log );
|
431 |
}
|
432 |
}
|
@@ -505,7 +505,7 @@ function wpsc_purchlog_bulk_modify() {
|
|
505 |
} elseif ( $_POST['purchlog_multiple_status_change'] == 'delete' ) {
|
506 |
foreach ( (array)$_POST['purchlogids'] as $purchlogid ) {
|
507 |
|
508 |
-
$log =
|
509 |
$deleted_log = $log->delete();
|
510 |
if ( $deleted_log ) {
|
511 |
$deleted++;
|
@@ -560,8 +560,9 @@ function wpsc_purchlogs_update_notes( $purchlog_id = 0, $purchlog_notes = '' ) {
|
|
560 |
: wpsc_get_order( $purchlog_id );
|
561 |
|
562 |
$notes = wpsc_get_order_notes( $purchase_log );
|
|
|
563 |
|
564 |
-
return $notes
|
565 |
}
|
566 |
|
567 |
/**
|
@@ -582,7 +583,7 @@ function wpsc_delete_purchlog( $purchlog_id = '' ) {
|
|
582 |
return false;
|
583 |
}
|
584 |
|
585 |
-
$log =
|
586 |
|
587 |
return $log->delete();
|
588 |
|
358 |
*/
|
359 |
function wpsc_purchase_log_action_delete( $log_id ) {
|
360 |
|
361 |
+
$log = wpsc_get_order( $log_id );
|
362 |
$deleted = $log->delete();
|
363 |
|
364 |
// Redirect back to purchase logs list
|
426 |
$wpec_taxes_controller = new wpec_taxes_controller();
|
427 |
|
428 |
if ( is_numeric( $log_id ) ) {
|
429 |
+
$purchase_log = wpsc_get_order( $log_id );
|
430 |
return wpsc_send_customer_email( $purchase_log );
|
431 |
}
|
432 |
}
|
505 |
} elseif ( $_POST['purchlog_multiple_status_change'] == 'delete' ) {
|
506 |
foreach ( (array)$_POST['purchlogids'] as $purchlogid ) {
|
507 |
|
508 |
+
$log = wpsc_get_order( $purchlogid );
|
509 |
$deleted_log = $log->delete();
|
510 |
if ( $deleted_log ) {
|
511 |
$deleted++;
|
560 |
: wpsc_get_order( $purchlog_id );
|
561 |
|
562 |
$notes = wpsc_get_order_notes( $purchase_log );
|
563 |
+
$notes->add( $purchlog_notes )->save();
|
564 |
|
565 |
+
return $notes;
|
566 |
}
|
567 |
|
568 |
/**
|
583 |
return false;
|
584 |
}
|
585 |
|
586 |
+
$log = wpsc_get_order( $purchlog_id );
|
587 |
|
588 |
return $log->delete();
|
589 |
|
wpsc-admin/js/admin.js
CHANGED
@@ -85,9 +85,6 @@
|
|
85 |
stop : category_sort
|
86 |
});
|
87 |
|
88 |
-
$('#edittag').attr('enctype', 'multipart/form-data').attr('encoding', 'multipart/form-data');
|
89 |
-
$('.edit-tags-php form').attr('enctype', 'multipart/form-data').attr('encoding', 'multipart/form-data');
|
90 |
-
|
91 |
$('[name="image"]').on('change', function() {
|
92 |
var t = $(this);
|
93 |
|
@@ -353,7 +350,7 @@ jQuery(document).ready(function($){
|
|
353 |
});
|
354 |
};
|
355 |
|
356 |
-
if (limited_stock_checkbox.
|
357 |
toggle_stock_fields(limited_stock_checkbox.is(':checked'));
|
358 |
}
|
359 |
|
@@ -419,7 +416,7 @@ jQuery(document).ready(function($){
|
|
419 |
|
420 |
jQuery('.coupon-conditions').on( 'click', '.wpsc-button-minus', function() {
|
421 |
var parent = jQuery(this).closest('.coupon-condition'),
|
422 |
-
conditions_count = jQuery('.coupon-condition').
|
423 |
prototype;
|
424 |
|
425 |
if ( jQuery( this ).index( jQuery( '.wpsc-button-minus' ) ) === 0 ) {
|
85 |
stop : category_sort
|
86 |
});
|
87 |
|
|
|
|
|
|
|
88 |
$('[name="image"]').on('change', function() {
|
89 |
var t = $(this);
|
90 |
|
350 |
});
|
351 |
};
|
352 |
|
353 |
+
if (limited_stock_checkbox.length > 0) {
|
354 |
toggle_stock_fields(limited_stock_checkbox.is(':checked'));
|
355 |
}
|
356 |
|
416 |
|
417 |
jQuery('.coupon-conditions').on( 'click', '.wpsc-button-minus', function() {
|
418 |
var parent = jQuery(this).closest('.coupon-condition'),
|
419 |
+
conditions_count = jQuery('.coupon-condition').length,
|
420 |
prototype;
|
421 |
|
422 |
if ( jQuery( this ).index( jQuery( '.wpsc-button-minus' ) ) === 0 ) {
|
wpsc-admin/js/purchase-logs.js
CHANGED
@@ -59,6 +59,7 @@ window.WPSC_Purchase_Logs_Admin = window.WPSC_Purchase_Logs_Admin || {};
|
|
59 |
.on( 'change', '.wpsc_item_qty', admin.update_qty )
|
60 |
.on( 'click', '.wpsc-add-item-button', function() { admin.product_search.trigger( 'open' ); } )
|
61 |
.on( 'click', '.refund-items', admin.toggleRefundsUI )
|
|
|
62 |
.on( 'click', 'button.do-api-refund, button.do-manual-refund', admin.refundItem );
|
63 |
$c.body.on( 'click', '.ui-find-overlay', function() { admin.product_search.trigger( 'close' ); } );
|
64 |
|
@@ -85,42 +86,74 @@ window.WPSC_Purchase_Logs_Admin = window.WPSC_Purchase_Logs_Admin || {};
|
|
85 |
$( '.wpsc-refund-ui' ).toggle();
|
86 |
};
|
87 |
|
88 |
-
admin.refundItem = function() {
|
89 |
-
var $
|
90 |
-
var $spinner
|
91 |
-
var api_refund
|
92 |
var refund_string = api_refund ? wpsc.strings.confirm_refund_order : wpsc.strings.confirm_refund_order_manually;
|
93 |
|
94 |
if ( ! window.confirm( refund_string ) ) {
|
95 |
return;
|
96 |
}
|
97 |
|
98 |
-
var refund_reason = $( 'input#refund_reason' ).val();
|
99 |
-
var refund_amount = $( 'input#refund_amount' ).val();
|
100 |
-
|
101 |
var data = {
|
102 |
action : 'purchase_log_refund_items',
|
103 |
order_id : wpsc.log_id,
|
104 |
-
refund_reason : refund_reason,
|
105 |
-
refund_amount : refund_amount,
|
106 |
api_refund : api_refund,
|
107 |
nonce : wpsc.purchase_log_refund_items_nonce
|
108 |
};
|
109 |
|
110 |
var ajax_callback = function( response ) {
|
111 |
-
$spinner.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
if ( ! response.is_successful ) {
|
114 |
if ( response.error ) {
|
115 |
window.alert( response.error.messages.join( BR ) );
|
116 |
}
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
-
|
119 |
}
|
120 |
-
window.location.href = window.location.href;
|
121 |
};
|
122 |
|
123 |
-
$spinner.
|
124 |
|
125 |
$.wpsc_post( data, ajax_callback );
|
126 |
};
|
59 |
.on( 'change', '.wpsc_item_qty', admin.update_qty )
|
60 |
.on( 'click', '.wpsc-add-item-button', function() { admin.product_search.trigger( 'open' ); } )
|
61 |
.on( 'click', '.refund-items', admin.toggleRefundsUI )
|
62 |
+
.on( 'click', '.capture-payment', admin.capturePayment )
|
63 |
.on( 'click', 'button.do-api-refund, button.do-manual-refund', admin.refundItem );
|
64 |
$c.body.on( 'click', '.ui-find-overlay', function() { admin.product_search.trigger( 'close' ); } );
|
65 |
|
86 |
$( '.wpsc-refund-ui' ).toggle();
|
87 |
};
|
88 |
|
89 |
+
admin.refundItem = function( evt ) {
|
90 |
+
var $button = $( this );
|
91 |
+
var $spinner = $button.parents( 'tr' ).find('.spinner');
|
92 |
+
var api_refund = $button.is( '.do-api-refund' );
|
93 |
var refund_string = api_refund ? wpsc.strings.confirm_refund_order : wpsc.strings.confirm_refund_order_manually;
|
94 |
|
95 |
if ( ! window.confirm( refund_string ) ) {
|
96 |
return;
|
97 |
}
|
98 |
|
|
|
|
|
|
|
99 |
var data = {
|
100 |
action : 'purchase_log_refund_items',
|
101 |
order_id : wpsc.log_id,
|
102 |
+
refund_reason : $( 'input#refund_reason' ).val(),
|
103 |
+
refund_amount : $( 'input#refund_amount' ).val(),
|
104 |
api_refund : api_refund,
|
105 |
nonce : wpsc.purchase_log_refund_items_nonce
|
106 |
};
|
107 |
|
108 |
var ajax_callback = function( response ) {
|
109 |
+
$spinner.removeClass( 'is-active' );
|
110 |
+
if ( ! response.is_successful ) {
|
111 |
+
if ( response.error ) {
|
112 |
+
window.alert( response.error.messages.join( BR ) );
|
113 |
+
}
|
114 |
+
} else {
|
115 |
+
|
116 |
+
setTimeout( function() {
|
117 |
+
// Re-spinner while we refresh page.
|
118 |
+
$spinner.addClass( 'is-active' );
|
119 |
+
}, 900 );
|
120 |
+
|
121 |
+
window.location.href = window.location.href;
|
122 |
+
}
|
123 |
+
};
|
124 |
+
|
125 |
+
$spinner.addClass( 'is-active' );
|
126 |
|
127 |
+
$.wpsc_post( data, ajax_callback );
|
128 |
+
};
|
129 |
+
|
130 |
+
admin.capturePayment = function( evt ) {
|
131 |
+
var $button = $( this );
|
132 |
+
var $spinner = $button.siblings( '.spinner' );
|
133 |
+
|
134 |
+
var data = {
|
135 |
+
action : 'purchase_log_capture_payment',
|
136 |
+
order_id : wpsc.log_id,
|
137 |
+
nonce : wpsc.purchase_log_capture_payment_nonce
|
138 |
+
};
|
139 |
+
|
140 |
+
var ajax_callback = function( response ) {
|
141 |
+
$spinner.removeClass( 'is-active' );
|
142 |
if ( ! response.is_successful ) {
|
143 |
if ( response.error ) {
|
144 |
window.alert( response.error.messages.join( BR ) );
|
145 |
}
|
146 |
+
} else {
|
147 |
+
setTimeout( function() {
|
148 |
+
// Re-spinner while we refresh page.
|
149 |
+
$spinner.addClass( 'is-active' );
|
150 |
+
}, 900 );
|
151 |
|
152 |
+
window.location.href = window.location.href;
|
153 |
}
|
|
|
154 |
};
|
155 |
|
156 |
+
$spinner.addClass( 'is-active' );
|
157 |
|
158 |
$.wpsc_post( data, ajax_callback );
|
159 |
};
|
wpsc-admin/js/settings-page.js
CHANGED
@@ -1051,6 +1051,7 @@
|
|
1051 |
$( '#gateway_settings_' + payment_gateway_id + '_form' ).remove();
|
1052 |
$( '#wpsc_gateway_settings_'+ payment_gateway_id ).show( 400 );
|
1053 |
$( '#wpsc_gateway_settings_'+ payment_gateway_id + '_container' ).append(response.obj.content);
|
|
|
1054 |
};
|
1055 |
|
1056 |
if ( $( '#gateway_settings_' + payment_gateway_id + '_form' ).is( ':visible' ) ) {
|
1051 |
$( '#gateway_settings_' + payment_gateway_id + '_form' ).remove();
|
1052 |
$( '#wpsc_gateway_settings_'+ payment_gateway_id ).show( 400 );
|
1053 |
$( '#wpsc_gateway_settings_'+ payment_gateway_id + '_container' ).append(response.obj.content);
|
1054 |
+
$( document.body ).trigger( 'wpsc-payment-gateway-settings-form-loaded', response );
|
1055 |
};
|
1056 |
|
1057 |
if ( $( '#gateway_settings_' + payment_gateway_id + '_form' ).is( ':visible' ) ) {
|
wpsc-components/marketplace-core-v1/library/Sputnik.php
CHANGED
@@ -295,7 +295,7 @@ class Sputnik {
|
|
295 |
*/
|
296 |
public static function push_sales_data( $purchase_log_id, $current_status, $old_status, $purchase_log ) {
|
297 |
|
298 |
-
$purchase_log =
|
299 |
|
300 |
$id = absint( $purchase_log->get( 'id' ) );
|
301 |
|
@@ -343,7 +343,7 @@ class Sputnik {
|
|
343 |
|
344 |
unset( $data['id'] );
|
345 |
|
346 |
-
$purchase_log =
|
347 |
$purchase_log->save();
|
348 |
$purchase_log_id = $purchase_log->get( 'id' );
|
349 |
|
295 |
*/
|
296 |
public static function push_sales_data( $purchase_log_id, $current_status, $old_status, $purchase_log ) {
|
297 |
|
298 |
+
$purchase_log = wpsc_get_order( $purchase_log_id );
|
299 |
|
300 |
$id = absint( $purchase_log->get( 'id' ) );
|
301 |
|
343 |
|
344 |
unset( $data['id'] );
|
345 |
|
346 |
+
$purchase_log = wpsc_get_order( $data );
|
347 |
$purchase_log->save();
|
348 |
$purchase_log_id = $purchase_log->get( 'id' );
|
349 |
|
wpsc-components/merchant-core-v2/helpers/checkout.php
CHANGED
@@ -30,19 +30,25 @@ function _wpsc_filter_merchant_v2_get_gateway_list() {
|
|
30 |
<label><input type="radio" value="<?php echo wpsc_gateway_internal_name(); ?>" <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway" />
|
31 |
<?php if ( ! empty( $gateway_name ) ) { ?>
|
32 |
<span class="custom_gateway_name"><?php echo $gateway_name; ?></span>
|
33 |
-
<?php }
|
34 |
-
|
35 |
if ( wpsc_show_gateway_image() ) :
|
36 |
$gateway_image = '<img src="' . esc_url( wpsc_gateway_image_url() ) . '" alt="' . esc_attr( $gateway_name ) . '" class="custom_gateway_image" />';
|
37 |
echo apply_filters( 'wpsc_gateway_image', $gateway_image, wpsc_gateway_internal_name() );
|
38 |
endif;
|
|
|
|
|
39 |
?>
|
|
|
40 |
</label>
|
41 |
<?php if ( wpsc_gateway_form_fields() ) : ?>
|
42 |
<table class="wpsc_checkout_table <?php echo wpsc_gateway_form_field_style(); ?>">
|
43 |
<?php echo wpsc_gateway_form_fields(); ?>
|
44 |
</table>
|
45 |
-
<?php
|
|
|
|
|
|
|
46 |
</div>
|
47 |
<?php
|
48 |
endwhile;
|
30 |
<label><input type="radio" value="<?php echo wpsc_gateway_internal_name(); ?>" <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway" />
|
31 |
<?php if ( ! empty( $gateway_name ) ) { ?>
|
32 |
<span class="custom_gateway_name"><?php echo $gateway_name; ?></span>
|
33 |
+
<?php }
|
34 |
+
|
35 |
if ( wpsc_show_gateway_image() ) :
|
36 |
$gateway_image = '<img src="' . esc_url( wpsc_gateway_image_url() ) . '" alt="' . esc_attr( $gateway_name ) . '" class="custom_gateway_image" />';
|
37 |
echo apply_filters( 'wpsc_gateway_image', $gateway_image, wpsc_gateway_internal_name() );
|
38 |
endif;
|
39 |
+
|
40 |
+
do_action( 'wpsc_gateway_v2_inside_gateway_label', wpsc_gateway_internal_name() );
|
41 |
?>
|
42 |
+
|
43 |
</label>
|
44 |
<?php if ( wpsc_gateway_form_fields() ) : ?>
|
45 |
<table class="wpsc_checkout_table <?php echo wpsc_gateway_form_field_style(); ?>">
|
46 |
<?php echo wpsc_gateway_form_fields(); ?>
|
47 |
</table>
|
48 |
+
<?php
|
49 |
+
endif;
|
50 |
+
do_action( 'wpsc_gateway_v2_inside_gateway_div', wpsc_gateway_internal_name() );
|
51 |
+
?>
|
52 |
</div>
|
53 |
<?php
|
54 |
endwhile;
|
wpsc-components/merchant-core-v3/classes/payment-gateway.php
CHANGED
@@ -239,15 +239,6 @@ final class WPSC_Payment_Gateways {
|
|
239 |
require_once $file;
|
240 |
}
|
241 |
|
242 |
-
if ( is_callable( array( $classname, 'load' ) ) && ! call_user_func( array( $classname, 'load' ) ) ) {
|
243 |
-
|
244 |
-
self::unregister_file( $filename );
|
245 |
-
|
246 |
-
$error = new WP_Error( 'wpsc-payment', __( 'Error', 'wp-e-commerce' ) );
|
247 |
-
|
248 |
-
return $error;
|
249 |
-
}
|
250 |
-
|
251 |
$meta = array(
|
252 |
'class' => $classname,
|
253 |
'path' => $file,
|
@@ -260,6 +251,14 @@ final class WPSC_Payment_Gateways {
|
|
260 |
return $gateway;
|
261 |
}
|
262 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
$meta['name'] = $gateway->get_title();
|
264 |
$meta['image'] = $gateway->get_image_url();
|
265 |
$meta['mark'] = $gateway->get_mark_html();
|
@@ -356,7 +355,7 @@ final class WPSC_Payment_Gateways {
|
|
356 |
* Initialize the Active Gateways
|
357 |
*
|
358 |
* @access public
|
359 |
-
* @since
|
360 |
*
|
361 |
* @return void
|
362 |
*/
|
@@ -380,7 +379,7 @@ final class WPSC_Payment_Gateways {
|
|
380 |
*
|
381 |
* @link http://www.currency-iso.org/dam/downloads/table_a1.xml
|
382 |
*
|
383 |
-
* @since
|
384 |
*
|
385 |
* @return array Currency ISO codes that do not use fractions.
|
386 |
*/
|
@@ -417,7 +416,7 @@ final class WPSC_Payment_Gateways {
|
|
417 |
*
|
418 |
* MC (monaco) and IM (Isle of Man, part of UK) also use VAT.
|
419 |
*
|
420 |
-
* @since
|
421 |
* @param $type Type of countries to retrieve. Blank for EU member countries. eu_vat for EU VAT countries.
|
422 |
* @return string[]
|
423 |
*/
|
@@ -545,7 +544,7 @@ abstract class WPSC_Payment_Gateway {
|
|
545 |
*
|
546 |
* @param string $feature string The name of a feature to test support for.
|
547 |
* @return bool True if the gateway supports the feature, false otherwise.
|
548 |
-
* @since
|
549 |
*/
|
550 |
public function supports( $feature ) {
|
551 |
return apply_filters( 'wpsc_payment_gateway_supports', in_array( $feature, $this->supports ) ? true : false, $feature, $this );
|
@@ -745,27 +744,46 @@ abstract class WPSC_Payment_Gateway {
|
|
745 |
* You should use this function for hooks with actions and filters that are required by the gateway.
|
746 |
*
|
747 |
* @access public
|
748 |
-
* @since
|
749 |
*
|
750 |
* @return void
|
751 |
*/
|
752 |
public function init() {}
|
753 |
|
|
|
|
|
|
|
|
|
754 |
/**
|
755 |
* Process refund
|
756 |
*
|
757 |
* If the gateway declares 'refunds' support, this will allow it to refund
|
758 |
* a passed in amount.
|
759 |
*
|
760 |
-
* @param int
|
761 |
* @param float $amount
|
762 |
* @param string $reason
|
763 |
* @param boolean $manual If refund is a manual refund.
|
764 |
*
|
765 |
-
* @since
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
766 |
* @return bool|WP_Error True or false based on success, or a WP_Error object
|
767 |
*/
|
768 |
-
public function
|
769 |
return false;
|
770 |
}
|
771 |
}
|
239 |
require_once $file;
|
240 |
}
|
241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
$meta = array(
|
243 |
'class' => $classname,
|
244 |
'path' => $file,
|
251 |
return $gateway;
|
252 |
}
|
253 |
|
254 |
+
if ( ! $gateway->load() ) {
|
255 |
+
self::unregister_file( $filename );
|
256 |
+
|
257 |
+
$error = new WP_Error( 'wpsc-payment', __( 'Error', 'wp-e-commerce' ) );
|
258 |
+
|
259 |
+
return $error;
|
260 |
+
}
|
261 |
+
|
262 |
$meta['name'] = $gateway->get_title();
|
263 |
$meta['image'] = $gateway->get_image_url();
|
264 |
$meta['mark'] = $gateway->get_mark_html();
|
355 |
* Initialize the Active Gateways
|
356 |
*
|
357 |
* @access public
|
358 |
+
* @since 3.9.0
|
359 |
*
|
360 |
* @return void
|
361 |
*/
|
379 |
*
|
380 |
* @link http://www.currency-iso.org/dam/downloads/table_a1.xml
|
381 |
*
|
382 |
+
* @since 3.9.0
|
383 |
*
|
384 |
* @return array Currency ISO codes that do not use fractions.
|
385 |
*/
|
416 |
*
|
417 |
* MC (monaco) and IM (Isle of Man, part of UK) also use VAT.
|
418 |
*
|
419 |
+
* @since 3.9.0
|
420 |
* @param $type Type of countries to retrieve. Blank for EU member countries. eu_vat for EU VAT countries.
|
421 |
* @return string[]
|
422 |
*/
|
544 |
*
|
545 |
* @param string $feature string The name of a feature to test support for.
|
546 |
* @return bool True if the gateway supports the feature, false otherwise.
|
547 |
+
* @since 3.9.0
|
548 |
*/
|
549 |
public function supports( $feature ) {
|
550 |
return apply_filters( 'wpsc_payment_gateway_supports', in_array( $feature, $this->supports ) ? true : false, $feature, $this );
|
744 |
* You should use this function for hooks with actions and filters that are required by the gateway.
|
745 |
*
|
746 |
* @access public
|
747 |
+
* @since 3.9.0
|
748 |
*
|
749 |
* @return void
|
750 |
*/
|
751 |
public function init() {}
|
752 |
|
753 |
+
public function load() {
|
754 |
+
return true;
|
755 |
+
}
|
756 |
+
|
757 |
/**
|
758 |
* Process refund
|
759 |
*
|
760 |
* If the gateway declares 'refunds' support, this will allow it to refund
|
761 |
* a passed in amount.
|
762 |
*
|
763 |
+
* @param int $purchase_log The WPSC_Purchase_Log object.
|
764 |
* @param float $amount
|
765 |
* @param string $reason
|
766 |
* @param boolean $manual If refund is a manual refund.
|
767 |
*
|
768 |
+
* @since 3.9.0
|
769 |
+
* @return bool|WP_Error True or false based on success, or a WP_Error object
|
770 |
+
*/
|
771 |
+
public function process_refund( $purchase_log, $amount = 0.00, $reason = '', $manual = false ) {
|
772 |
+
return false;
|
773 |
+
}
|
774 |
+
|
775 |
+
/**
|
776 |
+
* Capture Payment
|
777 |
+
*
|
778 |
+
* If the gateway declares 'auth-capture' or 'partial-refunds' support,
|
779 |
+
* this allows a previously authorized payment to be captured.
|
780 |
+
*
|
781 |
+
* @param int $purchase_log The WPSC_Purchase_Log object.
|
782 |
+
*
|
783 |
+
* @since 3.12.0
|
784 |
* @return bool|WP_Error True or false based on success, or a WP_Error object
|
785 |
*/
|
786 |
+
public function capture_payment( $purchase_log, $transaction_id ) {
|
787 |
return false;
|
788 |
}
|
789 |
}
|
wpsc-components/merchant-core-v3/gateways/amazon-payments.php
CHANGED
@@ -36,9 +36,16 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
36 |
private $user_is_authenticated = false;
|
37 |
|
38 |
public function __construct() {
|
39 |
-
|
40 |
parent::__construct();
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
$this->title = __( 'Amazon Payments', 'wp-e-commerce' );
|
43 |
|
44 |
$this->reference_id = ! empty( $_REQUEST['amazon_reference_id'] ) ? sanitize_text_field( $_REQUEST['amazon_reference_id'] ) : '';
|
@@ -49,14 +56,6 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
49 |
|
50 |
add_action( 'init', array( $this->order_handler, 'process_ipn' ) );
|
51 |
|
52 |
-
// Define user set variables
|
53 |
-
$this->seller_id = $this->setting->get( 'seller_id' );
|
54 |
-
$this->mws_access_key = $this->setting->get( 'mws_access_key' );
|
55 |
-
$this->secret_key = $this->setting->get( 'secret_key' );
|
56 |
-
$this->sandbox = $this->setting->get( 'sandbox_mode' ) == '1' ? true : false;
|
57 |
-
$this->payment_capture = $this->setting->get( 'payment_capture' ) !== null ? $this->setting->get( 'payment_capture' ) : '';
|
58 |
-
$this->client_id = $this->setting->get( 'client_id' );
|
59 |
-
|
60 |
$base_country = new WPSC_Country( wpsc_get_base_country() );
|
61 |
|
62 |
// Get endpoint
|
@@ -105,7 +104,7 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
105 |
*
|
106 |
* @return bool Whether or not to load gateway.
|
107 |
*/
|
108 |
-
public
|
109 |
return version_compare( phpversion(), '5.3', '>=' ) && function_exists( 'curl_init' ) && function_exists( '_wpsc_get_current_controller' );
|
110 |
}
|
111 |
|
@@ -114,7 +113,7 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
114 |
*
|
115 |
* @access public
|
116 |
*
|
117 |
-
* @since
|
118 |
*
|
119 |
* @return void
|
120 |
*/
|
@@ -382,7 +381,7 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
382 |
*
|
383 |
* If it is declined for any other reason, they're basically out of luck.
|
384 |
*
|
385 |
-
* @since
|
386 |
*
|
387 |
* @param WPSC_Purchase_Log $order Current purchase log for transaction.
|
388 |
* @return void
|
@@ -412,7 +411,7 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
412 |
* @param array $buyer Buyer information
|
413 |
* @param array $address Shipping information
|
414 |
*
|
415 |
-
* @since
|
416 |
*/
|
417 |
private function set_customer_address( $buyer, $address ) {
|
418 |
|
@@ -480,7 +479,7 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
480 |
/**
|
481 |
* Maybe hide standard checkout button on the cart, if enabled
|
482 |
*
|
483 |
-
* @since
|
484 |
*/
|
485 |
public function maybe_hide_standard_checkout_button() {
|
486 |
if ( $this->setting->get( 'hide_button_display' ) ) {
|
@@ -498,7 +497,7 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
498 |
* Load handlers for cart and orders after cart is loaded.
|
499 |
*/
|
500 |
public function init() {
|
501 |
-
|
502 |
// Disable if no seller ID
|
503 |
if ( empty( $this->seller_id ) ) {
|
504 |
return;
|
@@ -637,7 +636,7 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
637 |
* Retrieve the IPN URL for Amazon
|
638 |
*
|
639 |
* @access public
|
640 |
-
* @since
|
641 |
* @return string
|
642 |
*/
|
643 |
private function get_amazon_ipn_url() {
|
@@ -785,7 +784,7 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
785 |
*
|
786 |
* This function primarily effects TEv1
|
787 |
*
|
788 |
-
* @since
|
789 |
*/
|
790 |
public function remove_gateways() {
|
791 |
|
@@ -797,7 +796,7 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
|
|
797 |
*
|
798 |
* This function effects TEv2.
|
799 |
*
|
800 |
-
* @since
|
801 |
*/
|
802 |
public function remove_gateways_v2( $fields ) {
|
803 |
foreach ( $fields as $i => $field ) {
|
@@ -1570,7 +1569,7 @@ class WPSC_Amazon_Payments_Order_Handler {
|
|
1570 |
* Process IPN messages from Amazon
|
1571 |
*
|
1572 |
* @access public
|
1573 |
-
* @since
|
1574 |
* @return void
|
1575 |
*/
|
1576 |
public function process_ipn() {
|
@@ -1667,7 +1666,7 @@ class WPSC_Amazon_Payments_Order_Handler {
|
|
1667 |
*
|
1668 |
* Templates are named by language and type.
|
1669 |
*
|
1670 |
-
* @since
|
1671 |
*
|
1672 |
* @param boolean $hard Whether it was a hard decline (invalid payment) or soft (systems).
|
1673 |
* @return boolean $mail Whether or not email was sent.
|
@@ -1715,7 +1714,7 @@ class WPSC_Amazon_Payments_Order_Handler {
|
|
1715 |
/**
|
1716 |
* Retrieves the email template path (and subject) for declined email notifications.
|
1717 |
*
|
1718 |
-
* @since
|
1719 |
* @param boolean $hard Whether or not decline is "hard". Hard declined methods may not be retried.
|
1720 |
*
|
1721 |
* @return array<string> Array of template part path and subject line.
|
@@ -1855,4 +1854,4 @@ class WPSC_Amazon_Payments_Order_Handler {
|
|
1855 |
}
|
1856 |
}
|
1857 |
}
|
1858 |
-
}
|
36 |
private $user_is_authenticated = false;
|
37 |
|
38 |
public function __construct() {
|
|
|
39 |
parent::__construct();
|
40 |
|
41 |
+
// Define user set variables
|
42 |
+
$this->seller_id = $this->setting->get( 'seller_id' );
|
43 |
+
$this->mws_access_key = $this->setting->get( 'mws_access_key' );
|
44 |
+
$this->secret_key = $this->setting->get( 'secret_key' );
|
45 |
+
$this->sandbox = $this->setting->get( 'sandbox_mode' ) == '1' ? true : false;
|
46 |
+
$this->payment_capture = $this->setting->get( 'payment_capture' ) !== null ? $this->setting->get( 'payment_capture' ) : '';
|
47 |
+
$this->client_id = $this->setting->get( 'client_id' );
|
48 |
+
|
49 |
$this->title = __( 'Amazon Payments', 'wp-e-commerce' );
|
50 |
|
51 |
$this->reference_id = ! empty( $_REQUEST['amazon_reference_id'] ) ? sanitize_text_field( $_REQUEST['amazon_reference_id'] ) : '';
|
56 |
|
57 |
add_action( 'init', array( $this->order_handler, 'process_ipn' ) );
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
$base_country = new WPSC_Country( wpsc_get_base_country() );
|
60 |
|
61 |
// Get endpoint
|
104 |
*
|
105 |
* @return bool Whether or not to load gateway.
|
106 |
*/
|
107 |
+
public function load() {
|
108 |
return version_compare( phpversion(), '5.3', '>=' ) && function_exists( 'curl_init' ) && function_exists( '_wpsc_get_current_controller' );
|
109 |
}
|
110 |
|
113 |
*
|
114 |
* @access public
|
115 |
*
|
116 |
+
* @since 3.11.0
|
117 |
*
|
118 |
* @return void
|
119 |
*/
|
381 |
*
|
382 |
* If it is declined for any other reason, they're basically out of luck.
|
383 |
*
|
384 |
+
* @since 3.11.0
|
385 |
*
|
386 |
* @param WPSC_Purchase_Log $order Current purchase log for transaction.
|
387 |
* @return void
|
411 |
* @param array $buyer Buyer information
|
412 |
* @param array $address Shipping information
|
413 |
*
|
414 |
+
* @since 3.11.0
|
415 |
*/
|
416 |
private function set_customer_address( $buyer, $address ) {
|
417 |
|
479 |
/**
|
480 |
* Maybe hide standard checkout button on the cart, if enabled
|
481 |
*
|
482 |
+
* @since 3.11.0
|
483 |
*/
|
484 |
public function maybe_hide_standard_checkout_button() {
|
485 |
if ( $this->setting->get( 'hide_button_display' ) ) {
|
497 |
* Load handlers for cart and orders after cart is loaded.
|
498 |
*/
|
499 |
public function init() {
|
500 |
+
parent::init();
|
501 |
// Disable if no seller ID
|
502 |
if ( empty( $this->seller_id ) ) {
|
503 |
return;
|
636 |
* Retrieve the IPN URL for Amazon
|
637 |
*
|
638 |
* @access public
|
639 |
+
* @since 3.11.0
|
640 |
* @return string
|
641 |
*/
|
642 |
private function get_amazon_ipn_url() {
|
784 |
*
|
785 |
* This function primarily effects TEv1
|
786 |
*
|
787 |
+
* @since 3.11.0
|
788 |
*/
|
789 |
public function remove_gateways() {
|
790 |
|
796 |
*
|
797 |
* This function effects TEv2.
|
798 |
*
|
799 |
+
* @since 3.11.0
|
800 |
*/
|
801 |
public function remove_gateways_v2( $fields ) {
|
802 |
foreach ( $fields as $i => $field ) {
|
1569 |
* Process IPN messages from Amazon
|
1570 |
*
|
1571 |
* @access public
|
1572 |
+
* @since 3.11.0
|
1573 |
* @return void
|
1574 |
*/
|
1575 |
public function process_ipn() {
|
1666 |
*
|
1667 |
* Templates are named by language and type.
|
1668 |
*
|
1669 |
+
* @since 3.11.0
|
1670 |
*
|
1671 |
* @param boolean $hard Whether it was a hard decline (invalid payment) or soft (systems).
|
1672 |
* @return boolean $mail Whether or not email was sent.
|
1714 |
/**
|
1715 |
* Retrieves the email template path (and subject) for declined email notifications.
|
1716 |
*
|
1717 |
+
* @since 3.11.0
|
1718 |
* @param boolean $hard Whether or not decline is "hard". Hard declined methods may not be retried.
|
1719 |
*
|
1720 |
* @return array<string> Array of template part path and subject line.
|
1854 |
}
|
1855 |
}
|
1856 |
}
|
1857 |
+
}
|
wpsc-components/merchant-core-v3/gateways/manual.php
CHANGED
@@ -8,9 +8,10 @@ class WPSC_Payment_Gateway_Manual extends WPSC_Payment_Gateway {
|
|
8 |
* @since 3.9
|
9 |
*/
|
10 |
public function __construct() {
|
11 |
-
parent::__construct();
|
12 |
$this->title = __( 'Manual Payment Gateway 3.0', 'wp-e-commerce' );
|
13 |
-
|
|
|
|
|
14 |
|
15 |
/**
|
16 |
* Displays the setup form
|
@@ -43,4 +44,4 @@ class WPSC_Payment_Gateway_Manual extends WPSC_Payment_Gateway {
|
|
43 |
$this->purchase_log->set( 'processed', WPSC_PAYMENT_STATUS_RECEIVED )->save();
|
44 |
$this->go_to_transaction_results();
|
45 |
}
|
46 |
-
}
|
8 |
* @since 3.9
|
9 |
*/
|
10 |
public function __construct() {
|
|
|
11 |
$this->title = __( 'Manual Payment Gateway 3.0', 'wp-e-commerce' );
|
12 |
+
|
13 |
+
parent::__construct();
|
14 |
+
}
|
15 |
|
16 |
/**
|
17 |
* Displays the setup form
|
44 |
$this->purchase_log->set( 'processed', WPSC_PAYMENT_STATUS_RECEIVED )->save();
|
45 |
$this->go_to_transaction_results();
|
46 |
}
|
47 |
+
}
|
wpsc-components/merchant-core-v3/gateways/paypal-digital-goods.php
CHANGED
@@ -15,7 +15,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
15 |
*
|
16 |
* @param array $options
|
17 |
*
|
18 |
-
* @since 3.9
|
19 |
*/
|
20 |
public function __construct( $options ) {
|
21 |
require_once( 'php-merchant/gateways/paypal-digital-goods.php' );
|
@@ -43,12 +43,12 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
43 |
* Run the gateway hooks
|
44 |
*
|
45 |
* @access public
|
46 |
-
* @since
|
47 |
*
|
48 |
* @return void
|
49 |
*/
|
50 |
public function init() {
|
51 |
-
|
52 |
// Disable default selection
|
53 |
add_filter(
|
54 |
'wpsc_payment_method_form_fields',
|
@@ -57,7 +57,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
57 |
|
58 |
// Load DG scripts and styles
|
59 |
add_action( 'wp_enqueue_scripts', array( 'WPSC_Payment_Gateway_Paypal_Digital_Goods', 'dg_script' ) );
|
60 |
-
|
61 |
// Express Checkout for DG Button
|
62 |
add_action( 'wpsc_cart_item_table_form_actions_left', array( $this, 'add_ecs_button' ), 2, 2 );
|
63 |
|
@@ -68,7 +68,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
68 |
/**
|
69 |
* Toggles Digital Goods option based on whether or not shipping is being used on the given cart.
|
70 |
*
|
71 |
-
* @since
|
72 |
*
|
73 |
* @param array $fields Payment method form fields
|
74 |
*
|
@@ -149,7 +149,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
149 |
*
|
150 |
* @return void
|
151 |
*
|
152 |
-
* @since 3.9
|
153 |
*/
|
154 |
public static function dg_script() {
|
155 |
$dg_loc = array(
|
@@ -174,7 +174,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
174 |
* No payment gateway is selected by default
|
175 |
*
|
176 |
* @access public
|
177 |
-
* @since 3.9
|
178 |
*
|
179 |
* @param array $fields
|
180 |
*
|
@@ -193,7 +193,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
193 |
*
|
194 |
* @return string
|
195 |
*
|
196 |
-
* @since 3.9
|
197 |
*/
|
198 |
protected function get_return_url() {
|
199 |
$redirect = add_query_arg( array(
|
@@ -211,7 +211,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
211 |
*
|
212 |
* @return void
|
213 |
*
|
214 |
-
* @since 3.9
|
215 |
*/
|
216 |
public function callback_return_url_redirect() {
|
217 |
// Session id
|
@@ -270,7 +270,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
270 |
*
|
271 |
* @return string
|
272 |
*
|
273 |
-
* @since 3.9
|
274 |
*/
|
275 |
protected function get_original_return_url( $session_id ) {
|
276 |
$transact_url = get_option( 'transact_url' );
|
@@ -298,7 +298,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
298 |
*
|
299 |
* @return string
|
300 |
*
|
301 |
-
* @since 3.9
|
302 |
*/
|
303 |
protected function get_cancel_url() {
|
304 |
$redirect = add_query_arg( array(
|
@@ -315,7 +315,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
315 |
*
|
316 |
* @return void
|
317 |
*
|
318 |
-
* @since 3.9
|
319 |
*/
|
320 |
public function callback_cancel_url_redirect() {
|
321 |
// Page Styles
|
@@ -356,7 +356,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
356 |
*
|
357 |
* @return string
|
358 |
*
|
359 |
-
* @since 3.9
|
360 |
*/
|
361 |
protected function get_original_cancel_url() {
|
362 |
return apply_filters( 'wpsc_paypal_digital_goods_cancel_url', $this->get_shopping_cart_payment_url() );
|
@@ -367,7 +367,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
367 |
*
|
368 |
* @return string
|
369 |
*
|
370 |
-
* @since 3.9
|
371 |
*/
|
372 |
protected function get_notify_url() {
|
373 |
$location = add_query_arg( array(
|
@@ -383,7 +383,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
383 |
*
|
384 |
* @return void
|
385 |
*
|
386 |
-
* @since 3.9
|
387 |
*/
|
388 |
public function callback_ipn() {
|
389 |
$ipn = new PHP_Merchant_Paypal_IPN( false, (bool) $this->setting->get( 'sandbox_mode', false ) );
|
@@ -418,7 +418,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
418 |
*
|
419 |
* @return null
|
420 |
*
|
421 |
-
* @since 3.9
|
422 |
*/
|
423 |
public function callback_confirm_transaction() {
|
424 |
|
@@ -434,7 +434,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
434 |
/**
|
435 |
* Process the transaction through the PayPal APIs
|
436 |
*
|
437 |
-
* @since 3.9
|
438 |
*/
|
439 |
public function callback_process_confirmed_payment() {
|
440 |
$args = array_map( 'urldecode', $_GET );
|
@@ -497,7 +497,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
497 |
*
|
498 |
* @return void
|
499 |
*
|
500 |
-
* @since 3.9
|
501 |
*/
|
502 |
public function callback_display_paypal_error_redirect() {
|
503 |
// Redirect Location
|
@@ -551,7 +551,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
551 |
/**
|
552 |
* Error Page Template
|
553 |
*
|
554 |
-
* @since 3.9
|
555 |
*/
|
556 |
public function filter_paypal_error_page() {
|
557 |
$errors = wpsc_get_customer_meta( 'paypal_express_checkout_errors' );
|
@@ -574,7 +574,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
574 |
/**
|
575 |
* Generic Error Page Template
|
576 |
*
|
577 |
-
* @since 3.9
|
578 |
*/
|
579 |
public function filter_generic_error_page() {
|
580 |
ob_start();
|
@@ -589,7 +589,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
589 |
/**
|
590 |
* Settings Form Template
|
591 |
*
|
592 |
-
* @since 3.9
|
593 |
*/
|
594 |
public function setup_form() {
|
595 |
$paypal_currency = $this->get_currency_code();
|
@@ -732,7 +732,7 @@ class WPSC_Payment_Gateway_Paypal_Digital_Goods extends WPSC_Payment_Gateway_Pay
|
|
732 |
* @param array $args
|
733 |
* @return void
|
734 |
*
|
735 |
-
* @since 3.9
|
736 |
*/
|
737 |
public function process( $args = array() ) {
|
738 |
$total = $this->convert( $this->purchase_log->get( 'totalprice' ) );
|
15 |
*
|
16 |
* @param array $options
|
17 |
*
|
18 |
+
* @since 3.9.0
|
19 |
*/
|
20 |
public function __construct( $options ) {
|
21 |
require_once( 'php-merchant/gateways/paypal-digital-goods.php' );
|
43 |
* Run the gateway hooks
|
44 |
*
|
45 |
* @access public
|
46 |
+
* @since 3.9.0
|
47 |
*
|
48 |
* @return void
|
49 |
*/
|
50 |
public function init() {
|
51 |
+
parent::init();
|
52 |
// Disable default selection
|
53 |
add_filter(
|
54 |
'wpsc_payment_method_form_fields',
|
57 |
|
58 |
// Load DG scripts and styles
|
59 |
add_action( 'wp_enqueue_scripts', array( 'WPSC_Payment_Gateway_Paypal_Digital_Goods', 'dg_script' ) );
|
60 |
+
|
61 |
// Express Checkout for DG Button
|
62 |
add_action( 'wpsc_cart_item_table_form_actions_left', array( $this, 'add_ecs_button' ), 2, 2 );
|
63 |
|
68 |
/**
|
69 |
* Toggles Digital Goods option based on whether or not shipping is being used on the given cart.
|
70 |
*
|
71 |
+
* @since 3.9.0
|
72 |
*
|
73 |
* @param array $fields Payment method form fields
|
74 |
*
|
149 |
*
|
150 |
* @return void
|
151 |
*
|
152 |
+
* @since 3.9.0
|
153 |
*/
|
154 |
public static function dg_script() {
|
155 |
$dg_loc = array(
|
174 |
* No payment gateway is selected by default
|
175 |
*
|
176 |
* @access public
|
177 |
+
* @since 3.9.0
|
178 |
*
|
179 |
* @param array $fields
|
180 |
*
|
193 |
*
|
194 |
* @return string
|
195 |
*
|
196 |
+
* @since 3.9.0
|
197 |
*/
|
198 |
protected function get_return_url() {
|
199 |
$redirect = add_query_arg( array(
|
211 |
*
|
212 |
* @return void
|
213 |
*
|
214 |
+
* @since 3.9.0
|
215 |
*/
|
216 |
public function callback_return_url_redirect() {
|
217 |
// Session id
|
270 |
*
|
271 |
* @return string
|
272 |
*
|
273 |
+
* @since 3.9.0
|
274 |
*/
|
275 |
protected function get_original_return_url( $session_id ) {
|
276 |
$transact_url = get_option( 'transact_url' );
|
298 |
*
|
299 |
* @return string
|
300 |
*
|
301 |
+
* @since 3.9.0
|
302 |
*/
|
303 |
protected function get_cancel_url() {
|
304 |
$redirect = add_query_arg( array(
|
315 |
*
|
316 |
* @return void
|
317 |
*
|
318 |
+
* @since 3.9.0
|
319 |
*/
|
320 |
public function callback_cancel_url_redirect() {
|
321 |
// Page Styles
|
356 |
*
|
357 |
* @return string
|
358 |
*
|
359 |
+
* @since 3.9.0
|
360 |
*/
|
361 |
protected function get_original_cancel_url() {
|
362 |
return apply_filters( 'wpsc_paypal_digital_goods_cancel_url', $this->get_shopping_cart_payment_url() );
|
367 |
*
|
368 |
* @return string
|
369 |
*
|
370 |
+
* @since 3.9.0
|
371 |
*/
|
372 |
protected function get_notify_url() {
|
373 |
$location = add_query_arg( array(
|
383 |
*
|
384 |
* @return void
|
385 |
*
|
386 |
+
* @since 3.9.0
|
387 |
*/
|
388 |
public function callback_ipn() {
|
389 |
$ipn = new PHP_Merchant_Paypal_IPN( false, (bool) $this->setting->get( 'sandbox_mode', false ) );
|
418 |
*
|
419 |
* @return null
|
420 |
*
|
421 |
+
* @since 3.9.0
|
422 |
*/
|
423 |
public function callback_confirm_transaction() {
|
424 |
|
434 |
/**
|
435 |
* Process the transaction through the PayPal APIs
|
436 |
*
|
437 |
+
* @since 3.9.0
|
438 |
*/
|
439 |
public function callback_process_confirmed_payment() {
|
440 |
$args = array_map( 'urldecode', $_GET );
|
497 |
*
|
498 |
* @return void
|
499 |
*
|
500 |
+
* @since 3.9.0
|
501 |
*/
|
502 |
public function callback_display_paypal_error_redirect() {
|
503 |
// Redirect Location
|
551 |
/**
|
552 |
* Error Page Template
|
553 |
*
|
554 |
+
* @since 3.9.0
|
555 |
*/
|
556 |
public function filter_paypal_error_page() {
|
557 |
$errors = wpsc_get_customer_meta( 'paypal_express_checkout_errors' );
|
574 |
/**
|
575 |
* Generic Error Page Template
|
576 |
*
|
577 |
+
* @since 3.9.0
|
578 |
*/
|
579 |
public function filter_generic_error_page() {
|
580 |
ob_start();
|
589 |
/**
|
590 |
* Settings Form Template
|
591 |
*
|
592 |
+
* @since 3.9.0
|
593 |
*/
|
594 |
public function setup_form() {
|
595 |
$paypal_currency = $this->get_currency_code();
|
732 |
* @param array $args
|
733 |
* @return void
|
734 |
*
|
735 |
+
* @since 3.9.0
|
736 |
*/
|
737 |
public function process( $args = array() ) {
|
738 |
$total = $this->convert( $this->purchase_log->get( 'totalprice' ) );
|
wpsc-components/merchant-core-v3/gateways/paypal-express-checkout.php
CHANGED
@@ -18,12 +18,12 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
18 |
* @param array $options
|
19 |
* @param bool $child
|
20 |
*
|
21 |
-
* @since 3.9
|
22 |
*/
|
23 |
public function __construct( $options, $child = false ) {
|
|
|
24 |
parent::__construct();
|
25 |
|
26 |
-
require_once( 'php-merchant/gateways/paypal-express-checkout.php' );
|
27 |
$this->gateway = new PHP_Merchant_Paypal_Express_Checkout( $options );
|
28 |
|
29 |
if ( ! $child ) {
|
@@ -59,7 +59,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
59 |
|
60 |
$is_cart = wpsc_is_theme_engine( '1.0' ) ? wpsc_is_checkout() : ( wpsc_is_checkout() || wpsc_is_cart() );
|
61 |
|
62 |
-
if ( $is_cart ) {
|
63 |
wp_register_script( 'ec-incontext', WPSC_URL . '/wpsc-components/merchant-core-v3/gateways/ec-incontext.js', '', null, true );
|
64 |
wp_localize_script( 'ec-incontext', 'wpec_ppic', array(
|
65 |
'mid' => esc_attr( $this->setting->get( 'api_merchantid' ) ),
|
@@ -216,11 +216,12 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
216 |
* Run the gateway hooks
|
217 |
*
|
218 |
* @access public
|
219 |
-
* @since
|
220 |
*
|
221 |
* @return void
|
222 |
*/
|
223 |
public function init() {
|
|
|
224 |
add_filter(
|
225 |
'wpsc_payment_method_form_fields',
|
226 |
array( 'WPSC_Payment_Gateway_Paypal_Express_Checkout', 'filter_unselect_default' ), 100 , 1
|
@@ -234,7 +235,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
234 |
* @param array $fields
|
235 |
* @return array
|
236 |
*
|
237 |
-
* @since 3.9
|
238 |
*/
|
239 |
public static function filter_unselect_default( $fields ) {
|
240 |
foreach ( $fields as $i => $field ) {
|
@@ -250,7 +251,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
250 |
* @access public
|
251 |
* @return string
|
252 |
*
|
253 |
-
* @since 3.9
|
254 |
*/
|
255 |
public function get_mark_html() {
|
256 |
$html = '<img src="https://www.paypalobjects.com/webstatic/mktg/logo/pp_cc_mark_37x23.jpg" border="0" alt="PayPal Logo">';
|
@@ -264,7 +265,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
264 |
* @param array $data Arguments to encode with the URL
|
265 |
* @return string
|
266 |
*
|
267 |
-
* @since 3.9
|
268 |
*/
|
269 |
public function get_redirect_url( $data = array() ) {
|
270 |
|
@@ -501,7 +502,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
501 |
$this->pull_paypal_details();
|
502 |
|
503 |
// If no Shipping is required, confirm the Transaction
|
504 |
-
if ( !wpsc_uses_shipping() ) {
|
505 |
$this->callback_confirm_transaction();
|
506 |
}
|
507 |
|
@@ -518,7 +519,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
518 |
*/
|
519 |
public function review_order_buyer_details( $output ) {
|
520 |
$payer = $this->paypal_data->get( 'payer' );
|
521 |
-
$output .= '<ul>';
|
522 |
$output .= '<li><strong>' . __( 'Email:', 'wp-e-commerce' ) . ' </strong>' . $payer->email . '</li>';
|
523 |
$output .= '<li><strong>' . __( 'First Name:', 'wp-e-commerce' ) . ' </strong>' . $payer->first_name . '</li>';
|
524 |
$output .= '<li><strong>' . __( 'Last Name:', 'wp-e-commerce' ) . ' </strong>' . $payer->last_name . '</li>';
|
@@ -534,12 +535,10 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
534 |
*/
|
535 |
public function review_order_shipping_details( $output ) {
|
536 |
$address = $this->paypal_data->get( 'shipping_address' );
|
537 |
-
$output .= '<ul>';
|
538 |
$output .= '<li>' . $address[ 'name' ] . '</li>';
|
539 |
$output .= '<li>' . $address[ 'street' ] . '</li>';
|
540 |
-
$output .= '<li>' . $address[ 'city' ] . '</li>';
|
541 |
-
$output .= '<li>' . $address[ 'state' ] . '</li>';
|
542 |
-
$output .= '<li>' . $address[ 'zip' ] . '</li>';
|
543 |
$output .= '<li>' . $address[ 'country_code' ] . '</li>';
|
544 |
$output .= '</ul>';
|
545 |
return $output;
|
@@ -550,7 +549,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
550 |
*
|
551 |
* @return bool
|
552 |
*
|
553 |
-
* @since 3.9
|
554 |
*/
|
555 |
public function callback_confirm_transaction() {
|
556 |
if ( ! isset( $_REQUEST['sessionid'] ) || ! isset( $_REQUEST['token'] ) || ! isset( $_REQUEST['PayerID'] ) ) {
|
@@ -571,7 +570,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
571 |
/**
|
572 |
* Process the transaction through the PayPal APIs
|
573 |
*
|
574 |
-
* @since 3.9
|
575 |
*/
|
576 |
public function do_transaction() {
|
577 |
$args = array_map( 'urldecode', $_GET );
|
@@ -753,7 +752,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
753 |
/**
|
754 |
* Error Page Template
|
755 |
*
|
756 |
-
* @since 3.9
|
757 |
*/
|
758 |
public function filter_paypal_error_page() {
|
759 |
$errors = wpsc_get_customer_meta( 'paypal_express_checkout_errors' );
|
@@ -776,7 +775,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
776 |
/**
|
777 |
* Generic Error Page Template
|
778 |
*
|
779 |
-
* @since 3.9
|
780 |
*/
|
781 |
public function filter_generic_error_page() {
|
782 |
ob_start();
|
@@ -791,7 +790,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
791 |
/**
|
792 |
* Settings Form Template
|
793 |
*
|
794 |
-
* @since 3.9
|
795 |
*/
|
796 |
public function setup_form() {
|
797 |
$paypal_currency = $this->get_currency_code();
|
@@ -951,7 +950,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
951 |
*
|
952 |
* @return bool
|
953 |
*
|
954 |
-
* @since 3.9
|
955 |
*/
|
956 |
protected function is_currency_supported() {
|
957 |
return in_array( parent::get_currency_code(), $this->gateway->get_supported_currencies() );
|
@@ -962,7 +961,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
962 |
*
|
963 |
* @return string
|
964 |
*
|
965 |
-
* @since 3.9
|
966 |
*/
|
967 |
public function get_currency_code() {
|
968 |
$code = parent::get_currency_code();
|
@@ -980,7 +979,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
980 |
*
|
981 |
* @return integer
|
982 |
*
|
983 |
-
* @since 3.9
|
984 |
*/
|
985 |
protected function convert( $amt ) {
|
986 |
if ( $this->is_currency_supported() ) {
|
@@ -995,7 +994,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
995 |
*
|
996 |
* @return void
|
997 |
*
|
998 |
-
* @since 3.9
|
999 |
*/
|
1000 |
public function process() {
|
1001 |
$total = $this->convert( $this->purchase_log->get( 'totalprice' ) );
|
@@ -1046,7 +1045,7 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
1046 |
* @param PHP_Merchant_Paypal_Express_Checkout_Response $response
|
1047 |
* @return void
|
1048 |
*
|
1049 |
-
* @since 3.9
|
1050 |
*/
|
1051 |
public function log_error( $response ) {
|
1052 |
if ( $this->setting->get( 'debugging' ) ) {
|
@@ -1070,13 +1069,13 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
1070 |
}
|
1071 |
}
|
1072 |
|
1073 |
-
public function process_refund( $
|
1074 |
|
1075 |
if ( 0.00 == $amount ) {
|
1076 |
return new WP_Error( 'paypal_refund_error', __( 'Refund Error: You need to specify a refund amount.', 'wp-e-commerce' ) );
|
1077 |
}
|
1078 |
|
1079 |
-
$log =
|
1080 |
|
1081 |
if ( ! $log->get( 'transactid' ) ) {
|
1082 |
return new WP_Error( 'error', __( 'Refund Failed: No transaction ID', 'wp-e-commerce' ) );
|
@@ -1090,9 +1089,15 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
1090 |
|
1091 |
if ( $manual ) {
|
1092 |
$current_refund = $log->get_total_refunded();
|
|
|
|
|
1093 |
$log->set( 'total_order_refunded' , $amount + $current_refund )->save();
|
1094 |
|
1095 |
-
|
|
|
|
|
|
|
|
|
1096 |
return true;
|
1097 |
}
|
1098 |
|
@@ -1125,11 +1130,16 @@ class WPSC_Payment_Gateway_Paypal_Express_Checkout extends WPSC_Payment_Gateway
|
|
1125 |
if ( 'Success' == $params['ACK'] || 'SuccessWithWarning' == $params['ACK'] ) {
|
1126 |
|
1127 |
$this->log_error( $response );
|
1128 |
-
|
1129 |
$current_refund = $log->get_total_refunded();
|
|
|
|
|
1130 |
$log->set( 'total_order_refunded' , $amount + $current_refund )->save();
|
1131 |
|
1132 |
-
|
|
|
|
|
|
|
1133 |
|
1134 |
return true;
|
1135 |
}
|
18 |
* @param array $options
|
19 |
* @param bool $child
|
20 |
*
|
21 |
+
* @since 3.9.0
|
22 |
*/
|
23 |
public function __construct( $options, $child = false ) {
|
24 |
+
require_once( 'php-merchant/gateways/paypal-express-checkout.php' );
|
25 |
parent::__construct();
|
26 |
|
|
|
27 |
$this->gateway = new PHP_Merchant_Paypal_Express_Checkout( $options );
|
28 |
|
29 |
if ( ! $child ) {
|
59 |
|
60 |
$is_cart = wpsc_is_theme_engine( '1.0' ) ? wpsc_is_checkout() : ( wpsc_is_checkout() || wpsc_is_cart() );
|
61 |
|
62 |
+
if ( $is_cart && wpsc_is_gateway_active( 'paypal-express-checkout' ) ) {
|
63 |
wp_register_script( 'ec-incontext', WPSC_URL . '/wpsc-components/merchant-core-v3/gateways/ec-incontext.js', '', null, true );
|
64 |
wp_localize_script( 'ec-incontext', 'wpec_ppic', array(
|
65 |
'mid' => esc_attr( $this->setting->get( 'api_merchantid' ) ),
|
216 |
* Run the gateway hooks
|
217 |
*
|
218 |
* @access public
|
219 |
+
* @since 3.9.0
|
220 |
*
|
221 |
* @return void
|
222 |
*/
|
223 |
public function init() {
|
224 |
+
parent::init();
|
225 |
add_filter(
|
226 |
'wpsc_payment_method_form_fields',
|
227 |
array( 'WPSC_Payment_Gateway_Paypal_Express_Checkout', 'filter_unselect_default' ), 100 , 1
|
235 |
* @param array $fields
|
236 |
* @return array
|
237 |
*
|
238 |
+
* @since 3.9.0
|
239 |
*/
|
240 |
public static function filter_unselect_default( $fields ) {
|
241 |
foreach ( $fields as $i => $field ) {
|
251 |
* @access public
|
252 |
* @return string
|
253 |
*
|
254 |
+
* @since 3.9.0
|
255 |
*/
|
256 |
public function get_mark_html() {
|
257 |
$html = '<img src="https://www.paypalobjects.com/webstatic/mktg/logo/pp_cc_mark_37x23.jpg" border="0" alt="PayPal Logo">';
|
265 |
* @param array $data Arguments to encode with the URL
|
266 |
* @return string
|
267 |
*
|
268 |
+
* @since 3.9.0
|
269 |
*/
|
270 |
public function get_redirect_url( $data = array() ) {
|
271 |
|
502 |
$this->pull_paypal_details();
|
503 |
|
504 |
// If no Shipping is required, confirm the Transaction
|
505 |
+
if ( ! wpsc_uses_shipping() ) {
|
506 |
$this->callback_confirm_transaction();
|
507 |
}
|
508 |
|
519 |
*/
|
520 |
public function review_order_buyer_details( $output ) {
|
521 |
$payer = $this->paypal_data->get( 'payer' );
|
522 |
+
$output .= '<ul class="wpsc-paypal wpsc-paypal-customer">';
|
523 |
$output .= '<li><strong>' . __( 'Email:', 'wp-e-commerce' ) . ' </strong>' . $payer->email . '</li>';
|
524 |
$output .= '<li><strong>' . __( 'First Name:', 'wp-e-commerce' ) . ' </strong>' . $payer->first_name . '</li>';
|
525 |
$output .= '<li><strong>' . __( 'Last Name:', 'wp-e-commerce' ) . ' </strong>' . $payer->last_name . '</li>';
|
535 |
*/
|
536 |
public function review_order_shipping_details( $output ) {
|
537 |
$address = $this->paypal_data->get( 'shipping_address' );
|
538 |
+
$output .= '<ul class="wpsc-paypal wpsc-paypal-customer-address">';
|
539 |
$output .= '<li>' . $address[ 'name' ] . '</li>';
|
540 |
$output .= '<li>' . $address[ 'street' ] . '</li>';
|
541 |
+
$output .= '<li>' . $address[ 'city' ] . ', ' . $address[ 'state' ] . ' ' . $address[ 'zip' ] . '</li>';
|
|
|
|
|
542 |
$output .= '<li>' . $address[ 'country_code' ] . '</li>';
|
543 |
$output .= '</ul>';
|
544 |
return $output;
|
549 |
*
|
550 |
* @return bool
|
551 |
*
|
552 |
+
* @since 3.9.0
|
553 |
*/
|
554 |
public function callback_confirm_transaction() {
|
555 |
if ( ! isset( $_REQUEST['sessionid'] ) || ! isset( $_REQUEST['token'] ) || ! isset( $_REQUEST['PayerID'] ) ) {
|
570 |
/**
|
571 |
* Process the transaction through the PayPal APIs
|
572 |
*
|
573 |
+
* @since 3.9.0
|
574 |
*/
|
575 |
public function do_transaction() {
|
576 |
$args = array_map( 'urldecode', $_GET );
|
752 |
/**
|
753 |
* Error Page Template
|
754 |
*
|
755 |
+
* @since 3.9.0
|
756 |
*/
|
757 |
public function filter_paypal_error_page() {
|
758 |
$errors = wpsc_get_customer_meta( 'paypal_express_checkout_errors' );
|
775 |
/**
|
776 |
* Generic Error Page Template
|
777 |
*
|
778 |
+
* @since 3.9.0
|
779 |
*/
|
780 |
public function filter_generic_error_page() {
|
781 |
ob_start();
|
790 |
/**
|
791 |
* Settings Form Template
|
792 |
*
|
793 |
+
* @since 3.9.0
|
794 |
*/
|
795 |
public function setup_form() {
|
796 |
$paypal_currency = $this->get_currency_code();
|
950 |
*
|
951 |
* @return bool
|
952 |
*
|
953 |
+
* @since 3.9.0
|
954 |
*/
|
955 |
protected function is_currency_supported() {
|
956 |
return in_array( parent::get_currency_code(), $this->gateway->get_supported_currencies() );
|
961 |
*
|
962 |
* @return string
|
963 |
*
|
964 |
+
* @since 3.9.0
|
965 |
*/
|
966 |
public function get_currency_code() {
|
967 |
$code = parent::get_currency_code();
|
979 |
*
|
980 |
* @return integer
|
981 |
*
|
982 |
+
* @since 3.9.0
|
983 |
*/
|
984 |
protected function convert( $amt ) {
|
985 |
if ( $this->is_currency_supported() ) {
|
994 |
*
|
995 |
* @return void
|
996 |
*
|
997 |
+
* @since 3.9.0
|
998 |
*/
|
999 |
public function process() {
|
1000 |
$total = $this->convert( $this->purchase_log->get( 'totalprice' ) );
|
1045 |
* @param PHP_Merchant_Paypal_Express_Checkout_Response $response
|
1046 |
* @return void
|
1047 |
*
|
1048 |
+
* @since 3.9.0
|
1049 |
*/
|
1050 |
public function log_error( $response ) {
|
1051 |
if ( $this->setting->get( 'debugging' ) ) {
|
1069 |
}
|
1070 |
}
|
1071 |
|
1072 |
+
public function process_refund( $log, $amount = 0.00, $reason = '', $manual = false ) {
|
1073 |
|
1074 |
if ( 0.00 == $amount ) {
|
1075 |
return new WP_Error( 'paypal_refund_error', __( 'Refund Error: You need to specify a refund amount.', 'wp-e-commerce' ) );
|
1076 |
}
|
1077 |
|
1078 |
+
$log = wpsc_get_order( $log );
|
1079 |
|
1080 |
if ( ! $log->get( 'transactid' ) ) {
|
1081 |
return new WP_Error( 'error', __( 'Refund Failed: No transaction ID', 'wp-e-commerce' ) );
|
1089 |
|
1090 |
if ( $manual ) {
|
1091 |
$current_refund = $log->get_total_refunded();
|
1092 |
+
|
1093 |
+
// Set a log meta entry, and save log before adding refund note.
|
1094 |
$log->set( 'total_order_refunded' , $amount + $current_refund )->save();
|
1095 |
|
1096 |
+
$log->add_refund_note(
|
1097 |
+
sprintf( __( 'Refunded %s via Manual Refund', 'wp-e-commerce' ), wpsc_currency_display( $amount ) ),
|
1098 |
+
$reason
|
1099 |
+
);
|
1100 |
+
|
1101 |
return true;
|
1102 |
}
|
1103 |
|
1130 |
if ( 'Success' == $params['ACK'] || 'SuccessWithWarning' == $params['ACK'] ) {
|
1131 |
|
1132 |
$this->log_error( $response );
|
1133 |
+
|
1134 |
$current_refund = $log->get_total_refunded();
|
1135 |
+
|
1136 |
+
// Set a log meta entry, and save log before adding refund note.
|
1137 |
$log->set( 'total_order_refunded' , $amount + $current_refund )->save();
|
1138 |
|
1139 |
+
$log->add_refund_note(
|
1140 |
+
sprintf( __( 'Refunded %s - Refund ID: %s', 'wp-e-commerce' ), wpsc_currency_display( $params['GROSSREFUNDAMT'] ), $params['REFUNDTRANSACTIONID'] ),
|
1141 |
+
$reason
|
1142 |
+
);
|
1143 |
|
1144 |
return true;
|
1145 |
}
|
wpsc-components/merchant-core-v3/gateways/paypal-pro.php
CHANGED
@@ -13,7 +13,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
13 |
* @param array $options
|
14 |
* @return void
|
15 |
*
|
16 |
-
* @since 3.9
|
17 |
*/
|
18 |
public function __construct( $options ) {
|
19 |
parent::__construct();
|
@@ -39,11 +39,12 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
39 |
* Run the gateway hooks
|
40 |
*
|
41 |
* @access public
|
42 |
-
|
43 |
*
|
44 |
* @return void
|
45 |
*/
|
46 |
public function init() {
|
|
|
47 |
// Load PayPal Pro JavaScript file
|
48 |
add_action( 'wp_enqueue_scripts', array( 'WPSC_Payment_Gateway_Paypal_Pro', 'pro_script' ) );
|
49 |
|
@@ -61,7 +62,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
61 |
* @param array $fields
|
62 |
* @return array
|
63 |
*
|
64 |
-
* @since 3.9
|
65 |
*/
|
66 |
public static function filter_unselect_default( $fields ) {
|
67 |
foreach ( $fields as $i=>$field ) {
|
@@ -76,7 +77,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
76 |
*
|
77 |
* @return void
|
78 |
*
|
79 |
-
* @since 3.9
|
80 |
*/
|
81 |
public static function pro_script() {
|
82 |
if ( wpsc_is_checkout() ) {
|
@@ -96,7 +97,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
96 |
* @access public
|
97 |
* @return string
|
98 |
*
|
99 |
-
* @since 3.9
|
100 |
*/
|
101 |
public function get_mark_html() {
|
102 |
$html = '<img src="' . WPSC_URL . '/images/cc.png" border="0" alt="' . esc_attr__( 'Credit Card Icons', 'wp-e-commerce' ) .'" />';
|
@@ -198,7 +199,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
198 |
*
|
199 |
* @return bool
|
200 |
*
|
201 |
-
* @since 3.9
|
202 |
*/
|
203 |
public function callback_confirm_transaction() {
|
204 |
if ( ! isset( $_REQUEST['sessionid'] ) || ! isset( $_REQUEST['tx'] ) ) {
|
@@ -215,7 +216,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
215 |
/**
|
216 |
* Process the transaction through the PayPal APIs
|
217 |
*
|
218 |
-
* @since 3.9
|
219 |
*/
|
220 |
public function do_transaction() {
|
221 |
$args = array_map( 'urldecode', $_GET );
|
@@ -335,7 +336,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
335 |
/**
|
336 |
* Error Page Template
|
337 |
*
|
338 |
-
* @since 3.9
|
339 |
*/
|
340 |
public function filter_paypal_error_page() {
|
341 |
$errors = wpsc_get_customer_meta( 'paypal_pro_errors' );
|
@@ -358,7 +359,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
358 |
/**
|
359 |
* Generic Error Page Template
|
360 |
*
|
361 |
-
* @since 3.9
|
362 |
*/
|
363 |
public function filter_generic_error_page() {
|
364 |
ob_start();
|
@@ -373,7 +374,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
373 |
/**
|
374 |
* Settings Form Template
|
375 |
*
|
376 |
-
* @since 3.9
|
377 |
*/
|
378 |
public function setup_form() {
|
379 |
$paypal_currency = $this->get_currency_code();
|
@@ -485,7 +486,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
485 |
*
|
486 |
* @return bool
|
487 |
*
|
488 |
-
* @since 3.9
|
489 |
*/
|
490 |
protected function is_currency_supported() {
|
491 |
return in_array( parent::get_currency_code(), $this->gateway->get_supported_currencies() );
|
@@ -496,7 +497,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
496 |
*
|
497 |
* @return string
|
498 |
*
|
499 |
-
* @since 3.9
|
500 |
*/
|
501 |
public function get_currency_code() {
|
502 |
$code = parent::get_currency_code();
|
@@ -514,7 +515,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
514 |
*
|
515 |
* @return integer
|
516 |
*
|
517 |
-
* @since 3.9
|
518 |
*/
|
519 |
protected function convert( $amt ) {
|
520 |
if ( $this->is_currency_supported() ) {
|
@@ -529,7 +530,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
529 |
*
|
530 |
* @return void
|
531 |
*
|
532 |
-
* @since 3.9
|
533 |
*/
|
534 |
public function process() {
|
535 |
$total = $this->convert( $this->purchase_log->get( 'totalprice' ) );
|
@@ -598,7 +599,7 @@ class WPSC_Payment_Gateway_Paypal_Pro extends WPSC_Payment_Gateway {
|
|
598 |
* @param PHP_Merchant_Paypal_Pro_Response $response
|
599 |
* @return void
|
600 |
*
|
601 |
-
* @since 3.9
|
602 |
*/
|
603 |
public function log_error( $response ) {
|
604 |
if ( $this->setting->get( 'debugging' ) ) {
|
13 |
* @param array $options
|
14 |
* @return void
|
15 |
*
|
16 |
+
* @since 3.9.0
|
17 |
*/
|
18 |
public function __construct( $options ) {
|
19 |
parent::__construct();
|
39 |
* Run the gateway hooks
|
40 |
*
|
41 |
* @access public
|
42 |
+
* @since 3.9.0
|
43 |
*
|
44 |
* @return void
|
45 |
*/
|
46 |
public function init() {
|
47 |
+
parent::init();
|
48 |
// Load PayPal Pro JavaScript file
|
49 |
add_action( 'wp_enqueue_scripts', array( 'WPSC_Payment_Gateway_Paypal_Pro', 'pro_script' ) );
|
50 |
|
62 |
* @param array $fields
|
63 |
* @return array
|
64 |
*
|
65 |
+
* @since 3.9.0
|
66 |
*/
|
67 |
public static function filter_unselect_default( $fields ) {
|
68 |
foreach ( $fields as $i=>$field ) {
|
77 |
*
|
78 |
* @return void
|
79 |
*
|
80 |
+
* @since 3.9.0
|
81 |
*/
|
82 |
public static function pro_script() {
|
83 |
if ( wpsc_is_checkout() ) {
|
97 |
* @access public
|
98 |
* @return string
|
99 |
*
|
100 |
+
* @since 3.9.0
|
101 |
*/
|
102 |
public function get_mark_html() {
|
103 |
$html = '<img src="' . WPSC_URL . '/images/cc.png" border="0" alt="' . esc_attr__( 'Credit Card Icons', 'wp-e-commerce' ) .'" />';
|
199 |
*
|
200 |
* @return bool
|
201 |
*
|
202 |
+
* @since 3.9.0
|
203 |
*/
|
204 |
public function callback_confirm_transaction() {
|
205 |
if ( ! isset( $_REQUEST['sessionid'] ) || ! isset( $_REQUEST['tx'] ) ) {
|
216 |
/**
|
217 |
* Process the transaction through the PayPal APIs
|
218 |
*
|
219 |
+
* @since 3.9.0
|
220 |
*/
|
221 |
public function do_transaction() {
|
222 |
$args = array_map( 'urldecode', $_GET );
|
336 |
/**
|
337 |
* Error Page Template
|
338 |
*
|
339 |
+
* @since 3.9.0
|
340 |
*/
|
341 |
public function filter_paypal_error_page() {
|
342 |
$errors = wpsc_get_customer_meta( 'paypal_pro_errors' );
|
359 |
/**
|
360 |
* Generic Error Page Template
|
361 |
*
|
362 |
+
* @since 3.9.0
|
363 |
*/
|
364 |
public function filter_generic_error_page() {
|
365 |
ob_start();
|
374 |
/**
|
375 |
* Settings Form Template
|
376 |
*
|
377 |
+
* @since 3.9.0
|
378 |
*/
|
379 |
public function setup_form() {
|
380 |
$paypal_currency = $this->get_currency_code();
|
486 |
*
|
487 |
* @return bool
|
488 |
*
|
489 |
+
* @since 3.9.0
|
490 |
*/
|
491 |
protected function is_currency_supported() {
|
492 |
return in_array( parent::get_currency_code(), $this->gateway->get_supported_currencies() );
|
497 |
*
|
498 |
* @return string
|
499 |
*
|
500 |
+
* @since 3.9.0
|
501 |
*/
|
502 |
public function get_currency_code() {
|
503 |
$code = parent::get_currency_code();
|
515 |
*
|
516 |
* @return integer
|
517 |
*
|
518 |
+
* @since 3.9.0
|
519 |
*/
|
520 |
protected function convert( $amt ) {
|
521 |
if ( $this->is_currency_supported() ) {
|
530 |
*
|
531 |
* @return void
|
532 |
*
|
533 |
+
* @since 3.9.0
|
534 |
*/
|
535 |
public function process() {
|
536 |
$total = $this->convert( $this->purchase_log->get( 'totalprice' ) );
|
599 |
* @param PHP_Merchant_Paypal_Pro_Response $response
|
600 |
* @return void
|
601 |
*
|
602 |
+
* @since 3.9.0
|
603 |
*/
|
604 |
public function log_error( $response ) {
|
605 |
if ( $this->setting->get( 'debugging' ) ) {
|
wpsc-components/merchant-core-v3/gateways/pro-pay.php
ADDED
@@ -0,0 +1,1164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @todo: Later, Create a nice user sign-up flow, as a part of an overall onboarding experience
|
4 |
+
* @todo: Later, integrate with subscriptions
|
5 |
+
* @todo: Later, support capturing a different amount than originally authorized.
|
6 |
+
* @todo: Abstract out config files, API objects, etc.
|
7 |
+
*/
|
8 |
+
class WPSC_Payment_Gateway_Pro_Pay extends WPSC_Payment_Gateway {
|
9 |
+
|
10 |
+
private static $endpoints = array(
|
11 |
+
// Posting URL for ProPay API real time processing
|
12 |
+
'account-creation-endpoint' => array(
|
13 |
+
'sandbox' => 'https://xmltest.propay.com/api/propayapi.aspx',
|
14 |
+
'production' => 'https://xml.propay.com/api/propayapi.aspx'
|
15 |
+
),
|
16 |
+
// (WSDL) URL for ProtectPay API (Calls preparatory to the PMI and for processing against a token once it is created)
|
17 |
+
'wsdl-endpoint' => array(
|
18 |
+
'sandbox' => 'https://xmltestapi.propay.com/api/sps.svc?wsdl',
|
19 |
+
'production' => 'https://xmlapi.propay.com/api/sps.svc?wsdl'
|
20 |
+
),
|
21 |
+
// URL for ProtectPay API (Calls preparatory to the PMI and for processing against a token once it is created)
|
22 |
+
'payment-processing-endpoint' => array(
|
23 |
+
'sandbox' => 'https://xmltestapi.propay.com/api/sps.svc',
|
24 |
+
'production' => 'https://xmlapi.propay.com/api/sps.svc'
|
25 |
+
),
|
26 |
+
// URL for ProtectPay PMI (tokenizing card numbers)
|
27 |
+
'tokenization-endpoint-num-only' => array(
|
28 |
+
'sandbox' => 'https://protectpaytest.propay.com/pmi/cardnumonly.aspx',
|
29 |
+
'production' => 'https://protectpay.propay.com/pmi/cardnumonly.aspx'
|
30 |
+
),
|
31 |
+
// URL for ProtectPay PMI (tokenizing cards)
|
32 |
+
'tokenization-endpoint' => array(
|
33 |
+
'sandbox' => 'https://protectpaytest.propay.com/pmi/spr.aspx',
|
34 |
+
'production' => 'https://protectpay.propay.com/pmi/spr.aspx'
|
35 |
+
),
|
36 |
+
// REST API endpoint
|
37 |
+
'rest-api-endpoint' => array(
|
38 |
+
'sandbox' => 'https://sb01api.propay.com/protectpay',
|
39 |
+
'production' => 'https://api.propay.com/protectpay',
|
40 |
+
)
|
41 |
+
);
|
42 |
+
|
43 |
+
private $payment_capture;
|
44 |
+
private $endpoint;
|
45 |
+
private $sandbox;
|
46 |
+
|
47 |
+
private $login_url = 'https://www.propay.com/?refid=WPECOMM';
|
48 |
+
private $auth_token = 'd30280d2-74de-4418-ab3f-0f58055ee421';
|
49 |
+
|
50 |
+
private $cert_string = '2df3f9620654ee8a52b5b6d411c760';
|
51 |
+
private $term_id = '5b6d411c760';
|
52 |
+
private $biller_account_id = '7929812732866007';
|
53 |
+
private $account_number = '';
|
54 |
+
private $merchant_profile_id = '';
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Constructor of ProPay Payment Gateway
|
58 |
+
*
|
59 |
+
* @access public
|
60 |
+
* @since 3.12.0
|
61 |
+
*/
|
62 |
+
public function __construct() {
|
63 |
+
|
64 |
+
parent::__construct();
|
65 |
+
|
66 |
+
$this->title = __( 'ProPay (TSYS) Payment Gateway', 'wp-e-commerce' );
|
67 |
+
$this->supports = array( 'tev1', 'refunds', 'partial-refunds', 'auth-capture' );
|
68 |
+
|
69 |
+
// Define user set variables
|
70 |
+
$this->account_number = $this->setting->get( 'account_number' );
|
71 |
+
$this->merchant_profile_id = $this->setting->get( 'merchant_profile_id' );
|
72 |
+
$this->sandbox = $this->setting->get( 'sandbox_mode' ) == '1' ? true : false;
|
73 |
+
$this->endpoint = $this->sandbox ? self::$endpoints['payment-processing-endpoint']['sandbox'] : self::$endpoints['payment-processing-endpoint']['production'];
|
74 |
+
$this->payment_capture = $this->setting->get( 'payment_capture' ) !== null ? $this->setting->get( 'payment_capture' ) : '';
|
75 |
+
|
76 |
+
$this->admin_scripts();
|
77 |
+
}
|
78 |
+
|
79 |
+
public function admin_scripts() {
|
80 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
|
81 |
+
}
|
82 |
+
|
83 |
+
public function init() {
|
84 |
+
|
85 |
+
parent::init();
|
86 |
+
|
87 |
+
add_action( 'wp_enqueue_scripts' , array( $this, 'checkout_scripts' ) );
|
88 |
+
add_action( 'wpsc_gateway_v2_inside_gateway_label', array( $this, 'add_spinner' ) );
|
89 |
+
add_action( 'wpsc_inside_shopping_cart' , array( $this, 'add_propay_iframe' ) );
|
90 |
+
|
91 |
+
add_action( 'wp_ajax_propay_create_merchant_profile_id' , array( $this, 'create_merchant_profile' ) );
|
92 |
+
|
93 |
+
add_action( 'wp_ajax_create_payer_id' , array( $this, 'create_payer_id' ) );
|
94 |
+
add_action( 'wp_ajax_nopriv_create_payer_id' , array( $this, 'create_payer_id' ) );
|
95 |
+
|
96 |
+
add_action( 'wp_ajax_create_hosted_transaction_id' , array( $this, 'create_hosted_transaction_id' ) );
|
97 |
+
add_action( 'wp_ajax_nopriv_create_hosted_transaction_id', array( $this, 'create_hosted_transaction_id' ) );
|
98 |
+
|
99 |
+
add_action( 'wp_ajax_create_hosted_results' , array( $this, 'create_hosted_results' ) );
|
100 |
+
add_action( 'wp_ajax_nopriv_create_hosted_results', array( $this, 'create_hosted_results' ) );
|
101 |
+
|
102 |
+
add_action( 'wpsc_get_form_output_after_form_fields', array( $this, 'add_propay_iframe' ) );
|
103 |
+
|
104 |
+
add_filter( 'wpsc_form_input_append_to_label', array( $this, 'tev2_pro_pay_spinner' ), 10, 2 );
|
105 |
+
}
|
106 |
+
|
107 |
+
public function tev2_pro_pay_spinner( $label, $atts ) {
|
108 |
+
$method = isset( $atts['name'] ) && 'wpsc_payment_method' === $atts['name'];
|
109 |
+
$pro_pay = isset( $atts['value'] ) && 'pro-pay' === $atts['value'];
|
110 |
+
|
111 |
+
if ( $method && $pro_pay ) {
|
112 |
+
ob_start();
|
113 |
+
|
114 |
+
$this->add_spinner( 'pro-pay' );
|
115 |
+
$spinner = ob_get_clean();
|
116 |
+
$label = $spinner . $label;
|
117 |
+
}
|
118 |
+
|
119 |
+
return $label;
|
120 |
+
}
|
121 |
+
|
122 |
+
public function add_propay_iframe( $r = '' ) {
|
123 |
+
|
124 |
+
$is_tev2_payment_page = ! empty( $r ) && 'wpsc-checkout-form' === $r['id'] && 'payment' === _wpsc_get_current_controller_slug();
|
125 |
+
$is_tev1_payment_page = empty( $r );
|
126 |
+
|
127 |
+
if ( ! $is_tev1_payment_page && ! $is_tev2_payment_page ) {
|
128 |
+
return;
|
129 |
+
}
|
130 |
+
$this->loader();
|
131 |
+
?>
|
132 |
+
<style>
|
133 |
+
.pro-pay-iframe {
|
134 |
+
height: 640px;
|
135 |
+
overflow:hidden;
|
136 |
+
border: none;
|
137 |
+
width: 100%;
|
138 |
+
background: url(<?php echo admin_url( 'images/spinner.gif' ) ?>) no-repeat 50% 50%;
|
139 |
+
}
|
140 |
+
|
141 |
+
.pro-pay-frame.loaded {
|
142 |
+
background: transparent;
|
143 |
+
}
|
144 |
+
|
145 |
+
</style>
|
146 |
+
<iframe scrolling="no" id="pro_pay_iframe" name="pro_pay_iframe" class="pro-pay-iframe"></iframe>
|
147 |
+
<?php if ( defined( 'WPSC_DEBUG' ) && WPSC_DEBUG ) : ?>
|
148 |
+
<div id="MessageLog" class="BrowserMessageBox"></div>
|
149 |
+
<div id="BrowserLog" class="BrowserMessageBox"></div>
|
150 |
+
<div id="ConsoleLog" class="BrowserMessageBox"></div>
|
151 |
+
<?php
|
152 |
+
endif;
|
153 |
+
}
|
154 |
+
|
155 |
+
public function loader() {
|
156 |
+
?>
|
157 |
+
<style>
|
158 |
+
.wpsc-purchase-loader-container {
|
159 |
+
position:absolute;
|
160 |
+
display: none;
|
161 |
+
}
|
162 |
+
|
163 |
+
.wpsc-purchase-loader {
|
164 |
+
position: absolute;
|
165 |
+
top: calc( 50% - 18px );
|
166 |
+
width: 100%;
|
167 |
+
}
|
168 |
+
|
169 |
+
.blob {
|
170 |
+
position: absolute;
|
171 |
+
left: 50%;
|
172 |
+
top: 18px;
|
173 |
+
width: 3px;
|
174 |
+
height: 3px;
|
175 |
+
border-radius: 1.5px;
|
176 |
+
background-color: #00ffeb;
|
177 |
+
content: "";
|
178 |
+
-webkit-filter: blur(1px);
|
179 |
+
filter: blur(1px);
|
180 |
+
-webkit-transform: translateY(-10px);
|
181 |
+
transform: translateY(-10px);
|
182 |
+
}
|
183 |
+
.blob:nth-child(1) {
|
184 |
+
-webkit-animation: spin 1.25s infinite ease-in-out;
|
185 |
+
animation: spin 1.25s infinite ease-in-out;
|
186 |
+
-webkit-animation-delay: 0.1s;
|
187 |
+
animation-delay: 0.1s;
|
188 |
+
}
|
189 |
+
.blob:nth-child(2) {
|
190 |
+
-webkit-animation: spin 1.25s infinite ease-in-out;
|
191 |
+
animation: spin 1.25s infinite ease-in-out;
|
192 |
+
-webkit-animation-delay: 0.2s;
|
193 |
+
animation-delay: 0.2s;
|
194 |
+
}
|
195 |
+
.blob:nth-child(3) {
|
196 |
+
-webkit-animation: spin 1.25s infinite ease-in-out;
|
197 |
+
animation: spin 1.25s infinite ease-in-out;
|
198 |
+
-webkit-animation-delay: 0.3s;
|
199 |
+
animation-delay: 0.3s;
|
200 |
+
}
|
201 |
+
.blob:nth-child(4) {
|
202 |
+
-webkit-animation: spin 1.25s infinite ease-in-out;
|
203 |
+
animation: spin 1.25s infinite ease-in-out;
|
204 |
+
-webkit-animation-delay: 0.4s;
|
205 |
+
animation-delay: 0.4s;
|
206 |
+
}
|
207 |
+
.blob:nth-child(5) {
|
208 |
+
-webkit-animation: spin 1.25s infinite ease-in-out;
|
209 |
+
animation: spin 1.25s infinite ease-in-out;
|
210 |
+
-webkit-animation-delay: 0.5s;
|
211 |
+
animation-delay: 0.5s;
|
212 |
+
}
|
213 |
+
.blob:nth-child(6) {
|
214 |
+
-webkit-animation: spin 1.25s infinite ease-in-out;
|
215 |
+
animation: spin 1.25s infinite ease-in-out;
|
216 |
+
-webkit-animation-delay: 0.6s;
|
217 |
+
animation-delay: 0.6s;
|
218 |
+
}
|
219 |
+
.blob:nth-child(7) {
|
220 |
+
-webkit-animation: spin 1.25s infinite ease-in-out;
|
221 |
+
animation: spin 1.25s infinite ease-in-out;
|
222 |
+
-webkit-animation-delay: 0.7s;
|
223 |
+
animation-delay: 0.7s;
|
224 |
+
}
|
225 |
+
|
226 |
+
@-webkit-keyframes spin {
|
227 |
+
0% {
|
228 |
+
-webkit-transform: rotate(0deg) translateY(-10px) rotate(0deg);
|
229 |
+
transform: rotate(0deg) translateY(-10px) rotate(0deg);
|
230 |
+
}
|
231 |
+
70% {
|
232 |
+
-webkit-transform: rotate(360deg) translateY(-10px) rotate(-360deg);
|
233 |
+
transform: rotate(360deg) translateY(-10px) rotate(-360deg);
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
@keyframes spin {
|
238 |
+
0% {
|
239 |
+
-webkit-transform: rotate(0deg) translateY(-10px) rotate(0deg);
|
240 |
+
transform: rotate(0deg) translateY(-10px) rotate(0deg);
|
241 |
+
}
|
242 |
+
70% {
|
243 |
+
-webkit-transform: rotate(360deg) translateY(-10px) rotate(-360deg);
|
244 |
+
transform: rotate(360deg) translateY(-10px) rotate(-360deg);
|
245 |
+
}
|
246 |
+
}
|
247 |
+
</style>
|
248 |
+
<div class='wpsc-purchase-loader-container'>
|
249 |
+
<div class='wpsc-purchase-loader'>
|
250 |
+
<div class='blob'></div>
|
251 |
+
<div class='blob'></div>
|
252 |
+
<div class='blob'></div>
|
253 |
+
<div class='blob'></div>
|
254 |
+
<div class='blob'></div>
|
255 |
+
<div class='blob'></div>
|
256 |
+
<div class='blob'></div>
|
257 |
+
</div>
|
258 |
+
</div>
|
259 |
+
<?php
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Currently only functional for US.
|
264 |
+
*
|
265 |
+
* @return [type] [description]
|
266 |
+
*/
|
267 |
+
public function load() {
|
268 |
+
return 'USD' === wpsc_get_currency_code() && 'US' === wpsc_get_base_country();
|
269 |
+
}
|
270 |
+
|
271 |
+
public function add_spinner( $gateway ) {
|
272 |
+
if ( 'pro-pay' !== $gateway ) {
|
273 |
+
return;
|
274 |
+
}
|
275 |
+
|
276 |
+
?>
|
277 |
+
<div class="spinner"></div>
|
278 |
+
<style>
|
279 |
+
.spinner {
|
280 |
+
background: url(<?php echo admin_url( 'images/spinner.gif' ) ?>) no-repeat;
|
281 |
+
-webkit-background-size: 20px 20px;
|
282 |
+
background-size: 20px 20px;
|
283 |
+
display: inline-block;
|
284 |
+
vertical-align: middle;
|
285 |
+
opacity: .7;
|
286 |
+
filter: alpha(opacity=70);
|
287 |
+
width: 20px;
|
288 |
+
height: 20px;
|
289 |
+
margin: 4px 10px 0;
|
290 |
+
display: none;
|
291 |
+
}
|
292 |
+
@media print, (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) {
|
293 |
+
.spinner {
|
294 |
+
background-image: url(<?php echo admin_url( 'images/spinner-2x.gif' ) ?>);
|
295 |
+
}
|
296 |
+
}
|
297 |
+
</style>
|
298 |
+
<?php
|
299 |
+
}
|
300 |
+
|
301 |
+
public function checkout_scripts() {
|
302 |
+
|
303 |
+
$is_cart = wpsc_is_theme_engine( '1.0' ) ? wpsc_is_checkout() : ( wpsc_is_checkout() || wpsc_is_cart() );
|
304 |
+
|
305 |
+
if ( $is_cart ) {
|
306 |
+
wp_enqueue_script( 'pro-pay-signal-r', WPSC_MERCHANT_V3_SDKS_URL . '/pro-pay/js/signal-r.js', array( 'jquery' ), WPSC_VERSION );
|
307 |
+
wp_enqueue_script( 'pro-pay-hpp', WPSC_MERCHANT_V3_SDKS_URL . '/pro-pay/js/hpp.js', array( 'jquery', 'pro-pay-signal-r' ), WPSC_VERSION );
|
308 |
+
wp_enqueue_script( 'pro-pay-js', WPSC_MERCHANT_V3_SDKS_URL . '/pro-pay/js/pro-pay-checkout.js', array( 'jquery', 'pro-pay-hpp' ), WPSC_VERSION );
|
309 |
+
|
310 |
+
wp_localize_script( 'pro-pay-hpp', 'WPSC_Pro_Pay_Checkout', array(
|
311 |
+
'checkout_nonce' => wp_create_nonce( 'checkout_nonce' ),
|
312 |
+
'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
|
313 |
+
'iframe_id' => 'pro_pay_iframe',
|
314 |
+
'base_uri' => $this->get_hpp_base_uri(),
|
315 |
+
'debug' => WPSC_DEBUG,
|
316 |
+
'checkout_data' => $this->get_checkout_details()
|
317 |
+
)
|
318 |
+
);
|
319 |
+
}
|
320 |
+
}
|
321 |
+
|
322 |
+
private function get_checkout_details() {
|
323 |
+
$details = wpsc_get_customer_meta( 'checkout_details' );
|
324 |
+
$checkout = WPSC_Checkout_Form::get();
|
325 |
+
|
326 |
+
return array(
|
327 |
+
'billingemail' => $details[ $checkout->get_field_id_by_unique_name( 'billingemail' ) ],
|
328 |
+
'billingfirstname' => $details[ $checkout->get_field_id_by_unique_name( 'billingfirstname' ) ],
|
329 |
+
'billinglastname' => $details[ $checkout->get_field_id_by_unique_name( 'billinglastname' ) ],
|
330 |
+
'billingaddress' => $details[ $checkout->get_field_id_by_unique_name( 'billingaddress' ) ],
|
331 |
+
'billingcity' => $details[ $checkout->get_field_id_by_unique_name( 'billingcity' ) ],
|
332 |
+
'billingregion' => wpsc_get_state_by_id( wpsc_get_customer_meta( '_wpsc_cart.delivery_region' ), 'code' ),
|
333 |
+
'billingpostcode' => $details[ $checkout->get_field_id_by_unique_name( 'billingpostcode' ) ],
|
334 |
+
'billingcountry' => $details[ $checkout->get_field_id_by_unique_name( 'billingcountry' ) ]
|
335 |
+
);
|
336 |
+
}
|
337 |
+
|
338 |
+
private function get_hpp_base_uri() {
|
339 |
+
|
340 |
+
$base_url = $this->sandbox ? 'https://sbprotectpay.propay.com' : 'https://protectpay.propay.com';
|
341 |
+
|
342 |
+
return $base_url;
|
343 |
+
}
|
344 |
+
|
345 |
+
public function enqueue_admin_scripts( $hook ) {
|
346 |
+
|
347 |
+
if ( 'settings_page_wpsc-settings' !== $hook ) {
|
348 |
+
return;
|
349 |
+
}
|
350 |
+
|
351 |
+
wp_enqueue_script( 'pro-pay-admin-js', WPSC_MERCHANT_V3_SDKS_URL . '/pro-pay/js/pro-pay-admin.js', array( 'jquery' ), WPSC_VERSION, true );
|
352 |
+
wp_localize_script( 'pro-pay-admin-js', 'WPSC_Pro_Pay', array(
|
353 |
+
'merchant_profile_nonce' => wp_create_nonce( 'wpsc_merchant_profile' ),
|
354 |
+
'profile_id_success_text' => __( 'Congratulations, you now have a functional merchant profile ID!', 'wp-e-commerce' ),
|
355 |
+
'profile_id_error_text' => __( 'Unfortunately, there was an error with this process. Try again later.', 'wp-e-commerce' )
|
356 |
+
)
|
357 |
+
);
|
358 |
+
|
359 |
+
}
|
360 |
+
|
361 |
+
public static function get_endpoint( $type, $environment ) {
|
362 |
+
// Default to a sane assumption of sandbox payment processing;
|
363 |
+
$endpoint = self::$endpoints['payment-processing-endpoint']['sandbox'];
|
364 |
+
|
365 |
+
if ( ! isset( self::$endpoints[ $type ] ) ) {
|
366 |
+
return $endpoint;
|
367 |
+
}
|
368 |
+
|
369 |
+
if ( ! isset( self::$endpoints[ $type ][ $environment ] ) ) {
|
370 |
+
return $endpoint;
|
371 |
+
}
|
372 |
+
|
373 |
+
return self::$endpoints[ $type ][ $environment ];
|
374 |
+
}
|
375 |
+
|
376 |
+
public function get_account_number_row( $hide = false ) {
|
377 |
+
$hidden = $hide ? ' style="display:none;"' : '';
|
378 |
+
?>
|
379 |
+
<tr id="pro-pay-account-row"<?php echo $hidden; ?>>
|
380 |
+
<td>
|
381 |
+
<label for="wpsc-pro-pay-merchant-profile-id"><?php _e( 'Account Number', 'wp-e-commerce' ); ?></label>
|
382 |
+
</td>
|
383 |
+
<td>
|
384 |
+
<input type="text" name="<?php echo esc_attr( $this->setting->get_field_name( 'account_number' ) ); ?>" value="<?php echo esc_attr( $this->setting->get( 'account_number' ) ); ?>" id="wpsc-pro-pay-account-number" />
|
385 |
+
<br><span class="small description"><?php _e( 'The Account Number can be obtained from the email that you should have received during the sign-up process.', 'wp-e-commerce' ); ?></span>
|
386 |
+
</td>
|
387 |
+
</tr>
|
388 |
+
<?php
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Settings Form Template
|
393 |
+
*
|
394 |
+
* @since 3.12.0
|
395 |
+
*/
|
396 |
+
public function setup_form() {
|
397 |
+
if ( empty( $this->account_number ) ) {
|
398 |
+
?>
|
399 |
+
<tr id="account-creation-pro-pay">
|
400 |
+
<td></td>
|
401 |
+
<td>
|
402 |
+
<a class="button-primary" href="<?php echo esc_url( $this->login_url ); ?>"><?php _e( 'Create an Account?', 'wp-e-commerce' ); ?></a>
|
403 |
+
<a class="button-secondary" href="#" onclick="jQuery( '#pro-pay-account-row' ).slideDown( 300 ); jQuery('#account-creation-pro-pay').slideUp(400); return false; "><?php _e( 'Already Have One?', 'wp-e-commerce' ); ?></a>
|
404 |
+
</td>
|
405 |
+
</tr>
|
406 |
+
<?php
|
407 |
+
$this->get_account_number_row( true );
|
408 |
+
} else {
|
409 |
+
?>
|
410 |
+
<!-- Account Credentials -->
|
411 |
+
<tr>
|
412 |
+
<td colspan="2">
|
413 |
+
<h4><?php _e( 'Account Credentials', 'wp-e-commerce' ); ?></h4>
|
414 |
+
</td>
|
415 |
+
</tr>
|
416 |
+
<?php $this->get_account_number_row(); ?>
|
417 |
+
<tr>
|
418 |
+
<td>
|
419 |
+
<label for="wpsc-pro-pay-merchant-profile-id"><?php _e( 'Merchant Profile ID', 'wp-e-commerce' ); ?></label>
|
420 |
+
</td>
|
421 |
+
<td>
|
422 |
+
<input type="text" name="<?php echo esc_attr( $this->setting->get_field_name( 'merchant_profile_id' ) ); ?>" value="<?php echo esc_attr( $this->setting->get( 'merchant_profile_id' ) ); ?>" id="wpsc-pro-pay-merchant-profile-id" />
|
423 |
+
<?php if ( empty( $this->merchant_profile_id ) ) : ?>
|
424 |
+
<div id="wpsc-propay-merchant-profile-create">
|
425 |
+
<p><span class="small description"><?php _e( 'If you have not yet received a merchant profile ID, create one below.', 'wp-e-commerce' ); ?></span></p>
|
426 |
+
<br /><a href="#" class="button-primary create-merchant-profile"><?php _e( 'Create Merchant Profile ID' ); ?></a><div class="spinner" style="float:none"></div>
|
427 |
+
</div>
|
428 |
+
<?php endif; ?>
|
429 |
+
</td>
|
430 |
+
</tr>
|
431 |
+
<tr>
|
432 |
+
<td>
|
433 |
+
<label for="wpsc-pro-pay-payment-capture"><?php _e( 'Payment Capture', 'wp-e-commerce' ); ?></label>
|
434 |
+
</td>
|
435 |
+
<td>
|
436 |
+
<select id="wpsc-pro-pay-payment-capture" name="<?php echo esc_attr( $this->setting->get_field_name( 'payment_capture' ) ); ?>">
|
437 |
+
<option value='' <?php selected( '', $this->setting->get( 'payment_capture' ) ); ?>><?php _e( 'Authorize and capture the payment when the order is placed.', 'wp-e-commerce' )?></option>
|
438 |
+
<option value='authorize' <?php selected( 'authorize', $this->setting->get( 'payment_capture' ) ); ?>><?php _e( 'Authorize the payment when the order is placed.', 'wp-e-commerce' )?></option>
|
439 |
+
</select>
|
440 |
+
</td>
|
441 |
+
</tr>
|
442 |
+
<tr>
|
443 |
+
<td>
|
444 |
+
<label><?php _e( 'Sandbox Mode', 'wp-e-commerce' ); ?></label>
|
445 |
+
</td>
|
446 |
+
<td>
|
447 |
+
<label><input <?php checked( $this->setting->get( 'sandbox_mode' ) ); ?> type="radio" name="<?php echo esc_attr( $this->setting->get_field_name( 'sandbox_mode' ) ); ?>" value="1" /> <?php _e( 'Yes', 'wp-e-commerce' ); ?></label>
|
448 |
+
<label><input <?php checked( (bool) $this->setting->get( 'sandbox_mode' ), false ); ?> type="radio" name="<?php echo esc_attr( $this->setting->get_field_name( 'sandbox_mode' ) ); ?>" value="0" /> <?php _e( 'No', 'wp-e-commerce' ); ?></label>
|
449 |
+
</td>
|
450 |
+
</tr>
|
451 |
+
<!-- Error Logging -->
|
452 |
+
<tr>
|
453 |
+
<td colspan="2">
|
454 |
+
<h4><?php _e( 'Error Logging', 'wp-e-commerce' ); ?></h4>
|
455 |
+
</td>
|
456 |
+
</tr>
|
457 |
+
<tr>
|
458 |
+
<td>
|
459 |
+
<label><?php _e( 'Enable Debugging', 'wp-e-commerce' ); ?></label>
|
460 |
+
</td>
|
461 |
+
<td>
|
462 |
+
<label><input <?php checked( $this->setting->get( 'debugging' ) ); ?> type="radio" name="<?php echo esc_attr( $this->setting->get_field_name( 'debugging' ) ); ?>" value="1" /> <?php _e( 'Yes', 'wp-e-commerce' ); ?></label>
|
463 |
+
<label><input <?php checked( (bool) $this->setting->get( 'debugging' ), false ); ?> type="radio" name="<?php echo esc_attr( $this->setting->get_field_name( 'debugging' ) ); ?>" value="0" /> <?php _e( 'No', 'wp-e-commerce' ); ?></label>
|
464 |
+
</td>
|
465 |
+
</tr>
|
466 |
+
<?php
|
467 |
+
}
|
468 |
+
}
|
469 |
+
|
470 |
+
public function create_merchant_profile() {
|
471 |
+
|
472 |
+
if ( ! wp_verify_nonce( $_POST['nonce'] , 'wpsc_merchant_profile' ) ) {
|
473 |
+
wp_send_json_error();
|
474 |
+
}
|
475 |
+
|
476 |
+
if ( ! wpsc_is_store_admin() ) {
|
477 |
+
wp_send_json_error();
|
478 |
+
}
|
479 |
+
|
480 |
+
$config = new WPSC_Pro_Pay_Merchant_Profile_Config(
|
481 |
+
array(
|
482 |
+
'cert_string' => $this->cert_string,
|
483 |
+
'account_number' => $this->account_number,
|
484 |
+
'term_id' => $this->term_id,
|
485 |
+
'environment' => $this->sandbox ? 'sandbox' : 'production',
|
486 |
+
'biller_account_id' => $this->biller_account_id,
|
487 |
+
'auth_token' => $this->auth_token
|
488 |
+
)
|
489 |
+
);
|
490 |
+
|
491 |
+
$profile = new WPSC_ProPay_Merchant_Profile( $config );
|
492 |
+
|
493 |
+
$profile_id = $profile->create()->get_profile_id();
|
494 |
+
|
495 |
+
if ( $profile_id ) {
|
496 |
+
$this->setting->set( 'merchant_profile_id', $profile_id );
|
497 |
+
wp_send_json_success( array( 'profile_id' => $profile_id ) );
|
498 |
+
} else {
|
499 |
+
wp_send_json_error();
|
500 |
+
}
|
501 |
+
}
|
502 |
+
|
503 |
+
public function create_payer_id() {
|
504 |
+
|
505 |
+
if ( ! wp_verify_nonce( $_POST['nonce'] , 'checkout_nonce' ) ) {
|
506 |
+
wp_send_json_error();
|
507 |
+
}
|
508 |
+
|
509 |
+
$payer_id = wpsc_get_customer_meta( 'pro_pay_payer_id' );
|
510 |
+
|
511 |
+
if ( $payer_id ) {
|
512 |
+
wp_send_json_success( array( 'payer' => $payer_id ) );
|
513 |
+
}
|
514 |
+
|
515 |
+
$name = sanitize_text_field( $_POST['name'] );
|
516 |
+
$email = sanitize_email( $_POST['email'] );
|
517 |
+
|
518 |
+
$config = new WPSC_Pro_Pay_Payer_Id_Config(
|
519 |
+
array(
|
520 |
+
'environment' => $this->sandbox ? 'sandbox' : 'production',
|
521 |
+
'biller_account_id' => $this->biller_account_id,
|
522 |
+
'auth_token' => $this->auth_token,
|
523 |
+
'name' => $name,
|
524 |
+
'email' => $email
|
525 |
+
)
|
526 |
+
);
|
527 |
+
|
528 |
+
$payer = new WPSC_ProPay_Payer_Id( $config );
|
529 |
+
|
530 |
+
$payer_id = $payer->create()->get_payer_id();
|
531 |
+
|
532 |
+
if ( $payer_id ) {
|
533 |
+
wpsc_update_customer_meta( 'pro_pay_payer_id', $payer_id );
|
534 |
+
wp_send_json_success( array( 'payer' => $payer_id ) );
|
535 |
+
} else {
|
536 |
+
wp_send_json_error();
|
537 |
+
}
|
538 |
+
}
|
539 |
+
|
540 |
+
public function create_hosted_transaction_id() {
|
541 |
+
|
542 |
+
if ( ! wp_verify_nonce( $_POST['nonce'] , 'checkout_nonce' ) ) {
|
543 |
+
wp_send_json_error();
|
544 |
+
}
|
545 |
+
|
546 |
+
$name = sanitize_text_field( $_POST['name'] );
|
547 |
+
$address1 = sanitize_text_field( $_POST['address1'] );
|
548 |
+
$address2 = sanitize_text_field( $_POST['address2'] );
|
549 |
+
$city = sanitize_text_field( $_POST['city'] );
|
550 |
+
$state = is_numeric( $_POST['state'] ) ? wpsc_get_state_by_id( $_POST['state'], 'code' ) : sanitize_text_field( $_POST['state'] );
|
551 |
+
$zip = sanitize_text_field( $_POST['zip'] );
|
552 |
+
$country = 'USA'; // Check if we can do international BUYERS. If so, we need 3-character ISO
|
553 |
+
|
554 |
+
$config = new WPSC_Pro_Pay_Hosted_Transaction_Id_Config(
|
555 |
+
array(
|
556 |
+
'environment' => $this->sandbox ? 'sandbox' : 'production',
|
557 |
+
'biller_account_id' => $this->biller_account_id,
|
558 |
+
'auth_token' => $this->auth_token,
|
559 |
+
'name' => $name,
|
560 |
+
'address1' => $address1,
|
561 |
+
'address2' => $address2,
|
562 |
+
'city' => $city,
|
563 |
+
'state' => $state,
|
564 |
+
'zip' => $zip,
|
565 |
+
'country' => $country,
|
566 |
+
'description' => sprintf( __( 'Order from %s', 'wp-e-commerce' ), get_bloginfo( 'blogname' ) ),
|
567 |
+
'merchant_profile_id' => $this->merchant_profile_id,
|
568 |
+
'auth_only' => 'authorize' === $this->payment_capture,
|
569 |
+
)
|
570 |
+
);
|
571 |
+
|
572 |
+
$hosted = new WPSC_Pro_Pay_Hosted_Transaction_Id( $config );
|
573 |
+
|
574 |
+
$token = $hosted->create()->get_transaction_id();
|
575 |
+
|
576 |
+
if ( $token ) {
|
577 |
+
wp_send_json_success( array( 'token' => $token ) );
|
578 |
+
} else {
|
579 |
+
wp_send_json_error();
|
580 |
+
}
|
581 |
+
}
|
582 |
+
|
583 |
+
public function create_hosted_results() {
|
584 |
+
|
585 |
+
if ( ! wp_verify_nonce( $_POST['nonce'] , 'checkout_nonce' ) ) {
|
586 |
+
wp_send_json_error();
|
587 |
+
}
|
588 |
+
|
589 |
+
$config = new WPSC_Pro_Pay_Hosted_Transaction_Results_Config(
|
590 |
+
array(
|
591 |
+
'environment' => $this->sandbox ? 'sandbox' : 'production',
|
592 |
+
'biller_account_id' => $this->biller_account_id,
|
593 |
+
'auth_token' => $this->auth_token,
|
594 |
+
'id' => sanitize_text_field( $_POST['hosted_id'] )
|
595 |
+
)
|
596 |
+
);
|
597 |
+
|
598 |
+
$hosted = new WPSC_Pro_Pay_Hosted_Transaction_Results( $config );
|
599 |
+
|
600 |
+
$results = $hosted->create()->get_response();
|
601 |
+
|
602 |
+
if ( $results ) {
|
603 |
+
wp_send_json_success( array( 'results' => $results ) );
|
604 |
+
} else {
|
605 |
+
wp_send_json_error();
|
606 |
+
}
|
607 |
+
}
|
608 |
+
|
609 |
+
public function process() {
|
610 |
+
|
611 |
+
$token = sanitize_text_field( $_POST['pro_pay_payment_method_token'] );
|
612 |
+
$transaction_id = sanitize_text_field( $_POST['pro_pay_transaction_id'] );
|
613 |
+
$last_four = absint( substr( $_POST['pro_pay_obfs_acct_number'], 0, -4 ) );
|
614 |
+
$type = sanitize_text_field( $_POST['pro_pay_card_type'] );
|
615 |
+
$order = $this->purchase_log;
|
616 |
+
|
617 |
+
$status = $this->payment_capture === '' ? WPSC_Purchase_Log::ACCEPTED_PAYMENT : WPSC_Purchase_Log::ORDER_RECEIVED;
|
618 |
+
|
619 |
+
$order->set( 'processed', $status )->save();
|
620 |
+
$order->set( 'token', $token )->save();
|
621 |
+
$order->set( 'transactid', $transaction_id )->save();
|
622 |
+
$order->set( 'last_four', $last_four )->save();
|
623 |
+
$order->set( 'type', $type )->save();
|
624 |
+
|
625 |
+
$this->go_to_transaction_results();
|
626 |
+
}
|
627 |
+
|
628 |
+
public function capture_payment( $log, $transaction_id ) {
|
629 |
+
|
630 |
+
if ( $log->get( 'gateway' ) == 'pro-pay' ) {
|
631 |
+
|
632 |
+
$config = new WPSC_Pro_Pay_Hosted_Capture_Payment_Config(
|
633 |
+
array(
|
634 |
+
'environment' => $this->sandbox ? 'sandbox' : 'production',
|
635 |
+
'biller_account_id' => $this->biller_account_id,
|
636 |
+
'auth_token' => $this->auth_token,
|
637 |
+
'merchant_profile_id' => $this->merchant_profile_id,
|
638 |
+
'transaction_id' => sanitize_text_field( $transaction_id ),
|
639 |
+
'amount' => $log->get( 'totalprice' ),
|
640 |
+
)
|
641 |
+
);
|
642 |
+
|
643 |
+
$capture = new WPSC_Pro_Pay_Hosted_Capture_Payment( $config );
|
644 |
+
|
645 |
+
$results = $capture->capture()->get_transaction_id();
|
646 |
+
|
647 |
+
if ( empty( $results ) ) {
|
648 |
+
throw new Exception( __( 'Could not generate a captured payment transaction ID.', 'wp-e-commerce' ) );
|
649 |
+
}
|
650 |
+
|
651 |
+
$log->set( 'processed', WPSC_Purchase_Log::ACCEPTED_PAYMENT )->save();
|
652 |
+
$log->set( 'transactid', $results )->save();
|
653 |
+
$log->set( 'pro_pay_capt_transactid', $transaction_id )->save();
|
654 |
+
|
655 |
+
return true;
|
656 |
+
}
|
657 |
+
|
658 |
+
return false;
|
659 |
+
}
|
660 |
+
|
661 |
+
public function process_refund( $log, $amount = 0.00, $reason = '', $manual = false ) {
|
662 |
+
|
663 |
+
if ( 0.00 == $amount ) {
|
664 |
+
return new WP_Error( 'propay_refund_error', __( 'Refund Error: You need to specify a refund amount.', 'wp-e-commerce' ) );
|
665 |
+
}
|
666 |
+
|
667 |
+
$log = wpsc_get_order( $log );
|
668 |
+
|
669 |
+
if ( ! $log->get( 'transactid' ) ) {
|
670 |
+
return new WP_Error( 'error', __( 'Refund Failed: No transaction ID', 'wp-e-commerce' ) );
|
671 |
+
}
|
672 |
+
|
673 |
+
$max_refund = $log->get( 'totalprice' ) - $log->get_total_refunded();
|
674 |
+
|
675 |
+
if ( $amount && $max_refund < $amount || 0 > $amount ) {
|
676 |
+
throw new Exception( __( 'Invalid refund amount', 'wp-e-commerce' ) );
|
677 |
+
}
|
678 |
+
|
679 |
+
if ( $manual ) {
|
680 |
+
$current_refund = $log->get_total_refunded();
|
681 |
+
|
682 |
+
// Set a log meta entry, and save log before adding refund note.
|
683 |
+
$log->set( 'total_order_refunded' , $amount + $current_refund )->save();
|
684 |
+
|
685 |
+
$log->add_refund_note(
|
686 |
+
sprintf( __( 'Refunded %s via Manual Refund', 'wp-e-commerce' ), wpsc_currency_display( $amount ) ),
|
687 |
+
$reason
|
688 |
+
);
|
689 |
+
|
690 |
+
return true;
|
691 |
+
}
|
692 |
+
|
693 |
+
$transaction_id = $log->get( 'transactid' );
|
694 |
+
|
695 |
+
$options = new WPSC_Pro_Pay_Refund_Config( array(
|
696 |
+
'amount' => $amount,
|
697 |
+
'reason' => $reason,
|
698 |
+
'transaction_id' => $transaction_id,
|
699 |
+
'merchant_id' => $this->merchant_profile_id,
|
700 |
+
'environment' => $this->sandbox ? 'sandbox' : 'production',
|
701 |
+
'biller_account_id' => $this->biller_account_id,
|
702 |
+
'auth_token' => $this->auth_token,
|
703 |
+
) );
|
704 |
+
|
705 |
+
// do API call
|
706 |
+
$refund = new WPSC_Pro_Pay_Refund( $options );
|
707 |
+
$refund = $refund->create()->get_refund();
|
708 |
+
|
709 |
+
if ( $refund ) {
|
710 |
+
|
711 |
+
if ( 'Success' == $refund->TransactionResult ) {
|
712 |
+
|
713 |
+
$current_refund = $log->get_total_refunded();
|
714 |
+
|
715 |
+
// Set a log meta entry, and save log before adding refund note.
|
716 |
+
$log->set( 'total_order_refunded' , $amount + $current_refund )->save();
|
717 |
+
|
718 |
+
$log->add_refund_note(
|
719 |
+
sprintf( __( 'Refunded %s - Refund ID: %s', 'wp-e-commerce' ), wpsc_currency_display( $refund->CurrencyConvertedAmount / 100 ), $refund->TransactionHistoryId ),
|
720 |
+
$reason
|
721 |
+
);
|
722 |
+
|
723 |
+
return true;
|
724 |
+
}
|
725 |
+
} else {
|
726 |
+
return false;
|
727 |
+
}
|
728 |
+
}
|
729 |
+
}
|
730 |
+
|
731 |
+
class WPSC_ProPay_Request {
|
732 |
+
|
733 |
+
protected $config;
|
734 |
+
protected $method;
|
735 |
+
|
736 |
+
public function __construct( $config, $method = 'PUT' ) {
|
737 |
+
$this->config = $config;
|
738 |
+
$this->method = $method;
|
739 |
+
}
|
740 |
+
|
741 |
+
public function request( $resource, $args = array() ) {
|
742 |
+
|
743 |
+
$endpoint = WPSC_Payment_Gateway_Pro_Pay::get_endpoint( 'rest-api-endpoint', $this->config->environment );
|
744 |
+
|
745 |
+
$url = $endpoint . '/'. ltrim( $resource, '/' );
|
746 |
+
|
747 |
+
$args = wp_parse_args( $args, array(
|
748 |
+
'timeout' => 60,
|
749 |
+
'method' => $this->method,
|
750 |
+
'body' => array(),
|
751 |
+
'headers' => array(
|
752 |
+
'content-type' => 'application/json',
|
753 |
+
'authorization' => self::generate_auth( $this->config->biller_account_id, $this->config->auth_token )
|
754 |
+
)
|
755 |
+
) );
|
756 |
+
|
757 |
+
if ( ! empty( $args['body'] ) ) {
|
758 |
+
$args['headers']['content-length'] = strlen( $args['body'] );
|
759 |
+
}
|
760 |
+
|
761 |
+
return new WPSC_ProPay_Response( wp_safe_remote_request( $url, $args ) );
|
762 |
+
}
|
763 |
+
|
764 |
+
private static function generate_auth( $id, $auth ) {
|
765 |
+
return 'Basic ' . base64_encode( "{$id}:{$auth}" );
|
766 |
+
}
|
767 |
+
}
|
768 |
+
|
769 |
+
class WPSC_ProPay_Response {
|
770 |
+
|
771 |
+
public $response = null;
|
772 |
+
protected $success = false;
|
773 |
+
|
774 |
+
public function __construct( $response ) {
|
775 |
+
$this->response = $response;
|
776 |
+
$this->prepare_response();
|
777 |
+
}
|
778 |
+
|
779 |
+
public function prepare_response() {
|
780 |
+
|
781 |
+
$response = json_decode( wp_remote_retrieve_body( $this->response ) );
|
782 |
+
$code = wp_remote_retrieve_response_code( $this->response );
|
783 |
+
|
784 |
+
if ( isset( $response->RequestResult ) ) {
|
785 |
+
$transaction_success = 'SUCCESS' === $response->RequestResult->ResultValue;
|
786 |
+
} else {
|
787 |
+
$transaction_success = 'SUCCESS' === $response->Result->ResultValue;
|
788 |
+
}
|
789 |
+
|
790 |
+
$success = 200 === $code && $transaction_success;
|
791 |
+
|
792 |
+
if ( ! is_wp_error( $this->response ) && $success ) {
|
793 |
+
$this->success = true;
|
794 |
+
$this->response = $response;
|
795 |
+
}
|
796 |
+
|
797 |
+
return $this->response;
|
798 |
+
}
|
799 |
+
|
800 |
+
public function is_successful() {
|
801 |
+
return $this->success;
|
802 |
+
}
|
803 |
+
|
804 |
+
public function get( $variable ) {
|
805 |
+
|
806 |
+
if ( isset( $this->response->$variable ) ) {
|
807 |
+
return $this->response->$variable;
|
808 |
+
}
|
809 |
+
|
810 |
+
return '';
|
811 |
+
}
|
812 |
+
|
813 |
+
/**
|
814 |
+
* Temp debug function.
|
815 |
+
*
|
816 |
+
* @return string [description]
|
817 |
+
*/
|
818 |
+
public function __toString() {
|
819 |
+
return '<pre>' . print_r( $this->response, 1 ) . '</pre>';
|
820 |
+
}
|
821 |
+
}
|
822 |
+
|
823 |
+
class WPSC_ProPay_Merchant_Profile {
|
824 |
+
|
825 |
+
protected $config;
|
826 |
+
|
827 |
+
public function __construct( WPSC_Pro_Pay_Merchant_Profile_Config $config ) {
|
828 |
+
$this->config = $config;
|
829 |
+
}
|
830 |
+
|
831 |
+
public function create() {
|
832 |
+
$request = new WPSC_ProPay_Request( $this->config );
|
833 |
+
|
834 |
+
$body = json_encode( array(
|
835 |
+
'ProfileName' => '',
|
836 |
+
'PaymentProcessor' => 'LegacyProPay',
|
837 |
+
'ProcessorData' => array(
|
838 |
+
array(
|
839 |
+
'ProcessorField' => 'certStr',
|
840 |
+
'Value' => $this->config->cert_string
|
841 |
+
),
|
842 |
+
array(
|
843 |
+
'ProcessorField' => 'accountNum',
|
844 |
+
'Value' => $this->config->account_number
|
845 |
+
),
|
846 |
+
array(
|
847 |
+
'ProcessorField' => 'termId',
|
848 |
+
'Value' => $this->config->term_id
|
849 |
+
)
|
850 |
+
),
|
851 |
+
) );
|
852 |
+
|
853 |
+
$this->response = $request->request( '/MerchantProfiles/', array( 'body' => $body ) );
|
854 |
+
|
855 |
+
return $this;
|
856 |
+
}
|
857 |
+
|
858 |
+
public function get_profile_id() {
|
859 |
+
|
860 |
+
if ( $this->response->is_successful() ) {
|
861 |
+
return $this->response->get( 'ProfileId' );
|
862 |
+
}
|
863 |
+
|
864 |
+
return '';
|
865 |
+
}
|
866 |
+
}
|
867 |
+
|
868 |
+
class WPSC_Pro_Pay_Merchant_Profile_Config {
|
869 |
+
|
870 |
+
public $cert_string;
|
871 |
+
public $account_number;
|
872 |
+
public $term_id;
|
873 |
+
public $environment;
|
874 |
+
public $biller_account_id;
|
875 |
+
public $auth_token;
|
876 |
+
|
877 |
+
public function __construct( $args ) {
|
878 |
+
$this->args = (object) $args;
|
879 |
+
|
880 |
+
$this->cert_string = $this->args->cert_string;
|
881 |
+
$this->account_number = $this->args->account_number;
|
882 |
+
$this->term_id = $this->args->term_id;
|
883 |
+
$this->environment = $this->args->environment;
|
884 |
+
$this->biller_account_id = $this->args->biller_account_id;
|
885 |
+
$this->auth_token = $this->args->auth_token;
|
886 |
+
}
|
887 |
+
}
|
888 |
+
|
889 |
+
class WPSC_ProPay_Payer_Id {
|
890 |
+
|
891 |
+
protected $config;
|
892 |
+
protected $response;
|
893 |
+
|
894 |
+
public function __construct( WPSC_Pro_Pay_Payer_Id_Config $config ) {
|
895 |
+
$this->config = $config;
|
896 |
+
}
|
897 |
+
|
898 |
+
public function create() {
|
899 |
+
$request = new WPSC_ProPay_Request( $this->config );
|
900 |
+
|
901 |
+
$body = json_encode( array(
|
902 |
+
'Name' => $this->config->name,
|
903 |
+
'EmailAddress' => $this->config->email,
|
904 |
+
) );
|
905 |
+
|
906 |
+
$this->response = $request->request( '/Payers/', array( 'body' => $body ) );
|
907 |
+
|
908 |
+
return $this;
|
909 |
+
}
|
910 |
+
|
911 |
+
public function get_payer_id() {
|
912 |
+
if ( $this->response->is_successful() ) {
|
913 |
+
return $this->response->get( 'ExternalAccountID' );
|
914 |
+
}
|
915 |
+
|
916 |
+
return '';
|
917 |
+
}
|
918 |
+
}
|
919 |
+
|
920 |
+
class WPSC_Pro_Pay_Payer_Id_Config {
|
921 |
+
|
922 |
+
public $environment;
|
923 |
+
public $biller_account_id;
|
924 |
+
public $auth_token;
|
925 |
+
public $name;
|
926 |
+
public $email;
|
927 |
+
|
928 |
+
public function __construct( $args ) {
|
929 |
+
$this->args = (object) $args;
|
930 |
+
|
931 |
+
$this->environment = $this->args->environment;
|
932 |
+
$this->biller_account_id = $this->args->biller_account_id;
|
933 |
+
$this->auth_token = $this->args->auth_token;
|
934 |
+
$this->name = $this->args->name;
|
935 |
+
$this->email = $this->args->email;
|
936 |
+
}
|
937 |
+
}
|
938 |
+
|
939 |
+
class WPSC_Pro_Pay_Hosted_Transaction_Id {
|
940 |
+
|
941 |
+
protected $config;
|
942 |
+
protected $response;
|
943 |
+
|
944 |
+
public function __construct( WPSC_Pro_Pay_Hosted_Transaction_Id_Config $config ) {
|
945 |
+
$this->config = $config;
|
946 |
+
}
|
947 |
+
|
948 |
+
public function create() {
|
949 |
+
$request = new WPSC_ProPay_Request( $this->config );
|
950 |
+
|
951 |
+
$body = json_encode( apply_filters( 'wpsc_pro_pay_default_hosted_transaction_args', array(
|
952 |
+
'Name' => $this->config->name,
|
953 |
+
'Address1' => $this->config->address1,
|
954 |
+
'Address2' => $this->config->address2,
|
955 |
+
'City' => $this->config->city,
|
956 |
+
'State' => $this->config->state,
|
957 |
+
'ZipCode' => $this->config->zip,
|
958 |
+
'Country' => $this->config->country,
|
959 |
+
'Description' => $this->config->description,
|
960 |
+
'MerchantProfileId' => $this->config->merchant_profile_id,
|
961 |
+
'AuthOnly' => $this->config->auth_only,
|
962 |
+
'ProcessCard' => ! $this->config->auth_only,
|
963 |
+
'Amount' => wpsc_cart_total( false ) * 100,
|
964 |
+
'PayerAccountId' => wpsc_get_customer_meta( 'pro_pay_payer_id' ),
|
965 |
+
'PaymentTypeId' => '0',
|
966 |
+
'CurrencyCode' => 'USD',
|
967 |
+
'InvoiceNumber' => uniqid(),
|
968 |
+
'AvsRequirementType' => 1,
|
969 |
+
'CardHolderNameRequirementType' => 1,
|
970 |
+
'SecurityCodeRequirementType' => 1,
|
971 |
+
'OnlyStoreCardOnSuccessfulProcess' => true,
|
972 |
+
) ) );
|
973 |
+
|
974 |
+
$this->response = $request->request( '/HostedTransactions/', array( 'body' => $body ) );
|
975 |
+
|
976 |
+
return $this;
|
977 |
+
}
|
978 |
+
|
979 |
+
public function get_transaction_id() {
|
980 |
+
if ( $this->response->is_successful() ) {
|
981 |
+
return $this->response->get( 'HostedTransactionIdentifier' );
|
982 |
+
}
|
983 |
+
|
984 |
+
return '';
|
985 |
+
}
|
986 |
+
}
|
987 |
+
|
988 |
+
class WPSC_Pro_Pay_Hosted_Transaction_Id_Config {
|
989 |
+
|
990 |
+
public $environment;
|
991 |
+
public $biller_account_id;
|
992 |
+
public $auth_token;
|
993 |
+
public $name;
|
994 |
+
|
995 |
+
public function __construct( $args ) {
|
996 |
+
$this->args = (object) $args;
|
997 |
+
|
998 |
+
$this->environment = $this->args->environment;
|
999 |
+
$this->biller_account_id = $this->args->biller_account_id;
|
1000 |
+
$this->auth_token = $this->args->auth_token;
|
1001 |
+
$this->name = $this->args->name;
|
1002 |
+
$this->address1 = $this->args->address1;
|
1003 |
+
$this->address2 = $this->args->address2;
|
1004 |
+
$this->city = $this->args->city;
|
1005 |
+
$this->state = $this->args->state;
|
1006 |
+
$this->zip = $this->args->zip;
|
1007 |
+
$this->country = $this->args->country;
|
1008 |
+
$this->description = $this->args->description;
|
1009 |
+
$this->merchant_profile_id = $this->args->merchant_profile_id;
|
1010 |
+
$this->auth_only = $this->args->auth_only;
|
1011 |
+
}
|
1012 |
+
}
|
1013 |
+
|
1014 |
+
class WPSC_Pro_Pay_Hosted_Transaction_Results {
|
1015 |
+
|
1016 |
+
protected $config;
|
1017 |
+
protected $response;
|
1018 |
+
|
1019 |
+
public function __construct( WPSC_Pro_Pay_Hosted_Transaction_Results_Config $config ) {
|
1020 |
+
$this->config = $config;
|
1021 |
+
}
|
1022 |
+
|
1023 |
+
public function create() {
|
1024 |
+
$request = new WPSC_ProPay_Request( $this->config, 'GET' );
|
1025 |
+
|
1026 |
+
$this->response = $request->request( "/HostedTransactionResults/{$this->config->id}" );
|
1027 |
+
|
1028 |
+
return $this;
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
public function get_response() {
|
1032 |
+
if ( $this->response->is_successful() ) {
|
1033 |
+
return $this->response;
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
return '';
|
1037 |
+
}
|
1038 |
+
}
|
1039 |
+
|
1040 |
+
class WPSC_Pro_Pay_Hosted_Transaction_Results_Config {
|
1041 |
+
|
1042 |
+
public $environment;
|
1043 |
+
public $biller_account_id;
|
1044 |
+
public $auth_token;
|
1045 |
+
public $id;
|
1046 |
+
|
1047 |
+
public function __construct( $args ) {
|
1048 |
+
$this->args = (object) $args;
|
1049 |
+
|
1050 |
+
$this->environment = $this->args->environment;
|
1051 |
+
$this->biller_account_id = $this->args->biller_account_id;
|
1052 |
+
$this->auth_token = $this->args->auth_token;
|
1053 |
+
$this->id = $this->args->id;
|
1054 |
+
}
|
1055 |
+
}
|
1056 |
+
|
1057 |
+
class WPSC_Pro_Pay_Refund {
|
1058 |
+
|
1059 |
+
protected $config;
|
1060 |
+
protected $response;
|
1061 |
+
|
1062 |
+
public function __construct( WPSC_Pro_Pay_Refund_Config $config ) {
|
1063 |
+
$this->config = $config;
|
1064 |
+
}
|
1065 |
+
|
1066 |
+
public function create() {
|
1067 |
+
$request = new WPSC_ProPay_Request( $this->config );
|
1068 |
+
|
1069 |
+
$body = json_encode( array(
|
1070 |
+
'CurrencyCode' => 'USD',
|
1071 |
+
'TransactionHistoryId' => $this->config->transaction_id,
|
1072 |
+
'Comment1' => $this->config->reason,
|
1073 |
+
'Amount' => $this->config->amount * 100,
|
1074 |
+
'MerchantProfileId' => $this->config->merchant_id
|
1075 |
+
) );
|
1076 |
+
|
1077 |
+
$this->response = $request->request( '/RefundTransaction/', array( 'body' => $body ) );
|
1078 |
+
|
1079 |
+
return $this;
|
1080 |
+
}
|
1081 |
+
|
1082 |
+
public function get_refund() {
|
1083 |
+
if ( $this->response->is_successful() ) {
|
1084 |
+
return $this->response->get( 'TransactionDetail' );
|
1085 |
+
}
|
1086 |
+
|
1087 |
+
return '';
|
1088 |
+
}
|
1089 |
+
}
|
1090 |
+
|
1091 |
+
class WPSC_Pro_Pay_Refund_Config {
|
1092 |
+
|
1093 |
+
public $environment;
|
1094 |
+
public $biller_account_id;
|
1095 |
+
public $auth_token;
|
1096 |
+
public $name;
|
1097 |
+
|
1098 |
+
public function __construct( $args ) {
|
1099 |
+
$this->args = (object) $args;
|
1100 |
+
$this->environment = $this->args->environment;
|
1101 |
+
$this->biller_account_id = $this->args->biller_account_id;
|
1102 |
+
$this->auth_token = $this->args->auth_token;
|
1103 |
+
$this->transaction_id = $this->args->transaction_id;
|
1104 |
+
$this->reason = $this->args->reason;
|
1105 |
+
$this->amount = $this->args->amount;
|
1106 |
+
$this->merchant_id = $this->args->merchant_id;
|
1107 |
+
|
1108 |
+
}
|
1109 |
+
}
|
1110 |
+
|
1111 |
+
class WPSC_Pro_Pay_Hosted_Capture_Payment {
|
1112 |
+
|
1113 |
+
protected $config;
|
1114 |
+
protected $response;
|
1115 |
+
|
1116 |
+
public function __construct( WPSC_Pro_Pay_Hosted_Capture_Payment_Config $config ) {
|
1117 |
+
$this->config = $config;
|
1118 |
+
}
|
1119 |
+
|
1120 |
+
public function capture() {
|
1121 |
+
$request = new WPSC_ProPay_Request( $this->config );
|
1122 |
+
|
1123 |
+
$body = json_encode( array(
|
1124 |
+
'TransactionHistoryId' => $this->config->transaction_id,
|
1125 |
+
'MerchantProfileId' => $this->config->merchant_profile_id,
|
1126 |
+
'Amount' => $this->config->amount * 100,
|
1127 |
+
'CurrencyCode' => 'USD'
|
1128 |
+
) );
|
1129 |
+
|
1130 |
+
$this->response = $request->request( '/PaymentMethods/CapturedTransactions/', array( 'body' => $body ) );
|
1131 |
+
|
1132 |
+
trigger_error( var_export( $this->response, 1 ) );
|
1133 |
+
|
1134 |
+
return $this;
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
public function get_transaction_id() {
|
1138 |
+
|
1139 |
+
if ( $this->response->is_successful() ) {
|
1140 |
+
return $this->response->get( 'Transaction' )->TransactionHistoryId;
|
1141 |
+
}
|
1142 |
+
|
1143 |
+
return '';
|
1144 |
+
}
|
1145 |
+
}
|
1146 |
+
|
1147 |
+
class WPSC_Pro_Pay_Hosted_Capture_Payment_Config {
|
1148 |
+
|
1149 |
+
public $environment;
|
1150 |
+
public $biller_account_id;
|
1151 |
+
public $auth_token;
|
1152 |
+
public $id;
|
1153 |
+
|
1154 |
+
public function __construct( $args ) {
|
1155 |
+
$this->args = (object) $args;
|
1156 |
+
|
1157 |
+
$this->environment = $this->args->environment;
|
1158 |
+
$this->biller_account_id = $this->args->biller_account_id;
|
1159 |
+
$this->auth_token = $this->args->auth_token;
|
1160 |
+
$this->transaction_id = $this->args->transaction_id;
|
1161 |
+
$this->merchant_profile_id = $this->args->merchant_profile_id;
|
1162 |
+
$this->amount = $this->args->amount;
|
1163 |
+
}
|
1164 |
+
}
|
wpsc-components/merchant-core-v3/gateways/worldpay.php
CHANGED
@@ -45,7 +45,7 @@ class WPSC_Payment_Gateway_WorldPay extends WPSC_Payment_Gateway {
|
|
45 |
*
|
46 |
* @return bool Whether or not to load gateway.
|
47 |
*/
|
48 |
-
public
|
49 |
return function_exists( '_wpsc_get_current_controller' );
|
50 |
}
|
51 |
|
@@ -206,7 +206,7 @@ class WPSC_Payment_Gateway_WorldPay extends WPSC_Payment_Gateway {
|
|
206 |
}
|
207 |
|
208 |
public function init() {
|
209 |
-
|
210 |
add_action( 'wp_enqueue_scripts', array( $this, 'scripts' ) );
|
211 |
add_action( 'wp_head' , array( $this, 'head_script' ) );
|
212 |
|
@@ -259,7 +259,7 @@ class WPSC_Payment_Gateway_WorldPay extends WPSC_Payment_Gateway {
|
|
259 |
default:
|
260 |
|
261 |
// Capture
|
262 |
-
$result = $this->capture_payment( $card_token );
|
263 |
|
264 |
if ( $result ) {
|
265 |
// Payment complete
|
@@ -277,7 +277,7 @@ class WPSC_Payment_Gateway_WorldPay extends WPSC_Payment_Gateway {
|
|
277 |
|
278 |
}
|
279 |
|
280 |
-
public function capture_payment( $token ) {
|
281 |
|
282 |
if ( $this->purchase_log->get( 'gateway' ) == 'worldpay' ) {
|
283 |
|
45 |
*
|
46 |
* @return bool Whether or not to load gateway.
|
47 |
*/
|
48 |
+
public function load() {
|
49 |
return function_exists( '_wpsc_get_current_controller' );
|
50 |
}
|
51 |
|
206 |
}
|
207 |
|
208 |
public function init() {
|
209 |
+
parent::init();
|
210 |
add_action( 'wp_enqueue_scripts', array( $this, 'scripts' ) );
|
211 |
add_action( 'wp_head' , array( $this, 'head_script' ) );
|
212 |
|
259 |
default:
|
260 |
|
261 |
// Capture
|
262 |
+
$result = $this->capture_payment( $order, $card_token );
|
263 |
|
264 |
if ( $result ) {
|
265 |
// Payment complete
|
277 |
|
278 |
}
|
279 |
|
280 |
+
public function capture_payment( $log, $token ) {
|
281 |
|
282 |
if ( $this->purchase_log->get( 'gateway' ) == 'worldpay' ) {
|
283 |
|
wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/hard-decline-email-de.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
-
* @version
|
13 |
*/
|
14 |
?>
|
15 |
|
@@ -21,4 +21,4 @@ von Amazon Payments zurückgewiesen. Bitte kontaktieren Sie uns.
|
|
21 |
|
22 |
Mit freundlichen Grüßen
|
23 |
|
24 |
-
<?php echo get_option( 'blogname' ); ?>
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
+
* @version 3.9.0
|
13 |
*/
|
14 |
?>
|
15 |
|
21 |
|
22 |
Mit freundlichen Grüßen
|
23 |
|
24 |
+
<?php echo get_option( 'blogname' ); ?>
|
wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/hard-decline-email-en.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
-
* @version
|
13 |
*/
|
14 |
?>
|
15 |
|
@@ -24,4 +24,4 @@ Afterwards we will automatically request payment again from Amazon Payments and
|
|
24 |
|
25 |
Kind regards,
|
26 |
|
27 |
-
<?php echo get_option( 'blogname' ); ?>
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
+
* @version 3.9.0
|
13 |
*/
|
14 |
?>
|
15 |
|
24 |
|
25 |
Kind regards,
|
26 |
|
27 |
+
<?php echo get_option( 'blogname' ); ?>
|
wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/hard-decline-email-es.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
-
* @version
|
13 |
*/
|
14 |
?>
|
15 |
|
@@ -19,4 +19,4 @@ Desgraciadamente, Amazon Payments ha rechazado el pago de tu pedido en nuestra t
|
|
19 |
|
20 |
Gracias por elegir Pagar con Amazon,
|
21 |
|
22 |
-
<?php echo get_option( 'blogname' ); ?>
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
+
* @version 3.9.0
|
13 |
*/
|
14 |
?>
|
15 |
|
19 |
|
20 |
Gracias por elegir Pagar con Amazon,
|
21 |
|
22 |
+
<?php echo get_option( 'blogname' ); ?>
|
wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/hard-decline-email-fr.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
-
* @version
|
13 |
*/
|
14 |
?>
|
15 |
|
@@ -19,4 +19,4 @@ Malheureusement Amazon Payments n’a pas pu traier le paiement pour votre comma
|
|
19 |
|
20 |
Meilleures salutations,
|
21 |
|
22 |
-
<?php echo get_option( 'blogname' ); ?>
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
+
* @version 3.9.0
|
13 |
*/
|
14 |
?>
|
15 |
|
19 |
|
20 |
Meilleures salutations,
|
21 |
|
22 |
+
<?php echo get_option( 'blogname' ); ?>
|
wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/hard-decline-email-it.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
-
* @version
|
13 |
*/
|
14 |
?>
|
15 |
|
@@ -21,4 +21,4 @@ Non esiti a contattarci per ulteriori informazioni a riguardo.
|
|
21 |
|
22 |
Cordiali saluti,
|
23 |
|
24 |
-
<?php echo get_option( 'blogname' ); ?>
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
+
* @version 3.9.0
|
13 |
*/
|
14 |
?>
|
15 |
|
21 |
|
22 |
Cordiali saluti,
|
23 |
|
24 |
+
<?php echo get_option( 'blogname' ); ?>
|
wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/soft-decline-email-de.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
-
* @version
|
13 |
*/
|
14 |
?>
|
15 |
|
@@ -23,4 +23,4 @@ Sie können unter <?php echo esc_url( $url ); ?> die Zahlungsinformationen für
|
|
23 |
|
24 |
Mit freundlichen Grüßen
|
25 |
|
26 |
-
<?php echo get_option( 'blogname' ); ?>
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
+
* @version 3.9.0
|
13 |
*/
|
14 |
?>
|
15 |
|
23 |
|
24 |
Mit freundlichen Grüßen
|
25 |
|
26 |
+
<?php echo get_option( 'blogname' ); ?>
|
wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/soft-decline-email-en.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
-
* @version
|
13 |
*/
|
14 |
?>
|
15 |
|
@@ -24,4 +24,4 @@ Afterwards we will automatically request payment again from Amazon Payments and
|
|
24 |
|
25 |
Kind regards,
|
26 |
|
27 |
-
<?php echo get_option( 'blogname' ); ?>
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
+
* @version 3.9.0
|
13 |
*/
|
14 |
?>
|
15 |
|
24 |
|
25 |
Kind regards,
|
26 |
|
27 |
+
<?php echo get_option( 'blogname' ); ?>
|
wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/soft-decline-email-es.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
-
* @version
|
13 |
*/
|
14 |
?>
|
15 |
|
@@ -23,4 +23,4 @@ Por favor, dirígete <?php echo esc_url( $url ); ?> y revisa la información de
|
|
23 |
|
24 |
Gracias por elegir Pagar con Amazon,
|
25 |
|
26 |
-
<?php echo get_option( 'blogname' ); ?>
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
+
* @version 3.9.0
|
13 |
*/
|
14 |
?>
|
15 |
|
23 |
|
24 |
Gracias por elegir Pagar con Amazon,
|
25 |
|
26 |
+
<?php echo get_option( 'blogname' ); ?>
|
wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/soft-decline-email-fr.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
-
* @version
|
13 |
*/
|
14 |
?>
|
15 |
|
@@ -23,4 +23,4 @@ Veuillez aller sur <?php echo esc_url( $url ); ?> et mettez à jour les informat
|
|
23 |
|
24 |
Meilleures salutations,
|
25 |
|
26 |
-
<?php echo get_option( 'blogname' ); ?>
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
+
* @version 3.9.0
|
13 |
*/
|
14 |
?>
|
15 |
|
23 |
|
24 |
Meilleures salutations,
|
25 |
|
26 |
+
<?php echo get_option( 'blogname' ); ?>
|
wpsc-components/merchant-core-v3/libraries/amazon-payments/assets/emails/soft-decline-email-it.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
-
* @version
|
13 |
*/
|
14 |
?>
|
15 |
|
@@ -25,4 +25,4 @@ Successivamente riceverà una mail di conferma dell'avvenuto pagamento.
|
|
25 |
|
26 |
Cordiali saluti,
|
27 |
|
28 |
-
<?php echo get_option( 'blogname' ); ?>
|
9 |
*
|
10 |
* @author WP eCommerce
|
11 |
* @package WP-e-Commerce/Templates/Emails
|
12 |
+
* @version 3.9.0
|
13 |
*/
|
14 |
?>
|
15 |
|
25 |
|
26 |
Cordiali saluti,
|
27 |
|
28 |
+
<?php echo get_option( 'blogname' ); ?>
|
wpsc-components/merchant-core-v3/libraries/pro-pay/js/hpp.js
ADDED
@@ -0,0 +1,454 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*global WPSC_Pro_Pay_Checkout*/
|
2 |
+
var iFrameId = WPSC_Pro_Pay_Checkout.iframe_id;
|
3 |
+
var baseURI = WPSC_Pro_Pay_Checkout.base_uri;
|
4 |
+
var TimeoutInterval = 30000; //in ms
|
5 |
+
//Get Timestamp for log
|
6 |
+
function GetTimestamp() {
|
7 |
+
var date = new Date();
|
8 |
+
var hour = date.getHours();
|
9 |
+
var minutes = date.getMinutes();
|
10 |
+
var seconds = date.getSeconds();
|
11 |
+
var milliseconds = date.getMilliseconds();
|
12 |
+
if ((minutes + '').length == 1) {
|
13 |
+
minutes = '0' + minutes;
|
14 |
+
}
|
15 |
+
if ((seconds + '').length == 1) {
|
16 |
+
seconds = '0' + seconds;
|
17 |
+
}
|
18 |
+
if ((milliseconds + '').length == 1) {
|
19 |
+
milliseconds = '00' + milliseconds;
|
20 |
+
}
|
21 |
+
if ((milliseconds + '').length == 2) {
|
22 |
+
milliseconds = '0' + milliseconds;
|
23 |
+
}
|
24 |
+
return hour + ':' + minutes + ':' + seconds + ':' + milliseconds;
|
25 |
+
}
|
26 |
+
|
27 |
+
//Echo Browser Events to Browser Log Window
|
28 |
+
function echoBrowserMessage(message) {
|
29 |
+
var divMessage = document.getElementById('BrowserLog');
|
30 |
+
var msg = divMessage.innerHTML;
|
31 |
+
msg = '[' + GetTimestamp() + '] ' + message + '<br />' + msg;
|
32 |
+
divMessage.innerHTML = msg;
|
33 |
+
}
|
34 |
+
|
35 |
+
//Echo SignalR Message and Data Events to Log Window
|
36 |
+
function echoSignalRMessage(message) {
|
37 |
+
var divMessage = document.getElementById('MessageLog');
|
38 |
+
var msg = divMessage.innerHTML;
|
39 |
+
msg = '[' + GetTimestamp() + '] ' + message + '<br />' + msg;
|
40 |
+
divMessage.innerHTML = msg;
|
41 |
+
}
|
42 |
+
|
43 |
+
//Echo SignalR Console Transport Connection Events to Log Window
|
44 |
+
function echoSignalRConsoleMessage(message) {
|
45 |
+
var divMessage = document.getElementById('ConsoleLog');
|
46 |
+
var msg = divMessage.innerHTML;
|
47 |
+
msg = '<b>[' + GetTimestamp() + ']</b> ' + message + '<br />' + msg;
|
48 |
+
divMessage.innerHTML = msg;
|
49 |
+
}
|
50 |
+
|
51 |
+
function fixMissingBrowserFunctionality() {
|
52 |
+
|
53 |
+
// If 'String.trim()' is not defined (like on IE8), define it here
|
54 |
+
if (typeof String.prototype.trim !== 'function') {
|
55 |
+
String.prototype.trim = function () {
|
56 |
+
return this.replace(/^\s+|\s+$/g, '');
|
57 |
+
};
|
58 |
+
}
|
59 |
+
|
60 |
+
//Add additional Checks for Browsers you intend to support
|
61 |
+
}
|
62 |
+
|
63 |
+
// Invoked after a JavaScript error occurs on the page.
|
64 |
+
function window_OnError(errorMsg, url, lineNumber, column, errorObj) {
|
65 |
+
//Custom Handler
|
66 |
+
if (debug) {
|
67 |
+
echoBrowserMessage('<b style="color: red">Error Thrown: </b> window_OnError() <b>Raised</b>');
|
68 |
+
echoBrowserMessage('<b style="color: red"> • Type: </b>' + errorObj);
|
69 |
+
echoBrowserMessage('<b style="color: red"> • Message: </b>' + errorMsg);
|
70 |
+
echoBrowserMessage('<b style="color: red"> • File: </b>' + url);
|
71 |
+
echoBrowserMessage('<b style="color: red"> • Line Number: </b>' + lineNumber);
|
72 |
+
echoBrowserMessage('<b style="color: red"> • Column: </b>' + column);
|
73 |
+
echoBrowserMessage('<b style="color: red">Error Details: </b>');
|
74 |
+
return true;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
// Invoked before anything is sent over the connection.
|
79 |
+
function signalR_OnStarting(e, data) {
|
80 |
+
//Custom Handler
|
81 |
+
if (debug) {
|
82 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: blue">Establishing SignalR Connection Capability</span> signalR_OnStarting() <b>Raised</b>');
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
// Invoked when the connection state changes.
|
87 |
+
function signalR_OnStateChanged(e, data) {
|
88 |
+
//Custom Handler
|
89 |
+
if (debug) {
|
90 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: blue">SignalR Connection State Change</span> signalR_OnStateChanged() <b>Raised()</b>');
|
91 |
+
//var oldState = getStateName(e.oldState);
|
92 |
+
//var newState = getStateName(e.newState);
|
93 |
+
echoSignalRMessage('<b style="color: Blue" >Changing state </b> from <b>' + getStateName(e.oldState) + '</b> to <b>' + getStateName(e.newState) + '</b>');
|
94 |
+
}
|
95 |
+
jQuery( document.body ).trigger( 'pro-pay-connecting' );
|
96 |
+
|
97 |
+
}
|
98 |
+
|
99 |
+
// Invoked when the 'start' method is called and succeeds in connecting to the server.
|
100 |
+
function signalR_OnConnected(e, data) {
|
101 |
+
//Custom Handler
|
102 |
+
if (debug) {
|
103 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: Blue ">SignalR Connection Established</span> signalR_OnConnected() <b>Raised</b>');
|
104 |
+
var msg = '<b style="color: Blue ">Connection Attributes</b>'
|
105 |
+
// General Connection Stats
|
106 |
+
+ '<br> <b> • Connection Protocol:</b> ' + e.protocol
|
107 |
+
+ '<br> <b> • Connected Host:</b> ' + e.host
|
108 |
+
+ '<br> <b> • Connected Host Resource URI:</b> ' + e.appRelativeUrl
|
109 |
+
// SignalR Connection Stats
|
110 |
+
+ '<br> <b> • SignalR Connection State:</b> ' + getStateName(e.state)
|
111 |
+
+ '<br> <b> • SignalR Connection ID:</b> ' + e.id
|
112 |
+
+ '<br> <b> • SignalR Connection Token:</b> ' + e.token
|
113 |
+
+ '<br> <b> • SignalR Connection Timout:</b> ' + e.disconnectTimeout; + 'ms'
|
114 |
+
+ '<br> <b> • SignalR Connection Timeout Threshold:</b> ' + ((parseInt(e.disconnectTimeout) * 2) / 3) + 'ms'
|
115 |
+
// SignalR Transport Connection Stats
|
116 |
+
+ '<br> <b> • Transport Connection Name:</b> ' + e.transport.name
|
117 |
+
+ '<br> <b> • Transport Connection Reconnect Delay:</b> ' + e.reconnectDelay + 'ms'
|
118 |
+
+ '<br> <b> • Transport Connection Reconnect Threshold:</b> ' + ((parseInt(e.reconnectDelay) * 2) / 3) + 'ms'
|
119 |
+
+ '<br> <b> • Transport Connection Reconnect Delay:</b> ' + e.transport.reconnectDelay + 'ms'
|
120 |
+
+ '<br> <b> • Transport Connection Reconnect Threshold:</b> ' + ((parseInt(e.transport.reconnectDelay) * 2) / 3) + 'ms'
|
121 |
+
+ '<br> <b> • Logging SignalR Events to Console:</b> ' + e.logging;
|
122 |
+
|
123 |
+
echoSignalRMessage(msg);
|
124 |
+
}
|
125 |
+
|
126 |
+
jQuery( document.body ).trigger( 'pro-pay-connected' );
|
127 |
+
|
128 |
+
}
|
129 |
+
|
130 |
+
// Invoked when the Connection.Start() method is called but fails to connect to the SignalR server.
|
131 |
+
function signalR_OnConnectionFailed(e, data) {
|
132 |
+
//Custom Handler
|
133 |
+
if (debug) {
|
134 |
+
echoBrowserMessage('<b style="color: red">Error Thrown: </b>Failed to connect to the server - Unknown, signalR_OnConnectionFailed() <b>Raised</b>');
|
135 |
+
if (valueIsValid(e) === true) {
|
136 |
+
echoSignalRMessage('<b style="color: red">Error Thrown: </b>Failed to connect to the server: ' + e.message)
|
137 |
+
echoSignalRMessage('<b style="color: red">Error Thrown: </b>Stack: ' + e.stack);
|
138 |
+
}
|
139 |
+
else {
|
140 |
+
echoSignalRMessage('<b style="color: red">Error Thrown: </b>Failed to connect to the server - Unknown, signalR_OnConnectionFailed() <b>Raised</b>');
|
141 |
+
}
|
142 |
+
}
|
143 |
+
jQuery( document.body ).trigger( 'pro-pay-connection-failed' );
|
144 |
+
}
|
145 |
+
|
146 |
+
// Invoked when the client detects a slow connection.
|
147 |
+
function signalR_OnConnectionSlow(e, data) {
|
148 |
+
//Custom Handler
|
149 |
+
if (debug) {
|
150 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: blue">Slow Connection Detected - </b>Keep Alive Timout % Threshold Exceeded, signalR_OnConnectionSlow() <b>Raised</b>');
|
151 |
+
}
|
152 |
+
jQuery( document.body ).trigger( 'pro-pay-connection-slow' );
|
153 |
+
|
154 |
+
}
|
155 |
+
|
156 |
+
// Invoked when the underlying transport begins reconnecting.
|
157 |
+
function signalR_OnReconnecting(e, data) {
|
158 |
+
//Custom Handler
|
159 |
+
if (debug) {
|
160 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: red">Connection Loss Threshold - </span>Connection Lost OR Keep Alive Timout Exceede, signalR_OnReconnecting() <b>Raised</b>');
|
161 |
+
}
|
162 |
+
jQuery( document.body ).trigger( 'pro-pay-reconnecting' );
|
163 |
+
}
|
164 |
+
|
165 |
+
// Invoked when the underlying transport reconnects.
|
166 |
+
function signalR_OnReconnect(e, data) {
|
167 |
+
//Custom Handler
|
168 |
+
if (debug) {
|
169 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: green">Connection Re-established</span>signalR_OnReconnect() <b>Raised</b>');
|
170 |
+
}
|
171 |
+
|
172 |
+
jQuery( document.body ).trigger( 'pro-pay-reconnected' );
|
173 |
+
|
174 |
+
}
|
175 |
+
|
176 |
+
// Invoked when the client disconnects.
|
177 |
+
function signalR_OnDisconnect(e, data) {
|
178 |
+
//Custom Handler
|
179 |
+
if (debug) {
|
180 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: red">SignalR Connection Disconnected</span>signalR_OnDisconnect() <b>Raised</b>');
|
181 |
+
}
|
182 |
+
jQuery( document.body ).trigger( 'pro-pay-disconnected' );
|
183 |
+
|
184 |
+
}
|
185 |
+
|
186 |
+
// This function is called when the server signalR issues a 'FormSubmitWasInvalid' message (indicating there was a problem validating the form data).
|
187 |
+
function signalR_OnFormWasInvalid() {
|
188 |
+
//Custom Handler
|
189 |
+
if (debug) {
|
190 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: red">Form Submitted failed Validation - </span>signalR_OnFormWasInvalid() <b>Raised</b>');
|
191 |
+
}
|
192 |
+
jQuery( document.body ).trigger( 'pro-pay-submission-error' );
|
193 |
+
}
|
194 |
+
|
195 |
+
// This function is called when the server signalR issues a 'FormSubmitErrored' message (indicating an error occurred when the user submitted the form).
|
196 |
+
function signalR_OnFormSubmitErrored() {
|
197 |
+
//Custom Handler
|
198 |
+
if (debug) {
|
199 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: red">Form Submission Error - </span>signalR_OnFormSubmitErrored() <b>Raised</b>');
|
200 |
+
}
|
201 |
+
jQuery( document.body ).trigger( 'pro-pay-submission-error' );
|
202 |
+
|
203 |
+
}
|
204 |
+
|
205 |
+
// This function is called when the server signalR issues a 'FormSubmitSucceeded' message (indicating the form was submitted successfully).
|
206 |
+
function signalR_OnFormSubmitSucceeded() {
|
207 |
+
//Custom Handler
|
208 |
+
if (debug) {
|
209 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: Green">Form Submission Succeeded - </span>signalR_OnFormSubmitSucceeded() <b>Raised</b>');
|
210 |
+
}
|
211 |
+
jQuery( document.body ).trigger( 'pro-pay-submission-success' );
|
212 |
+
}
|
213 |
+
|
214 |
+
//This function is called when the timeout period elapses for communication from the Hosted Payment Page to your Checkout Page
|
215 |
+
function signalR_OnFormCommunicationTimeout(){
|
216 |
+
//Custom Handler
|
217 |
+
if (debug) {
|
218 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: Green">Form Submission Succeeded - </span>signalR_OnFormCommunicationTimeout() <b>Raised</b>');
|
219 |
+
}
|
220 |
+
|
221 |
+
jQuery( document.body ).trigger( 'pro-pay-connection-timeout' );
|
222 |
+
}
|
223 |
+
|
224 |
+
//==============================================================================================================================================
|
225 |
+
// The following functions and variables must NOT be modified except by experienced developers. ProPay will not troubleshoot changes made below
|
226 |
+
//==============================================================================================================================================
|
227 |
+
|
228 |
+
var hppURI = baseURI + '/hpp/home/';
|
229 |
+
var signalrURI = baseURI + '/hpp/signalr';
|
230 |
+
var debug = false;
|
231 |
+
|
232 |
+
//Object Reference Variables
|
233 |
+
var Connection;
|
234 |
+
var signalR;
|
235 |
+
var TimeoutTimerId;
|
236 |
+
|
237 |
+
// This function is called to set up and initiate and validate the SignalR Connection, Load the Hosted Payment Page and verify communication into the iFrame
|
238 |
+
function hpp_Load(hostedTransactionIdentifier, debugMode) {
|
239 |
+
if(debugMode){
|
240 |
+
debug = true;
|
241 |
+
}
|
242 |
+
|
243 |
+
// Add missing javascript functionality based on browser
|
244 |
+
fixMissingBrowserFunctionality();
|
245 |
+
|
246 |
+
// Wire up the scripting error handler
|
247 |
+
window.onerror = window_OnError;
|
248 |
+
|
249 |
+
// Wire up the window unload event
|
250 |
+
window.onbeforeunload = signalR_OnUnload;
|
251 |
+
|
252 |
+
// Set local variables
|
253 |
+
hppURI = hppURI + hostedTransactionIdentifier;
|
254 |
+
|
255 |
+
// Setup the connection to the server
|
256 |
+
signalR_SetupConnection(hostedTransactionIdentifier);
|
257 |
+
|
258 |
+
// Connect to the server
|
259 |
+
signalR_Connect();
|
260 |
+
}
|
261 |
+
|
262 |
+
// This sets up the connection with the signalR on the server.
|
263 |
+
function signalR_SetupConnection(HID) {
|
264 |
+
|
265 |
+
// Create a reference to the signalR
|
266 |
+
Connection = jQuery.hubConnection();
|
267 |
+
Connection.url = signalrURI;
|
268 |
+
Connection.qs = { 'hid': HID, 'c': '0' };
|
269 |
+
|
270 |
+
if(debug){
|
271 |
+
jQuery.connection.fn.log = function (message) {
|
272 |
+
echoSignalRConsoleMessage(message);
|
273 |
+
}
|
274 |
+
|
275 |
+
}
|
276 |
+
|
277 |
+
// Get a reference to the signalR Proxy Connection
|
278 |
+
signalR = Connection.createHubProxy('hostedTransaction');
|
279 |
+
|
280 |
+
// Wire up all the SignalR events to local callback methods.
|
281 |
+
Connection.starting(signalR_OnStarting);
|
282 |
+
Connection.received(signalR_OnReceived);
|
283 |
+
Connection.connectionSlow(signalR_OnConnectionSlow);
|
284 |
+
Connection.reconnecting(signalR_OnReconnecting);
|
285 |
+
Connection.reconnected(signalR_OnReconnect);
|
286 |
+
Connection.stateChanged(signalR_OnStateChanged);
|
287 |
+
Connection.disconnected(signalR_OnDisconnect);
|
288 |
+
|
289 |
+
//Wire up all the SignalR Error Handler
|
290 |
+
Connection.error(signalR_OnError);
|
291 |
+
|
292 |
+
// Wire up the client-side function to receive calls from the server
|
293 |
+
signalR.on('ping', signalR_OnPing);
|
294 |
+
signalR.on('formSubmitSucceeded', signalR_OnFormSubmitSucceeded);
|
295 |
+
signalR.on('formSubmitWasInvalid', signalR_OnFormWasInvalid);
|
296 |
+
signalR.on('formSubmitErrored', signalR_OnFormSubmitErrored);
|
297 |
+
}
|
298 |
+
|
299 |
+
// This function starts the signalR and initialize the connection to the server signalR.
|
300 |
+
function signalR_Connect() {
|
301 |
+
if (debug) {
|
302 |
+
echoBrowserMessage('<b style="color: Green">Start: </b><span style="color: blue">Create SignalR Connection</span>');
|
303 |
+
}
|
304 |
+
Connection.start({}, signalR_OnEstablished)
|
305 |
+
.done(signalR_OnConnected)
|
306 |
+
.fail(signalR_OnConnectionFailed);
|
307 |
+
}
|
308 |
+
|
309 |
+
// Invoked after an error occurs with the connection.
|
310 |
+
function signalR_OnError(e, data) {
|
311 |
+
if (e !== null) {
|
312 |
+
var msg = e.message;
|
313 |
+
if (valueIsValid(e) === true) {
|
314 |
+
if (String(e).indexOf('Access is denied') !== -1 && navigator.userAgent.indexOf('MSIE 10.0') !== -1) {
|
315 |
+
msg = e + ' (If you are using IE 10, try pressing F12 and switch the "Browser Mode" or "Document Mode" to "IE9")';
|
316 |
+
} else {
|
317 |
+
msg = e;
|
318 |
+
}
|
319 |
+
}
|
320 |
+
echoBrowserMessage('<b style="color: red">Error Thrown: </b>SignalR Connection Error Message: ' + msg);
|
321 |
+
echoBrowserMessage('<b style="color: red">Error Thrown: </b>Stack: ' + e.stack);
|
322 |
+
}
|
323 |
+
}
|
324 |
+
|
325 |
+
// Invoked when any data is received on the connection from the signalR server.
|
326 |
+
function signalR_OnReceived(e, data) {
|
327 |
+
if (debug) {
|
328 |
+
echoSignalRMessage('<span style="color: blue"><b>SignalR Data Received</b></span><br> <b> • Hub:</b> ' + e.H + '<br> <b> • Method:</b> ' + e.M + '<br> <b> • Callback Id:</b> ' + e.I);
|
329 |
+
}
|
330 |
+
//Unload the iFrame on successful submission
|
331 |
+
if(e.M === 'formSubmitSucceeded'){
|
332 |
+
document.getElementById(iFrameId).src = '';
|
333 |
+
signalR_Disconnect();
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
// Callback funrtion that is invoked on establishing a SignalR server connection this Loads the Hosted Payment Page into the specified iFrame
|
338 |
+
function signalR_OnEstablished() {
|
339 |
+
if (debug) {
|
340 |
+
echoBrowserMessage('<b>Loading Hosted Payment Page</b></span><br> <b> • Hosted Payment Page URL:</b> <u>' + hppURI + '</u><br> <b> • iFrame ID:</b> ' + iFrameId);
|
341 |
+
}
|
342 |
+
var iFrame = document.getElementById(iFrameId);
|
343 |
+
if (iFrame) {
|
344 |
+
iFrame.onload = signalR_OnIFrameLoaded;
|
345 |
+
iFrame.src = hppURI;
|
346 |
+
}
|
347 |
+
else {
|
348 |
+
if (debug) {
|
349 |
+
echoBrowserMessage('<b style="color: red">Error Thrown: </b>Unable to locate an iFrame with element ID: ' + iFrameId);
|
350 |
+
}
|
351 |
+
}
|
352 |
+
}
|
353 |
+
|
354 |
+
// Invoked when the Hosted Payment Page in the specified iFrame has loaded.
|
355 |
+
// The Hosted Payment Page onLoad() Event sends a Ping Request through the SignalR Connection to this Page
|
356 |
+
// A Timeout is set for connection errors from the Hosted Payment Page to the SignalR Server
|
357 |
+
function signalR_OnIFrameLoaded() {
|
358 |
+
if (debug) {
|
359 |
+
echoBrowserMessage('<span style="color: blue"><b>Hosted Payment Page Form Loaded</b> - </span>Waiting for Ping Request From Hosted Payment Page Through SignalR Server<br> <b> •</b>Setting Ping Request Timout Timer to:<b> ' + TimeoutInterval + "ms</b>");
|
360 |
+
}
|
361 |
+
TimeoutTimerId = window.setTimeout(signalR_OnTimeout, TimeoutInterval);
|
362 |
+
}
|
363 |
+
|
364 |
+
// This function is invoked when the timer times out This indicates the Hosted Payment Page failed to send a Ping Request through the SignalR Server Connection.
|
365 |
+
// This indicates a problem with the connection of the Hosted Payment Page to the SignalR Server
|
366 |
+
function signalR_OnTimeout() {
|
367 |
+
if (debug) {
|
368 |
+
echoBrowserMessage('<b style="color: red">Error Thrown: </b>Failed to Receive Ping Request after: <b>' + TimeoutInterval + 'ms</b> Raising <b>formCommunicationTimeout</b>');
|
369 |
+
}
|
370 |
+
signalR_OnFormCommunicationTimeout();
|
371 |
+
signalR_Disconnect();
|
372 |
+
}
|
373 |
+
|
374 |
+
// This function is called when the SignalR server sends the 'Ping' message indicated the Hosted Payment Page is Connected to it.
|
375 |
+
function signalR_OnPing(e, data) {
|
376 |
+
if (debug) {
|
377 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: Blue">SignalR Server Ping Recieved - </span>Hosted Payment Page Connected to SignalR Server<br> <b> •</b>Sending Pong Response <br> <b> •</b>Stopping Ping Request Timout Timer');
|
378 |
+
|
379 |
+
}
|
380 |
+
|
381 |
+
if (TimeoutTimerId && valueIsNumeric(TimeoutTimerId) === true) {
|
382 |
+
window.clearTimeout(TimeoutTimerId);
|
383 |
+
TimeoutTimerId = undefined;
|
384 |
+
}
|
385 |
+
|
386 |
+
signalR.invoke('pong');
|
387 |
+
|
388 |
+
if(debug){
|
389 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: blue">Form Ready For Submission</span> Raising <b>formIsReadyToSubmit()</b>');
|
390 |
+
}
|
391 |
+
|
392 |
+
formIsReadyToSubmit();
|
393 |
+
}
|
394 |
+
|
395 |
+
// This function sends a 'SubmitForm' message from the parent page to the server signalR... which relays a 'SubmitForm' message to the child page.
|
396 |
+
function signalR_SubmitForm() {
|
397 |
+
if (debug) {
|
398 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: blue">Submit Form Method Invoked - </span>Sending Message to SignalRServer');
|
399 |
+
}
|
400 |
+
|
401 |
+
signalR.invoke('submitForm');
|
402 |
+
}
|
403 |
+
|
404 |
+
// Invoked when the page is unloaded to disconnect from the server.
|
405 |
+
function signalR_OnUnload() {
|
406 |
+
if (debug) {
|
407 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: blue">Page Unloading');
|
408 |
+
}
|
409 |
+
|
410 |
+
signalR_Disconnect();
|
411 |
+
}
|
412 |
+
|
413 |
+
// This function stops the communication with the server signalR.
|
414 |
+
function signalR_Disconnect() {
|
415 |
+
if (debug) {
|
416 |
+
echoBrowserMessage('<b style="color: gold">Event: </b><span style="color: red">SignalR Connection Disconnecting</span>');
|
417 |
+
}
|
418 |
+
|
419 |
+
var iFrame = document.getElementById(iFrameId);
|
420 |
+
if (iFrame) {
|
421 |
+
iFrame.onload = null;
|
422 |
+
}
|
423 |
+
|
424 |
+
// If the Hosted Payment Page Communication Timer is active disable it.
|
425 |
+
if (TimeoutTimerId && valueIsNumeric(TimeoutTimerId) === true) {
|
426 |
+
window.clearTimeout(TimeoutTimerId);
|
427 |
+
TimeoutTimerId = undefined;
|
428 |
+
}
|
429 |
+
|
430 |
+
// The 1st parameter of the 'stop' method is whether or not to asynchronously abort the connection.
|
431 |
+
// The 2nd parameter of the 'stop' method is whether we want to notify the server that we are aborting the connection.
|
432 |
+
Connection.stop(false, true);
|
433 |
+
}
|
434 |
+
|
435 |
+
// Gets a human readable string for the specified connection state ID
|
436 |
+
function getStateName(state) {
|
437 |
+
switch (state) {
|
438 |
+
case 0 : return 'Connecting';
|
439 |
+
case 1 : return 'Connected';
|
440 |
+
case 2 : return 'Reconnecting';
|
441 |
+
case 4 : return 'Disconnected';
|
442 |
+
default: return 'Unkown(' + state + ')';
|
443 |
+
}
|
444 |
+
}
|
445 |
+
|
446 |
+
//This function checks if the value is Numberic
|
447 |
+
function valueIsNumeric(value) {
|
448 |
+
return !isNaN(parseFloat(value)) && isFinite(value);
|
449 |
+
}
|
450 |
+
|
451 |
+
//The function checks if the value passed is not empty
|
452 |
+
function valueIsValid(value) {
|
453 |
+
return (value && value !== '' && value.trim !== '');
|
454 |
+
}
|
wpsc-components/merchant-core-v3/libraries/pro-pay/js/pro-pay-admin.js
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*global ajaxurl*/
|
2 |
+
window.WPSC_Pro_Pay = window.WPSC_Pro_Pay || {};
|
3 |
+
|
4 |
+
( function( window, document, $, wpsc, ajaxurl, undefined ) {
|
5 |
+
'use strict';
|
6 |
+
|
7 |
+
var $c = {};
|
8 |
+
|
9 |
+
var pro_pay = {
|
10 |
+
$ : $c
|
11 |
+
};
|
12 |
+
|
13 |
+
pro_pay.cache = function() {
|
14 |
+
$c.body = $( document.body );
|
15 |
+
$c.wrapper = $( '#wpsc-payment-gateway-settings' );
|
16 |
+
$c.spinner = $c.wrapper.find( '.spinner' );
|
17 |
+
};
|
18 |
+
|
19 |
+
pro_pay.init = function() {
|
20 |
+
|
21 |
+
pro_pay.cache();
|
22 |
+
|
23 |
+
$c.wrapper.on( 'click', '.create-merchant-profile', pro_pay.create_merchant_profile );
|
24 |
+
$c.body.on( 'wpsc-payment-gateway-settings-form-loaded', pro_pay.init );
|
25 |
+
};
|
26 |
+
|
27 |
+
pro_pay.create_merchant_profile = function( e ) {
|
28 |
+
e.preventDefault();
|
29 |
+
|
30 |
+
var data = {
|
31 |
+
action : 'propay_create_merchant_profile_id',
|
32 |
+
nonce : wpsc.merchant_profile_nonce
|
33 |
+
};
|
34 |
+
|
35 |
+
$c.spinner.css( 'visibility', 'visible' );
|
36 |
+
|
37 |
+
var success = function(response) {
|
38 |
+
if ( response.success ) {
|
39 |
+
$( '#wpsc-pro-pay-merchant-profile-id' ).val( response.data.profile_id );
|
40 |
+
$( '#wpsc-propay-merchant-profile-create' ).html( '<p>' + wpsc.profile_id_success_text + '</p>' );
|
41 |
+
} else {
|
42 |
+
$( '#wpsc-propay-merchant-profile-create' ).html( '<p>' + wpsc.profile_id_error_text + '</p>' );
|
43 |
+
}
|
44 |
+
$c.spinner.fadeOut( 350 );
|
45 |
+
};
|
46 |
+
|
47 |
+
$.post( ajaxurl, data, success, 'json' );
|
48 |
+
};
|
49 |
+
|
50 |
+
$( pro_pay.init );
|
51 |
+
|
52 |
+
} )( window, document, jQuery, window.WPSC_Pro_Pay, ajaxurl );
|
wpsc-components/merchant-core-v3/libraries/pro-pay/js/pro-pay-checkout.js
ADDED
@@ -0,0 +1,273 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
1 |
+
/*global hpp_Load, signalR_SubmitForm */
|
2 |
+
window.WPSC_Pro_Pay_Checkout = window.WPSC_Pro_Pay_Checkout || {};
|
3 |
+
|
4 |
+
( function( window, document, $, wpsc, undefined ) {
|
5 |
+
'use strict';
|
6 |
+
|
7 |
+
var $c = {};
|
8 |
+
|
9 |
+
var pro_pay = {
|
10 |
+
$ : $c
|
11 |
+
};
|
12 |
+
|
13 |
+
pro_pay.cache = function() {
|
14 |
+
$c.body = $( document.body );
|
15 |
+
$c.tev1_wrapper = $( 'form.wpsc_checkout_forms' );
|
16 |
+
$c.tev2_wrapper = $( '#wpsc-checkout-form' );
|
17 |
+
$c.iframe = $( '#pro_pay_iframe' );
|
18 |
+
$c.v1 = $c.tev1_wrapper.length;
|
19 |
+
$c.purchase_spinner = $( '.wpsc-purchase-loader-container' );
|
20 |
+
|
21 |
+
if ( $c.v1 ) {
|
22 |
+
$c.wrapper = $c.tev1_wrapper;
|
23 |
+
$c.buy_button_container = $( '.wpsc_make_purchase' );
|
24 |
+
$c.buy_button = $( '.wpsc_buy_button' );
|
25 |
+
} else {
|
26 |
+
$c.wrapper = $c.tev2_wrapper;
|
27 |
+
$c.buy_button_container = $( '.wpsc-form-actions' );
|
28 |
+
$c.buy_button = $( '.wpsc-field-wpsc_submit_checkout' );
|
29 |
+
}
|
30 |
+
|
31 |
+
pro_pay.purchase_spinner();
|
32 |
+
pro_pay.payment_method_spinner();
|
33 |
+
pro_pay.iframe();
|
34 |
+
};
|
35 |
+
|
36 |
+
pro_pay.iframe = function() {
|
37 |
+
$c.iframe.insertBefore( $c.buy_button_container ).hide();
|
38 |
+
};
|
39 |
+
|
40 |
+
pro_pay.purchase_spinner = function() {
|
41 |
+
|
42 |
+
if ( $c.v1 ) {
|
43 |
+
$c.purchase_spinner.css( { 'position' : 'relative' } );
|
44 |
+
} else {
|
45 |
+
$c.buy_button_container.css( 'position', 'relative' );
|
46 |
+
}
|
47 |
+
|
48 |
+
$c.purchase_spinner.prependTo( $c.buy_button_container );
|
49 |
+
$c.purchase_spinner.css( {
|
50 |
+
'height' : $c.buy_button.css( 'height' ),
|
51 |
+
'width' : $c.buy_button.css( 'width' ),
|
52 |
+
'background-color' : $c.buy_button.css( 'background-color' ),
|
53 |
+
'top' : $c.buy_button_container.css( 'padding-top' )
|
54 |
+
} );
|
55 |
+
};
|
56 |
+
|
57 |
+
pro_pay.payment_method_spinner = function() {
|
58 |
+
$c.spinner = $c.wrapper.find( '.spinner' );
|
59 |
+
};
|
60 |
+
|
61 |
+
/**
|
62 |
+
* This works great in initial tev2 testing, but it's off in tev1.
|
63 |
+
* Needs some tweaking.
|
64 |
+
*
|
65 |
+
* @return {[type]} [description]
|
66 |
+
*/
|
67 |
+
pro_pay.toggle_purchase_spinner = function() {
|
68 |
+
$c.buy_button.fadeToggle( 150 );
|
69 |
+
$c.purchase_spinner.fadeToggle( 150 );
|
70 |
+
};
|
71 |
+
|
72 |
+
pro_pay.init = function() {
|
73 |
+
|
74 |
+
pro_pay.cache();
|
75 |
+
|
76 |
+
$c.wrapper.on( 'change', 'input[name="custom_gateway"], .wpsc-field-wpsc_payment_method input', pro_pay.create_payer_id );
|
77 |
+
$( document ).on( 'ready' , pro_pay.create_payer_id );
|
78 |
+
$c.body.on( 'pro-pay-submission-success' , pro_pay.hosted_results );
|
79 |
+
$c.body.on( 'pro-pay-connected' , pro_pay.toggle_iframe_class );
|
80 |
+
$c.body.on( 'pro-pay-submission-error' , pro_pay.toggle_purchase_spinner );
|
81 |
+
|
82 |
+
};
|
83 |
+
|
84 |
+
pro_pay.toggle_iframe_class = function() {
|
85 |
+
$c.iframe.toggleClass( 'loaded' );
|
86 |
+
};
|
87 |
+
|
88 |
+
pro_pay.get_customer_data = function() {
|
89 |
+
|
90 |
+
var first_name,
|
91 |
+
last_name,
|
92 |
+
address,
|
93 |
+
address1,
|
94 |
+
address2,
|
95 |
+
city,
|
96 |
+
state,
|
97 |
+
zip,
|
98 |
+
country,
|
99 |
+
email;
|
100 |
+
|
101 |
+
if ( $c.v1 ) {
|
102 |
+
email = $( 'input[data-wpsc-meta-key="billingemail"].text' ).val();
|
103 |
+
first_name = $( 'input[data-wpsc-meta-key="billingfirstname"].text' ).val();
|
104 |
+
last_name = $( 'input[data-wpsc-meta-key="billinglastname"].text' ).val();
|
105 |
+
address = $( 'textarea[data-wpsc-meta-key="billingaddress"].text' ).val();
|
106 |
+
address1 = address.split( "\n" )[0];
|
107 |
+
address2 = address.split( "\n" )[1] || '';
|
108 |
+
city = $( 'input[data-wpsc-meta-key="billingcity"].text' ).val();
|
109 |
+
state = $( 'select[data-wpsc-meta-key="billingregion"]' ).val();
|
110 |
+
zip = $( 'input[data-wpsc-meta-key="billingpostcode"].text' ).val();
|
111 |
+
country = $( 'select[data-wpsc-meta-key="billingcountry"]' ).val();
|
112 |
+
} else {
|
113 |
+
email = wpsc.checkout_data.billingemail;
|
114 |
+
first_name = wpsc.checkout_data.billingfirstname;
|
115 |
+
last_name = wpsc.checkout_data.billinglastname;
|
116 |
+
address = wpsc.checkout_data.billingaddress;
|
117 |
+
address1 = address.split( "\n" )[0];
|
118 |
+
address2 = address.split( "\n" )[1] || '';
|
119 |
+
city = wpsc.checkout_data.billingcity;
|
120 |
+
state = wpsc.checkout_data.billingregion;
|
121 |
+
zip = wpsc.checkout_data.billingpostcode;
|
122 |
+
country = wpsc.checkout_data.billingcountry;
|
123 |
+
}
|
124 |
+
|
125 |
+
return {
|
126 |
+
email : email,
|
127 |
+
first_name : first_name,
|
128 |
+
last_name : last_name,
|
129 |
+
address1 : address1 ,
|
130 |
+
address2 : address2,
|
131 |
+
city : city,
|
132 |
+
state : state,
|
133 |
+
zip : zip,
|
134 |
+
country : country
|
135 |
+
};
|
136 |
+
};
|
137 |
+
|
138 |
+
pro_pay.create_payer_id = function() {
|
139 |
+
var val = $( 'input[name="custom_gateway"]:checked, .wpsc-field-wpsc_payment_method input:checked' ).val();
|
140 |
+
|
141 |
+
if ( $c.v1 && val == null ) {
|
142 |
+
val = $( 'input[name="custom_gateway"]' ).val();
|
143 |
+
}
|
144 |
+
|
145 |
+
if ( 'pro-pay' !== val ) {
|
146 |
+
$c.wrapper.off( 'submit', pro_pay.generate_hosted_id );
|
147 |
+
$c.buy_button.prop( 'disabled', false );
|
148 |
+
return;
|
149 |
+
} else {
|
150 |
+
$c.wrapper.on( 'submit', function() {
|
151 |
+
pro_pay.toggle_purchase_spinner();
|
152 |
+
pro_pay.generate_hosted_id();
|
153 |
+
$c.buy_button.prop( 'disabled', true );
|
154 |
+
return false;
|
155 |
+
} );
|
156 |
+
}
|
157 |
+
|
158 |
+
|
159 |
+
if ( '' === pro_pay.get_customer_data().first_name || '' === pro_pay.get_customer_data().last_name || '' === pro_pay.get_customer_data().email ) {
|
160 |
+
return;
|
161 |
+
}
|
162 |
+
|
163 |
+
$c.spinner.fadeIn().css( 'display', 'inline-block' );
|
164 |
+
|
165 |
+
var data = {
|
166 |
+
action : 'create_payer_id',
|
167 |
+
nonce : wpsc.checkout_nonce,
|
168 |
+
name : pro_pay.get_customer_data().first_name + ' ' + pro_pay.get_customer_data().last_name,
|
169 |
+
email : pro_pay.get_customer_data().email
|
170 |
+
};
|
171 |
+
|
172 |
+
var success = function(response) {
|
173 |
+
if ( response.success ) {
|
174 |
+
$c.spinner.fadeOut( 350 );
|
175 |
+
} else {
|
176 |
+
window.console.log( response );
|
177 |
+
}
|
178 |
+
};
|
179 |
+
|
180 |
+
$.post( wpsc.ajaxurl, data, success, 'json' );
|
181 |
+
};
|
182 |
+
|
183 |
+
pro_pay.generate_hosted_id = function() {
|
184 |
+
|
185 |
+
var data = {
|
186 |
+
action : 'create_hosted_transaction_id',
|
187 |
+
nonce : wpsc.checkout_nonce,
|
188 |
+
name : pro_pay.get_customer_data().first_name + ' ' + pro_pay.get_customer_data().last_name,
|
189 |
+
address1 : pro_pay.get_customer_data().address1,
|
190 |
+
address2 : pro_pay.get_customer_data().address2,
|
191 |
+
city : pro_pay.get_customer_data().city,
|
192 |
+
state : pro_pay.get_customer_data().state,
|
193 |
+
zip : pro_pay.get_customer_data().zip,
|
194 |
+
country : pro_pay.get_customer_data().country
|
195 |
+
};
|
196 |
+
|
197 |
+
var success = function(response) {
|
198 |
+
if ( response.success ) {
|
199 |
+
pro_pay.toggle_purchase_spinner();
|
200 |
+
$c.hosted_id = response.data.token;
|
201 |
+
|
202 |
+
hpp_Load( response.data.token, wpsc.debug );
|
203 |
+
|
204 |
+
$c.iframe.slideDown();
|
205 |
+
|
206 |
+
$c.wrapper.off( 'submit' );
|
207 |
+
|
208 |
+
$c.wrapper.on( 'submit', function( e ) {
|
209 |
+
e.preventDefault();
|
210 |
+
pro_pay.toggle_purchase_spinner();
|
211 |
+
signalR_SubmitForm();
|
212 |
+
return false;
|
213 |
+
} );
|
214 |
+
|
215 |
+
} else {
|
216 |
+
window.console.log( response );
|
217 |
+
}
|
218 |
+
};
|
219 |
+
|
220 |
+
$.post( wpsc.ajaxurl, data, success, 'json' );
|
221 |
+
|
222 |
+
return false;
|
223 |
+
};
|
224 |
+
|
225 |
+
pro_pay.hosted_results = function() {
|
226 |
+
|
227 |
+
$c.iframe.slideUp();
|
228 |
+
|
229 |
+
var data = {
|
230 |
+
action : 'create_hosted_results',
|
231 |
+
nonce : wpsc.checkout_nonce,
|
232 |
+
hosted_id : $c.hosted_id
|
233 |
+
};
|
234 |
+
|
235 |
+
var success = function(response) {
|
236 |
+
if ( response.success && 'SUCCESS' === response.data.results.response.Result.ResultValue ) {
|
237 |
+
var transaction = response.data.results.response.HostedTransaction;
|
238 |
+
|
239 |
+
$c.wrapper.off( 'submit' );
|
240 |
+
$c.wrapper.append( '<input id="pro-pay-payment-method-token" type="hidden" name="pro_pay_payment_method_token" />' );
|
241 |
+
$c.wrapper.append( '<input id="pro-pay-transaction-id" type="hidden" name="pro_pay_transaction_id" />' );
|
242 |
+
$c.wrapper.append( '<input id="pro-pay-acct-number" type="hidden" name="pro_pay_obfs_acct_number" />' );
|
243 |
+
$c.wrapper.append( '<input id="pro-pay-type" type="hidden" name="pro_pay_card_type" />' );
|
244 |
+
$( '#pro-pay-payment-method-token' ).val( transaction.PaymentMethodInfo.PaymentMethodID );
|
245 |
+
$( '#pro-pay-transaction-id' ).val( transaction.TransactionHistoryId );
|
246 |
+
$( '#pro-pay-acct-number' ).val( transaction.PaymentMethodInfo.ObfuscatedAccountNumber );
|
247 |
+
$( '#pro-pay-type' ).val( transaction.PaymentMethodInfo.PaymentMethodType );
|
248 |
+
|
249 |
+
$c.wrapper.submit();
|
250 |
+
} else {
|
251 |
+
pro_pay.toggle_purchase_spinner();
|
252 |
+
window.console.log( response );
|
253 |
+
}
|
254 |
+
};
|
255 |
+
|
256 |
+
$.post( wpsc.ajaxurl, data, success, 'json' );
|
257 |
+
|
258 |
+
return false;
|
259 |
+
};
|
260 |
+
|
261 |
+
wpsc.enable_buy_buttons = function() {
|
262 |
+
$c.buy_button.prop( 'disabled', false );
|
263 |
+
};
|
264 |
+
|
265 |
+
wpsc.toggle_purchase_spinner = pro_pay.toggle_purchase_spinner;
|
266 |
+
|
267 |
+
$( pro_pay.init );
|
268 |
+
|
269 |
+
} )( window, document, jQuery, window.WPSC_Pro_Pay_Checkout );
|
270 |
+
|
271 |
+
function formIsReadyToSubmit() {
|
272 |
+
window.WPSC_Pro_Pay_Checkout.enable_buy_buttons();
|
273 |
+
}
|
wpsc-components/merchant-core-v3/libraries/pro-pay/js/signal-r.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* ASP.NET SignalR JavaScript Library v2.2.0
|
3 |
+
* http://signalr.net/
|
4 |
+
*
|
5 |
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
(function(n,t,i){function w(t,i){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(f)==="string"&&r.transports[f]||(i.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(i.log("No transports remain within the specified transport array."),t=null)}else if(r.transports[t]||t==="auto"){if(t==="auto"&&r._.ieVersion<=8)return["longPolling"]}else i.log("Invalid transport: "+t.toString()+"."),t=null;return t}function b(n){return n==="http:"?80:n==="https:"?443:void 0}function a(n,t){return t.match(/:\d+$/)?t:t+":"+b(n)}function k(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1};u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())};u.clear=function(){r=[]}}var f={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorDuringStartRequest:"Error during start request. Stopping the connection.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server. Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection."};if(typeof n!="function")throw new Error(f.nojQuery);var r,h,s=t.document.readyState==="complete",e=n(t),c="__Negotiate Aborted__",u={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},v=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},o=function(t,i,r){return i===t.state?(t.state=r,n(t).triggerHandler(u.onStateChanged,[{oldState:i,newState:r}]),!0):!1},y=function(n){return n.state===r.connectionState.disconnected},l=function(n){return n._.keepAliveData.activated&&n.transport.supportsKeepAlive(n)},p=function(i){var f,e;i._.configuredStopReconnectingTimeout||(e=function(t){var i=r._.format(r.resources.reconnectTimeout,t.disconnectTimeout);t.log(i);n(t).triggerHandler(u.onError,[r._.error(i,"TimeoutException")]);t.stop(!1,!1)},i.reconnecting(function(){var n=this;n.state===r.connectionState.reconnecting&&(f=t.setTimeout(function(){e(n)},n.disconnectTimeout))}),i.stateChanged(function(n){n.oldState===r.connectionState.reconnecting&&t.clearTimeout(f)}),i._.configuredStopReconnectingTimeout=!0)};r=function(n,t,i){return new r.fn.init(n,t,i)};r._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var i,n;return t.navigator.appName==="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}(),error:function(n,t,i){var r=new Error(n);return r.source=t,typeof i!="undefined"&&(r.context=i),r},transportError:function(n,t,r,u){var f=this.error(n,r,u);return f.transport=t?t.name:i,f},format:function(){for(var t=arguments[0],n=0;n<arguments.length-1;n++)t=t.replace("{"+n+"}",arguments[n+1]);return t},firefoxMajorVersion:function(n){var t=n.match(/Firefox\/(\d+)/);return!t||!t.length||t.length<2?0:parseInt(t[1],10)},configurePingInterval:function(i){var f=i._.config,e=function(t){n(i).triggerHandler(u.onError,[t])};f&&!i._.pingIntervalId&&f.pingInterval&&(i._.pingIntervalId=t.setInterval(function(){r.transports._logic.pingServer(i).fail(e)},f.pingInterval))}};r.events=u;r.resources=f;r.ajaxDefaults={processData:!0,timeout:null,async:!0,global:!1,cache:!1};r.changeState=o;r.isDisconnecting=y;r.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4};r.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.");}};e.load(function(){s=!0});r.fn=r.prototype={init:function(t,i,r){var f=n(this);this.url=t;this.qs=i;this.lastError=null;this._={keepAliveData:{},connectingMessageBuffer:new k(this,function(n){f.triggerHandler(u.onReceived,[n])}),lastMessageAt:(new Date).getTime(),lastActiveAt:(new Date).getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0};typeof r=="boolean"&&(this.logging=r)},_parseResponse:function(n){var t=this;return n?typeof n=="string"?t.json.parse(n):n:n},_originalJson:t.JSON,json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),r=r||t.location,i.indexOf("http")!==0)?!1:(u=t.document.createElement("a"),u.href=i,u.protocol+a(u.protocol,u.host)!==r.protocol+a(r.protocol,r.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:r.connectionState.disconnected,clientProtocol:"1.5",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(i,h){var a=this,v={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},d,y=a._deferral||n.Deferred(),b=t.document.createElement("a"),k,g;if(a.lastError=null,a._deferral=y,!a.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(n.type(i)==="function"?h=i:n.type(i)==="object"&&(n.extend(v,i),n.type(v.callback)==="function"&&(h=v.callback)),v.transport=w(v.transport,a),!v.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");return(a._.config=v,!s&&v.waitForPageLoad===!0)?(a._.deferredStartHandler=function(){a.start(i,h)},e.bind("load",a._.deferredStartHandler),y.promise()):a.state===r.connectionState.connecting?y.promise():o(a,r.connectionState.disconnected,r.connectionState.connecting)===!1?(y.resolve(a),y.promise()):(p(a),b.href=a.url,b.protocol&&b.protocol!==":"?(a.protocol=b.protocol,a.host=b.host):(a.protocol=t.document.location.protocol,a.host=b.host||t.document.location.host),a.baseUrl=a.protocol+"//"+a.host,a.wsProtocol=a.protocol==="https:"?"wss://":"ws://",v.transport==="auto"&&v.jsonp===!0&&(v.transport="longPolling"),a.url.indexOf("//")===0&&(a.url=t.location.protocol+a.url,a.log("Protocol relative URL detected, normalizing it to '"+a.url+"'.")),this.isCrossDomain(a.url)&&(a.log("Auto detected cross domain url."),v.transport==="auto"&&(v.transport=["webSockets","serverSentEvents","longPolling"]),typeof v.withCredentials=="undefined"&&(v.withCredentials=!0),v.jsonp||(v.jsonp=!n.support.cors,v.jsonp&&a.log("Using jsonp because this browser doesn't support CORS.")),a.contentType=r._.defaultContentType),a.withCredentials=v.withCredentials,a.ajaxDataType=v.jsonp?"jsonp":"text",n(a).bind(u.onStart,function(){n.type(h)==="function"&&h.call(a);y.resolve(a)}),a._.initHandler=r.transports._logic.initHandler(a),d=function(i,s){var c=r._.error(f.noTransportOnInit);if(s=s||0,s>=i.length){s===0?a.log("No transports supported by the server were selected."):s===1?a.log("No fallback transports were selected."):a.log("Fallback transports exhausted.");n(a).triggerHandler(u.onError,[c]);y.reject(c);a.stop();return}if(a.state!==r.connectionState.disconnected){var p=i[s],h=r.transports[p],v=function(){d(i,s+1)};a.transport=h;try{a._.initHandler.start(h,function(){var i=r._.firefoxMajorVersion(t.navigator.userAgent)>=11,f=!!a.withCredentials&&i;a.log("The start request succeeded. Transitioning to the connected state.");l(a)&&r.transports._logic.monitorKeepAlive(a);r.transports._logic.startHeartbeat(a);r._.configurePingInterval(a);o(a,r.connectionState.connecting,r.connectionState.connected)||a.log("WARNING! The connection was not in the connecting state.");a._.connectingMessageBuffer.drain();n(a).triggerHandler(u.onStart);e.bind("unload",function(){a.log("Window unloading, stopping the connection.");a.stop(f)});i&&e.bind("beforeunload",function(){t.setTimeout(function(){a.stop(f)},0)})},v)}catch(w){a.log(h.name+" transport threw '"+w.message+"' when attempting to start.");v()}}},k=a.url+"/negotiate",g=function(t,i){var e=r._.error(f.errorOnNegotiate,t,i._.negotiateRequest);n(i).triggerHandler(u.onError,e);y.reject(e);i.stop()},n(a).triggerHandler(u.onStarting),k=r.transports._logic.prepareQueryString(a,k),a.log("Negotiating with '"+k+"'."),a._.negotiateRequest=r.transports._logic.ajax(a,{url:k,error:function(n,t){t!==c?g(n,a):y.reject(r._.error(f.stoppedWhileNegotiating,null,a._.negotiateRequest))},success:function(t){var i,e,h,o=[],s=[];try{i=a._parseResponse(t)}catch(c){g(r._.error(f.errorParsingNegotiateResponse,c),a);return}if(e=a._.keepAliveData,a.appRelativeUrl=i.Url,a.id=i.ConnectionId,a.token=i.ConnectionToken,a.webSocketServerUrl=i.WebSocketServerUrl,a._.pollTimeout=i.ConnectionTimeout*1e3+1e4,a.disconnectTimeout=i.DisconnectTimeout*1e3,a._.totalTransportConnectTimeout=a.transportConnectTimeout+i.TransportConnectTimeout*1e3,i.KeepAliveTimeout?(e.activated=!0,e.timeout=i.KeepAliveTimeout*1e3,e.timeoutWarning=e.timeout*a.keepAliveWarnAt,a._.beatInterval=(e.timeout-e.timeoutWarning)/3):e.activated=!1,a.reconnectWindow=a.disconnectTimeout+(e.timeout||0),!i.ProtocolVersion||i.ProtocolVersion!==a.clientProtocol){h=r._.error(r._.format(f.protocolIncompatible,a.clientProtocol,i.ProtocolVersion));n(a).triggerHandler(u.onError,[h]);y.reject(h);return}n.each(r.transports,function(n){if(n.indexOf("_")===0||n==="webSockets"&&!i.TryWebSockets)return!0;s.push(n)});n.isArray(v.transport)?n.each(v.transport,function(t,i){n.inArray(i,s)>=0&&o.push(i)}):v.transport==="auto"?o=s:n.inArray(v.transport,s)>=0&&o.push(v.transport);d(o)}}),y.promise())},starting:function(t){var i=this;return n(i).bind(u.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===r.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(t.state===r.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(u.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(u.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(u.onError,function(n,r,u){i.lastError=r;t.call(i,r,u)}),i},disconnected:function(t){var i=this;return n(i).bind(u.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(u.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(u.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(u.onReconnect,function(){t.call(i)}),i},stop:function(i,h){var a=this,v=a._deferral;if(a._.deferredStartHandler&&e.unbind("load",a._.deferredStartHandler),delete a._.config,delete a._.deferredStartHandler,!s&&(!a._.config||a._.config.waitForPageLoad===!0)){a.log("Stopping connection prior to negotiate.");v&&v.reject(r._.error(f.stoppedWhileLoading));return}if(a.state!==r.connectionState.disconnected)return a.log("Stopping connection."),o(a,a.state,r.connectionState.disconnected),t.clearTimeout(a._.beatHandle),t.clearInterval(a._.pingIntervalId),a.transport&&(a.transport.stop(a),h!==!1&&a.transport.abort(a,i),l(a)&&r.transports._logic.stopMonitoringKeepAlive(a),a.transport=null),a._.negotiateRequest&&(a._.negotiateRequest.abort(c),delete a._.negotiateRequest),a._.initHandler&&a._.initHandler.stop(),n(a).triggerHandler(u.onDisconnect),delete a._deferral,delete a.messageId,delete a.groupsToken,delete a.id,delete a._.pingIntervalId,delete a._.lastMessageAt,delete a._.lastActiveAt,a._.connectingMessageBuffer.clear(),a},log:function(n){v(n,this.logging)}};r.fn.init.prototype=r.fn;r.noConflict=function(){return n.connection===r&&(n.connection=h),r};n.connection&&(h=n.connection);n.connection=n.signalR=r})(window.jQuery,window),function(n,t,i){function s(n){n._.keepAliveData.monitoring&&l(n);u.markActive(n)&&(n._.beatHandle=t.setTimeout(function(){s(n)},n._.beatInterval))}function l(t){var i=t._.keepAliveData,u;t.state===r.connectionState.connected&&(u=(new Date).getTime()-t._.lastMessageAt,u>=i.timeout?(t.log("Keep alive timed out. Notifying transport that connection has been lost."),t.transport.lostConnection(t)):u>=i.timeoutWarning?i.userNotified||(t.log("Keep alive has been missed, connection may be dead/slow."),n(t).triggerHandler(f.onConnectionSlow),i.userNotified=!0):i.userNotified=!1)}function e(n,t){var i=n.url+t;return n.transport&&(i+="?transport="+n.transport.name),u.prepareQueryString(n,i)}function h(n){this.connection=n;this.startRequested=!1;this.startCompleted=!1;this.connectionStopped=!1}var r=n.signalR,f=n.signalR.events,c=n.signalR.changeState,o="__Start Aborted__",u;r.transports={};h.prototype={start:function(n,r,u){var f=this,e=f.connection,o=!1;if(f.startRequested||f.connectionStopped){e.log("WARNING! "+n.name+" transport cannot be started. Initialization ongoing or completed.");return}e.log(n.name+" transport starting.");f.transportTimeoutHandle=t.setTimeout(function(){o||(o=!0,e.log(n.name+" transport timed out when trying to connect."),f.transportFailed(n,i,u))},e._.totalTransportConnectTimeout);n.start(e,function(){o||f.initReceived(n,r)},function(t){return o||(o=!0,f.transportFailed(n,t,u)),!f.startCompleted||f.connectionStopped})},stop:function(){this.connectionStopped=!0;t.clearTimeout(this.transportTimeoutHandle);r.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(n,i){var u=this,f=u.connection;if(u.startRequested){f.log("WARNING! The client received multiple init messages.");return}u.connectionStopped||(u.startRequested=!0,t.clearTimeout(u.transportTimeoutHandle),f.log(n.name+" transport connected. Initiating start request."),r.transports._logic.ajaxStart(f,function(){u.startCompleted=!0;i()}))},transportFailed:function(i,u,e){var o=this.connection,h=o._deferral,s;this.connectionStopped||(t.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||(s=r._.error(r.resources.errorDuringStartRequest,u),o.log(i.name+" transport failed during the start request. Stopping the connection."),n(o).triggerHandler(f.onError,[s]),h&&h.reject(s),o.stop()):(i.stop(o),o.log(i.name+" transport failed to connect. Attempting to fall back."),e()))}};u=r.transports._logic={ajax:function(t,i){return n.ajax(n.extend(!0,{},n.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:t.withCredentials},contentType:t.contentType,dataType:t.ajaxDataType},i))},pingServer:function(t){var e,f,i=n.Deferred();return t.transport?(e=t.url+"/ping",e=u.addQs(e,t.qs),f=u.ajax(t,{url:e,success:function(n){var u;try{u=t._parseResponse(n)}catch(e){i.reject(r._.transportError(r.resources.pingServerFailedParse,t.transport,e,f));t.stop();return}u.Response==="pong"?i.resolve():i.reject(r._.transportError(r._.format(r.resources.pingServerFailedInvalidResponse,n),t.transport,null,f))},error:function(n){n.status===401||n.status===403?(i.reject(r._.transportError(r._.format(r.resources.pingServerFailedStatusCode,n.status),t.transport,n,f)),t.stop()):i.reject(r._.transportError(r.resources.pingServerFailed,t.transport,n,f))}})):i.reject(r._.transportError(r.resources.noConnectionTransport,t.transport)),i.promise()},prepareQueryString:function(n,i){var r;return r=u.addQs(i,"clientProtocol="+n.clientProtocol),r=u.addQs(r,n.qs),n.token&&(r+="&connectionToken="+t.encodeURIComponent(n.token)),n.data&&(r+="&connectionData="+t.encodeURIComponent(n.data)),r},addQs:function(t,i){var r=t.indexOf("?")!==-1?"&":"?",u;if(!i)return t;if(typeof i=="object")return t+r+n.param(i);if(typeof i=="string")return u=i.charAt(0),(u==="?"||u==="&")&&(r=""),t+r+i;throw new Error("Query string property must be either a string or object.");},getUrl:function(n,i,r,f,e){var h=i==="webSockets"?"":n.baseUrl,o=h+n.appRelativeUrl,s="transport="+i;return!e&&n.groupsToken&&(s+="&groupsToken="+t.encodeURIComponent(n.groupsToken)),r?(o+=f?"/poll":"/reconnect",!e&&n.messageId&&(s+="&messageId="+t.encodeURIComponent(n.messageId))):o+="/connect",o+="?"+s,o=u.prepareQueryString(n,o),e||(o+="&tid="+Math.floor(Math.random()*11)),o},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!="undefined"?!0:!1,ShouldReconnect:typeof n.T!="undefined"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},stringifySend:function(n,t){return typeof t=="string"||typeof t=="undefined"||t===null?t:n.json.stringify(t)},ajaxSend:function(t,i){var h=u.stringifySend(t,i),c=e(t,"/send"),o,s=function(t,u){n(u).triggerHandler(f.onError,[r._.transportError(r.resources.sendFailed,u.transport,t,o),i])};return o=u.ajax(t,{url:c,type:t.ajaxDataType==="jsonp"?"GET":"POST",contentType:r._.defaultContentType,data:{data:h},success:function(n){var i;if(n){try{i=t._parseResponse(n)}catch(r){s(r,t);t.stop();return}u.triggerReceived(t,i)}},error:function(n,i){i!=="abort"&&i!=="parsererror"&&s(n,t)}})},ajaxAbort:function(n,t){if(typeof n.transport!="undefined"){t=typeof t=="undefined"?!0:t;var i=e(n,"/abort");u.ajax(n,{url:i,async:t,timeout:1e3,type:"POST"});n.log("Fired ajax abort async = "+t+".")}},ajaxStart:function(t,i){var h=function(n){var i=t._deferral;i&&i.reject(n)},s=function(i){t.log("The start request failed. Stopping the connection.");n(t).triggerHandler(f.onError,[i]);h(i);t.stop()};t._.startRequest=u.ajax(t,{url:e(t,"/start"),success:function(n,u,f){var e;try{e=t._parseResponse(n)}catch(o){s(r._.error(r._.format(r.resources.errorParsingStartResponse,n),o,f));return}e.Response==="started"?i():s(r._.error(r._.format(r.resources.invalidStartResponse,n),null,f))},error:function(n,i,u){i!==o?s(r._.error(r.resources.errorDuringStartRequest,u,n)):(t.log("The start request aborted because connection.stop() was called."),h(r._.error(r.resources.stoppedDuringStartRequest,null,n)))}})},tryAbortStartRequest:function(n){n._.startRequest&&(n._.startRequest.abort(o),delete n._.startRequest)},tryInitialize:function(n,t){n.Initialized&&t()},triggerReceived:function(t,i){t._.connectingMessageBuffer.tryBuffer(i)||n(t).triggerHandler(f.onReceived,[i])},processMessages:function(t,i,r){var f;u.markLastMessage(t);i&&(f=u.maximizePersistentResponse(i),u.updateGroups(t,f.GroupsToken),f.MessageId&&(t.messageId=f.MessageId),f.Messages&&(n.each(f.Messages,function(n,i){u.triggerReceived(t,i)}),u.tryInitialize(f,r)))},monitorKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring?t.log("Tried to monitor keep alive but it's already being monitored."):(i.monitoring=!0,u.markLastMessage(t),t._.keepAliveData.reconnectKeepAliveUpdate=function(){u.markLastMessage(t)},n(t).bind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t.log("Now monitoring keep alive with a warning timeout of "+i.timeoutWarning+", keep alive timeout of "+i.timeout+" and disconnecting timeout of "+t.disconnectTimeout))},stopMonitoringKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(f.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t._.keepAliveData={},t.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(n){n._.lastActiveAt=(new Date).getTime();s(n)},markLastMessage:function(n){n._.lastMessageAt=(new Date).getTime()},markActive:function(n){return u.verifyLastActive(n)?(n._.lastActiveAt=(new Date).getTime(),!0):!1},isConnectedOrReconnecting:function(n){return n.state===r.connectionState.connected||n.state===r.connectionState.reconnecting},ensureReconnectingState:function(t){return c(t,r.connectionState.connected,r.connectionState.reconnecting)===!0&&n(t).triggerHandler(f.onReconnecting),t.state===r.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},verifyLastActive:function(t){if((new Date).getTime()-t._.lastActiveAt>=t.reconnectWindow){var i=r._.format(r.resources.reconnectWindowTimeout,new Date(t._.lastActiveAt),t.reconnectWindow);return t.log(i),n(t).triggerHandler(f.onError,[r._.error(i,"TimeoutException")]),t.stop(!1,!1),!1}return!0},reconnect:function(n,i){var f=r.transports[i];if(u.isConnectedOrReconnecting(n)&&!n._.reconnectTimeout){if(!u.verifyLastActive(n))return;n._.reconnectTimeout=t.setTimeout(function(){u.verifyLastActive(n)&&(f.stop(n),u.ensureReconnectingState(n)&&(n.log(i+" reconnecting."),f.start(n)))},n.reconnectDelay)}},handleParseFailure:function(t,i,u,e,o){var s=r._.transportError(r._.format(r.resources.parseFailed,i),t.transport,u,o);e&&e(s)?t.log("Failed to parse server response while attempting to connect."):(n(t).triggerHandler(f.onError,[s]),t.stop())},initHandler:function(n){return new h(n)},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(t,f){var e=i.stringifySend(t,f);try{t.socket.send(e)}catch(o){n(t).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketsInvalidState,t.transport,o,t.socket),f])}},start:function(e,o,s){var h,c=!1,l=this,a=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,a),e.log("Connecting to websocket endpoint '"+h+"'."),e.socket=new t.WebSocket(h),e.socket.onopen=function(){c=!0;e.log("Websocket opened.");i.clearReconnectTimeout(e);f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){var i;this===e.socket&&(c&&typeof t.wasClean!="undefined"&&t.wasClean===!1?(i=r._.transportError(r.resources.webSocketClosed,e.transport,t),e.log("Unclean disconnect from websocket: "+(t.reason||"[no reason given]."))):e.log("Websocket closed."),s&&s(i)||(i&&n(e).triggerHandler(u.onError,[i]),l.reconnect(e)))},e.socket.onmessage=function(t){var r;try{r=e._parseResponse(t.data)}catch(u){i.handleParseFailure(e,t.data,u,s,t);return}r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):i.triggerReceived(e,r))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n);n.socket&&(n.log("Closing the Websocket."),n.socket.close(),n.socket=null)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var i=n.signalR,u=n.signalR.events,e=n.signalR.changeState,r=i.transports._logic,f=function(n){t.clearTimeout(n._.reconnectAttemptTimeoutHandle);delete n._.reconnectAttemptTimeoutHandle};i.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(o,s,h){var c=this,l=!1,a=n(o),v=!s,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}y=r.getUrl(o,this.name,v);try{o.log("Attempting to connect to SSE endpoint '"+y+"'.");o.eventSource=new t.EventSource(y,{withCredentials:o.withCredentials})}catch(p){o.log("EventSource failed trying to connect with error "+p.Message+".");h?h():(a.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceFailedToConnect,o.transport,p)]),v&&c.reconnect(o));return}v&&(o._.reconnectAttemptTimeoutHandle=t.setTimeout(function(){l===!1&&o.eventSource.readyState!==t.EventSource.OPEN&&c.reconnect(o)},c.timeOut));o.eventSource.addEventListener("open",function(){o.log("EventSource connected.");f(o);r.clearReconnectTimeout(o);l===!1&&(l=!0,e(o,i.connectionState.reconnecting,i.connectionState.connected)===!0&&a.triggerHandler(u.onReconnect))},!1);o.eventSource.addEventListener("message",function(n){var t;if(n.data!=="initialized"){try{t=o._parseResponse(n.data)}catch(i){r.handleParseFailure(o,n.data,i,h,n);return}r.processMessages(o,t,s)}},!1);o.eventSource.addEventListener("error",function(n){var r=i._.transportError(i.resources.eventSourceError,o.transport,n);this===o.eventSource&&(h&&h(r)||(o.log("EventSource readyState: "+o.eventSource.readyState+"."),n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending."),c.reconnect(o)):(o.log("EventSource error."),a.triggerHandler(u.onError,[r]))))},!1)},reconnect:function(n){r.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){r.ajaxSend(n,t)},stop:function(n){f(n);r.clearReconnectTimeout(n);n&&n.eventSource&&(n.log("EventSource calling close()."),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){r.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var r=n.signalR,e=n.signalR.events,o=n.signalR.changeState,i=r.transports._logic,u=function(){var n=t.document.createElement("iframe");return n.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),n},f=function(){var i=null,f=1e3,n=0;return{prevent:function(){r._.ieVersion<=8&&(n===0&&(i=t.setInterval(function(){var n=u();t.document.body.appendChild(n);t.document.body.removeChild(n);n=null},f)),n++)},cancel:function(){n===1&&t.clearInterval(i);n>0&&n--}}}();r.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(n,r,e){var l=this,s=i.foreverFrame.count+=1,h,o=u(),c=function(){n.log("Forever frame iframe finished loading and is no longer receiving messages.");e&&e()||l.reconnect(n)};if(t.EventSource){e&&(n.log("Forever Frame is not supported by SignalR on browsers with SSE support."),e());return}o.setAttribute("data-signalr-connection-id",n.id);f.prevent();h=i.getUrl(n,this.name);h+="&frameId="+s;t.document.documentElement.appendChild(o);n.log("Binding to iframe's load event.");o.addEventListener?o.addEventListener("load",c,!1):o.attachEvent&&o.attachEvent("onload",c);o.src=h;i.foreverFrame.connections[s]=n;n.frame=o;n.frameId=s;r&&(n.onSuccess=function(){n.log("Iframe transport started.");r()})},reconnect:function(n){var r=this;i.isConnectedOrReconnecting(n)&&i.verifyLastActive(n)&&t.setTimeout(function(){if(i.verifyLastActive(n)&&n.frame&&i.ensureReconnectingState(n)){var u=n.frame,t=i.getUrl(n,r.name,!0)+"&frameId="+n.frameId;n.log("Updating iframe src to '"+t+"'.");u.src=t}},n.reconnectDelay)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},receive:function(t,u){var f,e,o;if(t.json!==t._originalJson&&(u=t._originalJson.stringify(u)),o=t._parseResponse(u),i.processMessages(t,o,t.onSuccess),t.state===n.signalR.connectionState.connected&&(t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>r.transports.foreverFrame.iframeClearThreshold&&(t.frameMessageCount=0,f=t.frame.contentWindow||t.frame.contentDocument,f&&f.document&&f.document.body)))for(e=f.document.body;e.firstChild;)e.removeChild(e.firstChild)},stop:function(n){var r=null;if(f.cancel(),n.frame){if(n.frame.stop)n.frame.stop();else try{r=n.frame.contentWindow||n.frame.contentDocument;r.document&&r.document.execCommand&&r.document.execCommand("Stop")}catch(u){n.log("Error occured when stopping foreverFrame transport. Message = "+u.message+".")}n.frame.parentNode===t.document.body&&t.document.body.removeChild(n.frame);delete i.foreverFrame.connections[n.frameId];n.frame=null;n.frameId=null;delete n.frame;delete n.frameId;delete n.onSuccess;delete n.frameMessageCount;n.log("Stopping forever frame.")}},abort:function(n,t){i.ajaxAbort(n,t)},getConnection:function(n){return i.foreverFrame.connections[n]},started:function(t){o(t,r.connectionState.reconnecting,r.connectionState.connected)===!0&&n(t).triggerHandler(e.onReconnect)}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,e=n.signalR.changeState,f=n.signalR.isDisconnecting,i=r.transports._logic;r.transports.longPolling={name:"longPolling",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(o,s,h){var a=this,v=function(){v=n.noop;o.log("LongPolling connected.");s()},y=function(n){return h(n)?(o.log("LongPolling failed to connect."),!0):!1},c=o._,l=0,p=function(i){t.clearTimeout(c.reconnectTimeoutId);c.reconnectTimeoutId=null;e(i,r.connectionState.reconnecting,r.connectionState.connected)===!0&&(i.log("Raising the reconnect event"),n(i).triggerHandler(u.onReconnect))},w=36e5;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop());o.messageId=null;c.reconnectTimeoutId=null;c.pollTimeoutId=t.setTimeout(function(){(function e(s,h){var g=s.messageId,nt=g===null,k=!nt,tt=!h,d=i.getUrl(s,a.name,k,tt,!0),b={};(s.messageId&&(b.messageId=s.messageId),s.groupsToken&&(b.groupsToken=s.groupsToken),f(s)!==!0)&&(o.log("Opening long polling request to '"+d+"'."),s.pollXhr=i.ajax(o,{xhrFields:{onprogress:function(){i.markLastMessage(o)}},url:d,type:"POST",contentType:r._.defaultContentType,data:b,timeout:o._.pollTimeout,success:function(r){var h,w=0,u,a;o.log("Long poll complete.");l=0;try{h=o._parseResponse(r)}catch(b){i.handleParseFailure(s,r,b,y,s.pollXhr);return}(c.reconnectTimeoutId!==null&&p(s),h&&(u=i.maximizePersistentResponse(h)),i.processMessages(s,h,v),u&&n.type(u.LongPollDelay)==="number"&&(w=u.LongPollDelay),f(s)!==!0)&&(a=u&&u.ShouldReconnect,!a||i.ensureReconnectingState(s))&&(w>0?c.pollTimeoutId=t.setTimeout(function(){e(s,a)},w):e(s,a))},error:function(f,h){var v=r._.transportError(r.resources.longPollFailed,o.transport,f,s.pollXhr);if(t.clearTimeout(c.reconnectTimeoutId),c.reconnectTimeoutId=null,h==="abort"){o.log("Aborted xhr request.");return}if(!y(v)){if(l++,o.state!==r.connectionState.reconnecting&&(o.log("An error occurred using longPolling. Status = "+h+". Response = "+f.responseText+"."),n(s).triggerHandler(u.onError,[v])),(o.state===r.connectionState.connected||o.state===r.connectionState.reconnecting)&&!i.verifyLastActive(o))return;if(!i.ensureReconnectingState(s))return;c.pollTimeoutId=t.setTimeout(function(){e(s,!0)},a.reconnectDelay)}}}),k&&h===!0&&(c.reconnectTimeoutId=t.setTimeout(function(){p(s)},Math.min(1e3*(Math.pow(2,l)-1),w))))})(o)},250)},lostConnection:function(n){n.pollXhr&&n.pollXhr.abort("lostConnection")},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){t.clearTimeout(n._.pollTimeoutId);t.clearTimeout(n._.reconnectTimeoutId);delete n._.pollTimeoutId;delete n._.reconnectTimeoutId;n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n){function r(n){return n+e}function s(n,t,i){for(var f=n.length,u=[],r=0;r<f;r+=1)n.hasOwnProperty(r)&&(u[r]=t.call(i,n[r],r,n));return u}function h(t){return n.isFunction(t)?null:n.type(t)==="undefined"?null:t}function u(n){for(var t in n)if(n.hasOwnProperty(t))return!0;return!1}function f(n,t){var i=n._.invocationCallbacks,r,f;u(i)&&n.log("Clearing hub invocation callbacks with error: "+t+".");n._.invocationCallbackId=0;delete n._.invocationCallbacks;n._.invocationCallbacks={};for(f in i)r=i[f],r.method.call(r.scope,{E:t})}function i(n,t){return new i.fn.init(n,t)}function t(i,r){var u={qs:null,logging:!1,useDefaultPath:!0};return n.extend(u,r),(!i||u.useDefaultPath)&&(i=(i||"")+"/signalr"),new t.fn.init(i,u)}var e=".hubProxy",o=n.signalR;i.fn=i.prototype={init:function(n,t){this.state={};this.connection=n;this.hubName=t;this._={callbackMap:{}}},constructor:i,hasSubscriptions:function(){return u(this._.callbackMap)},on:function(t,i){var u=this,f=u._.callbackMap;return t=t.toLowerCase(),f[t]||(f[t]={}),f[t][i]=function(n,t){i.apply(u,t)},n(u).bind(r(t),f[t][i]),u},off:function(t,i){var e=this,o=e._.callbackMap,f;return t=t.toLowerCase(),f=o[t],f&&(f[i]?(n(e).unbind(r(t),f[i]),delete f[i],u(f)||delete o[t]):i||(n(e).unbind(r(t)),delete o[t])),e},invoke:function(t){var i=this,r=i.connection,e=n.makeArray(arguments).slice(1),c=s(e,h),f={H:i.hubName,M:t,A:c,I:r._.invocationCallbackId},u=n.Deferred(),l=function(f){var e=i._maximizeHubResponse(f),h,s;n.extend(i.state,e.State);e.Progress?u.notifyWith?u.notifyWith(i,[e.Progress.Data]):r._.progressjQueryVersionLogged||(r.log("A hub method invocation progress update was received but the version of jQuery in use ("+n.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."),r._.progressjQueryVersionLogged=!0):e.Error?(e.StackTrace&&r.log(e.Error+"\n"+e.StackTrace+"."),h=e.IsHubException?"HubException":"Exception",s=o._.error(e.Error,h),s.data=e.ErrorData,r.log(i.hubName+"."+t+" failed to execute. Error: "+s.message),u.rejectWith(i,[s])):(r.log("Invoked "+i.hubName+"."+t),u.resolveWith(i,[e.Result]))};return r._.invocationCallbacks[r._.invocationCallbackId.toString()]={scope:i,method:l},r._.invocationCallbackId+=1,n.isEmptyObject(i.state)||(f.S=i.state),r.log("Invoking "+i.hubName+"."+t),r.send(f),u.promise()},_maximizeHubResponse:function(n){return{State:n.S,Result:n.R,Progress:n.P?{Id:n.P.I,Data:n.P.D}:null,Id:n.I,IsHubException:n.H,Error:n.E,StackTrace:n.T,ErrorData:n.D}}};i.fn.init.prototype=i.fn;t.fn=t.prototype=n.connection();t.fn.init=function(t,i){var e={qs:null,logging:!1,useDefaultPath:!0},u=this;n.extend(e,i);n.signalR.fn.init.call(u,t,e.qs,e.logging);u.proxies={};u._.invocationCallbackId=0;u._.invocationCallbacks={};u.received(function(t){var f,o,e,i,s,h;t&&(typeof t.P!="undefined"?(e=t.P.I.toString(),i=u._.invocationCallbacks[e],i&&i.method.call(i.scope,t)):typeof t.I!="undefined"?(e=t.I.toString(),i=u._.invocationCallbacks[e],i&&(u._.invocationCallbacks[e]=null,delete u._.invocationCallbacks[e],i.method.call(i.scope,t))):(f=this._maximizeClientHubInvocation(t),u.log("Triggering client hub event '"+f.Method+"' on hub '"+f.Hub+"'."),s=f.Hub.toLowerCase(),h=f.Method.toLowerCase(),o=this.proxies[s],n.extend(o.state,f.State),n(o).triggerHandler(r(h),[f.Args])))});u.error(function(n,t){var i,r;t&&(i=t.I,r=u._.invocationCallbacks[i],r&&(u._.invocationCallbacks[i]=null,delete u._.invocationCallbacks[i],r.method.call(r.scope,{E:n})))});u.reconnecting(function(){u.transport&&u.transport.name==="webSockets"&&f(u,"Connection started reconnecting before invocation result was received.")});u.disconnected(function(){f(u,"Connection was disconnected before invocation result was received.")})};t.fn._maximizeClientHubInvocation=function(n){return{Hub:n.H,Method:n.M,Args:n.A,State:n.S}};t.fn._registerSubscribedHubs=function(){var t=this;t._subscribedToHubs||(t._subscribedToHubs=!0,t.starting(function(){var i=[];n.each(t.proxies,function(n){this.hasSubscriptions()&&(i.push({name:n}),t.log("Client subscribed to hub '"+n+"'."))});i.length===0&&t.log("No hubs have been subscribed to. The client will not receive data from hubs. To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to.");t.data=t.json.stringify(i)}))};t.fn.createHubProxy=function(n){n=n.toLowerCase();var t=this.proxies[n];return t||(t=i(this,n),this.proxies[n]=t),this._registerSubscribedHubs(),t};t.fn.init.prototype=t.fn;n.hubConnection=t}(window.jQuery,window),function(n){n.signalR.version="2.2.0"}(window.jQuery)
|
wpsc-components/theme-engine-v1/helpers/page.php
CHANGED
@@ -328,7 +328,6 @@ function wpsc_get_template_file_url( $file = '' ) {
|
|
328 |
* enqueue all javascript and CSS for wp ecommerce
|
329 |
*/
|
330 |
function wpsc_enqueue_user_script_and_css() {
|
331 |
-
global $wp_styles, $wpsc_theme_url, $wp_query;
|
332 |
/**
|
333 |
* added by xiligroup.dev to be compatible with touchshop
|
334 |
*/
|
@@ -358,31 +357,38 @@ function wpsc_enqueue_user_script_and_css() {
|
|
358 |
wp_enqueue_script( 'wp-e-commerce', WPSC_CORE_JS_URL . '/wp-e-commerce.js', array( 'jquery' ), $version_identifier );
|
359 |
wp_localize_script( 'wp-e-commerce', 'wpsc_vars', wpsc_javascript_localizations() );
|
360 |
|
361 |
-
if ( get_option( 'product_ratings' ) == 1 )
|
362 |
wp_enqueue_script( 'jquery-rating', WPSC_CORE_JS_URL . '/jquery.rating.js', array( 'jquery' ), $version_identifier );
|
|
|
|
|
363 |
wp_enqueue_script( 'wp-e-commerce-legacy', WPSC_CORE_JS_URL . '/user.js', array( 'jquery' ), WPSC_VERSION . WPSC_MINOR_VERSION );
|
364 |
-
|
|
|
|
|
365 |
$lightbox = get_option('wpsc_lightbox', 'thickbox');
|
|
|
366 |
if( $lightbox == 'thickbox' ) {
|
367 |
-
wp_enqueue_script( 'wpsc-thickbox', WPSC_CORE_JS_URL . '/thickbox.js', array( 'jquery' ),
|
368 |
wp_enqueue_style( 'wpsc-thickbox', WPSC_CORE_JS_URL . '/thickbox.css', false, $version_identifier, 'all' );
|
369 |
} elseif( $lightbox == 'colorbox' ) {
|
370 |
-
wp_enqueue_script( 'colorbox-min', WPSC_CORE_JS_URL . '/jquery.colorbox-min.js', array( 'jquery' ),
|
371 |
-
wp_enqueue_script( 'wpsc_colorbox', WPSC_CORE_JS_URL . '/wpsc_colorbox.js', array( 'jquery', 'colorbox-min' ),
|
372 |
wp_enqueue_style( 'wpsc-colorbox-css', WPSC_CORE_JS_URL . '/wpsc_colorbox.css', false, $version_identifier, 'all' );
|
373 |
}
|
374 |
}
|
|
|
375 |
wp_enqueue_style( 'wpsc-theme-css', wpsc_get_template_file_url( 'wpsc-' . get_option( 'wpsc_selected_theme' ) . '.css' ), false, $version_identifier, 'all' );
|
376 |
wp_enqueue_style( 'wpsc-theme-css-compatibility', wpsc_get_template_file_url( 'compatibility.css' ), array( 'wpsc-theme-css' ), $version_identifier, 'all' );
|
377 |
|
378 |
-
if ( function_exists( 'wp_add_inline_style' ) )
|
379 |
wp_add_inline_style( 'wpsc-theme-css', wpsc_get_user_dynamic_css() );
|
380 |
-
else
|
381 |
wp_enqueue_style( 'wp-e-commerce-dynamic', wpsc_get_dynamic_user_css_url(), array( 'wpsc-theme-css' ), $version_identifier );
|
|
|
382 |
|
383 |
-
if( get_option( 'product_ratings' ) == 1 )
|
384 |
wp_enqueue_style( 'wpsc-product-rater', WPSC_CORE_JS_URL . '/product_rater.css', false, $version_identifier, 'all' );
|
385 |
-
|
386 |
}
|
387 |
}
|
388 |
|
328 |
* enqueue all javascript and CSS for wp ecommerce
|
329 |
*/
|
330 |
function wpsc_enqueue_user_script_and_css() {
|
|
|
331 |
/**
|
332 |
* added by xiligroup.dev to be compatible with touchshop
|
333 |
*/
|
357 |
wp_enqueue_script( 'wp-e-commerce', WPSC_CORE_JS_URL . '/wp-e-commerce.js', array( 'jquery' ), $version_identifier );
|
358 |
wp_localize_script( 'wp-e-commerce', 'wpsc_vars', wpsc_javascript_localizations() );
|
359 |
|
360 |
+
if ( get_option( 'product_ratings' ) == 1 ) {
|
361 |
wp_enqueue_script( 'jquery-rating', WPSC_CORE_JS_URL . '/jquery.rating.js', array( 'jquery' ), $version_identifier );
|
362 |
+
}
|
363 |
+
|
364 |
wp_enqueue_script( 'wp-e-commerce-legacy', WPSC_CORE_JS_URL . '/user.js', array( 'jquery' ), WPSC_VERSION . WPSC_MINOR_VERSION );
|
365 |
+
|
366 |
+
if ( get_option( 'show_thumbnails_thickbox' ) == 1 ) {
|
367 |
+
|
368 |
$lightbox = get_option('wpsc_lightbox', 'thickbox');
|
369 |
+
|
370 |
if( $lightbox == 'thickbox' ) {
|
371 |
+
wp_enqueue_script( 'wpsc-thickbox', WPSC_CORE_JS_URL . '/thickbox.js', array( 'jquery' ), $version_identifier );
|
372 |
wp_enqueue_style( 'wpsc-thickbox', WPSC_CORE_JS_URL . '/thickbox.css', false, $version_identifier, 'all' );
|
373 |
} elseif( $lightbox == 'colorbox' ) {
|
374 |
+
wp_enqueue_script( 'colorbox-min', WPSC_CORE_JS_URL . '/jquery.colorbox-min.js', array( 'jquery' ), $version_identifier );
|
375 |
+
wp_enqueue_script( 'wpsc_colorbox', WPSC_CORE_JS_URL . '/wpsc_colorbox.js', array( 'jquery', 'colorbox-min' ), $version_identifier );
|
376 |
wp_enqueue_style( 'wpsc-colorbox-css', WPSC_CORE_JS_URL . '/wpsc_colorbox.css', false, $version_identifier, 'all' );
|
377 |
}
|
378 |
}
|
379 |
+
|
380 |
wp_enqueue_style( 'wpsc-theme-css', wpsc_get_template_file_url( 'wpsc-' . get_option( 'wpsc_selected_theme' ) . '.css' ), false, $version_identifier, 'all' );
|
381 |
wp_enqueue_style( 'wpsc-theme-css-compatibility', wpsc_get_template_file_url( 'compatibility.css' ), array( 'wpsc-theme-css' ), $version_identifier, 'all' );
|
382 |
|
383 |
+
if ( function_exists( 'wp_add_inline_style' ) ) {
|
384 |
wp_add_inline_style( 'wpsc-theme-css', wpsc_get_user_dynamic_css() );
|
385 |
+
} else {
|
386 |
wp_enqueue_style( 'wp-e-commerce-dynamic', wpsc_get_dynamic_user_css_url(), array( 'wpsc-theme-css' ), $version_identifier );
|
387 |
+
}
|
388 |
|
389 |
+
if( get_option( 'product_ratings' ) == 1 ) {
|
390 |
wp_enqueue_style( 'wpsc-product-rater', WPSC_CORE_JS_URL . '/product_rater.css', false, $version_identifier, 'all' );
|
391 |
+
}
|
392 |
}
|
393 |
}
|
394 |
|
wpsc-components/theme-engine-v2/classes/template-engine.php
CHANGED
@@ -96,6 +96,26 @@ class WPSC_Template_Engine {
|
|
96 |
'dependencies' => array( 'jquery' ),
|
97 |
'version' => WPSC_VERSION,
|
98 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
);
|
100 |
|
101 |
/**
|
96 |
'dependencies' => array( 'jquery' ),
|
97 |
'version' => WPSC_VERSION,
|
98 |
),
|
99 |
+
'wpsc-float-labels' => array(
|
100 |
+
'path' => 'js/jquery.FloatLabel.js',
|
101 |
+
'dependencies' => array( 'jquery' ),
|
102 |
+
'version' => WPSC_VERSION,
|
103 |
+
),
|
104 |
+
'wpsc-checkout' => array(
|
105 |
+
'path' => 'js/checkout.js',
|
106 |
+
'dependencies' => array( 'jquery', 'wpsc-float-labels' ),
|
107 |
+
'version' => WPSC_VERSION,
|
108 |
+
),
|
109 |
+
'wpsc-fluidbox' => array(
|
110 |
+
'path' => 'js/fluidbox.js',
|
111 |
+
'dependencies' => array( 'jquery', 'underscore' ),
|
112 |
+
'version' => WPSC_VERSION
|
113 |
+
),
|
114 |
+
'wpsc-products' => array(
|
115 |
+
'path' => 'js/products.js',
|
116 |
+
'dependencies' => array( 'jquery' ),
|
117 |
+
'version' => WPSC_VERSION,
|
118 |
+
),
|
119 |
);
|
120 |
|
121 |
/**
|
wpsc-components/theme-engine-v2/helpers/css.php
CHANGED
@@ -5,6 +5,7 @@ function _wpsc_te2_register_styles() {
|
|
5 |
|
6 |
wpsc_te2_register_style( 'wpsc-common', "common{$suffix}.css" );
|
7 |
wpsc_te2_register_style( 'wpsc-responsive', "wpsc-responsive{$suffix}.css" );
|
|
|
8 |
|
9 |
do_action( 'wpsc_register_styles' );
|
10 |
}
|
@@ -14,6 +15,7 @@ function _wpsc_te2_enqueue_styles() {
|
|
14 |
|
15 |
wp_enqueue_style( 'wpsc-common' );
|
16 |
wp_enqueue_style( 'wpsc-responsive' );
|
|
|
17 |
|
18 |
if ( apply_filters( 'wpsc_add_inline_style', true ) ) {
|
19 |
wp_add_inline_style( 'wpsc-common', _wpsc_get_inline_style() );
|
@@ -21,6 +23,7 @@ function _wpsc_te2_enqueue_styles() {
|
|
21 |
|
22 |
do_action( 'wpsc_enqueue_styles' );
|
23 |
}
|
|
|
24 |
add_action( 'wp_enqueue_scripts' , '_wpsc_te2_enqueue_styles', 1 );
|
25 |
|
26 |
/**
|
5 |
|
6 |
wpsc_te2_register_style( 'wpsc-common', "common{$suffix}.css" );
|
7 |
wpsc_te2_register_style( 'wpsc-responsive', "wpsc-responsive{$suffix}.css" );
|
8 |
+
wpsc_te2_register_style( 'wpsc-fluidbox', "wpsc-fluid-box{$suffix}.css" );
|
9 |
|
10 |
do_action( 'wpsc_register_styles' );
|
11 |
}
|
15 |
|
16 |
wp_enqueue_style( 'wpsc-common' );
|
17 |
wp_enqueue_style( 'wpsc-responsive' );
|
18 |
+
wp_enqueue_style( 'wpsc-responsive' );
|
19 |
|
20 |
if ( apply_filters( 'wpsc_add_inline_style', true ) ) {
|
21 |
wp_add_inline_style( 'wpsc-common', _wpsc_get_inline_style() );
|
23 |
|
24 |
do_action( 'wpsc_enqueue_styles' );
|
25 |
}
|
26 |
+
|
27 |
add_action( 'wp_enqueue_scripts' , '_wpsc_te2_enqueue_styles', 1 );
|
28 |
|
29 |
/**
|
wpsc-components/theme-engine-v2/helpers/form.php
CHANGED
@@ -50,6 +50,7 @@ function _wpsc_get_field_output( $field, $r ) {
|
|
50 |
return _wpsc_get_fieldset_output( $field, $r );
|
51 |
}
|
52 |
|
|
|
53 |
$before_field = apply_filters( 'wpsc_field_before', $r['before_field'], $field, $r );
|
54 |
$before_field = sprintf( $before_field, $field['id'], $field['class'] );
|
55 |
|
@@ -59,6 +60,8 @@ function _wpsc_get_field_output( $field, $r ) {
|
|
59 |
$output .= apply_filters( 'wpsc_control_after' , $r['after_controls'] , $field, $r );
|
60 |
$output .= apply_filters( 'wpsc_field_after' , $r['after_field'] , $field, $r );
|
61 |
|
|
|
|
|
62 |
return $output;
|
63 |
}
|
64 |
|
@@ -127,6 +130,8 @@ function wpsc_get_form_output( $args ) {
|
|
127 |
|
128 |
$output = "<form id='{$r['id']}' method='{$r['method']}' action='{$r['action']}' class='{$r['class']}'>";
|
129 |
|
|
|
|
|
130 |
foreach ( $r['fields'] as $field ) {
|
131 |
$output .= _wpsc_get_field_output( $field, $r );
|
132 |
}
|
@@ -139,6 +144,8 @@ function wpsc_get_form_output( $args ) {
|
|
139 |
|
140 |
$output .= $r['after_form_actions'];
|
141 |
|
|
|
|
|
142 |
$output .= '</form>';
|
143 |
|
144 |
return $output;
|
@@ -587,7 +594,9 @@ function wpsc_form_label( $label, $for = '', $atts = array(), $echo = true ) {
|
|
587 |
$atts['for'] = $for;
|
588 |
}
|
589 |
|
590 |
-
$output = '<label ' . _wpsc_form_attributes( $atts ) . '>'
|
|
|
|
|
591 |
|
592 |
if ( $echo ) {
|
593 |
echo $output;
|
@@ -636,7 +645,11 @@ function wpsc_form_checkbox( $name, $value, $label = false, $checked = false, $a
|
|
636 |
}
|
637 |
|
638 |
if ( $label ) {
|
639 |
-
$output = '<label class="wpsc-form-checkbox-wrapper">'
|
|
|
|
|
|
|
|
|
640 |
if ( ! $echo ) {
|
641 |
return $output;
|
642 |
}
|
@@ -684,7 +697,11 @@ function wpsc_form_radio( $name, $value, $label = false, $checked = false, $atts
|
|
684 |
}
|
685 |
|
686 |
if ( $label ) {
|
687 |
-
$output = '<label class="wpsc-form-radio-wrapper">'
|
|
|
|
|
|
|
|
|
688 |
if ( ! $echo ) {
|
689 |
return $output;
|
690 |
}
|
50 |
return _wpsc_get_fieldset_output( $field, $r );
|
51 |
}
|
52 |
|
53 |
+
do_action( 'wpsc_action_field_control_before', $r['before_field'], $field, $r );
|
54 |
$before_field = apply_filters( 'wpsc_field_before', $r['before_field'], $field, $r );
|
55 |
$before_field = sprintf( $before_field, $field['id'], $field['class'] );
|
56 |
|
60 |
$output .= apply_filters( 'wpsc_control_after' , $r['after_controls'] , $field, $r );
|
61 |
$output .= apply_filters( 'wpsc_field_after' , $r['after_field'] , $field, $r );
|
62 |
|
63 |
+
do_action( 'wpsc_action_field_control_after', $r['after_field'], $field, $r );
|
64 |
+
|
65 |
return $output;
|
66 |
}
|
67 |
|
130 |
|
131 |
$output = "<form id='{$r['id']}' method='{$r['method']}' action='{$r['action']}' class='{$r['class']}'>";
|
132 |
|
133 |
+
do_action( 'wpsc_get_form_output_before_form_fields', $r );
|
134 |
+
|
135 |
foreach ( $r['fields'] as $field ) {
|
136 |
$output .= _wpsc_get_field_output( $field, $r );
|
137 |
}
|
144 |
|
145 |
$output .= $r['after_form_actions'];
|
146 |
|
147 |
+
do_action( 'wpsc_get_form_output_after_form_fields', $r );
|
148 |
+
|
149 |
$output .= '</form>';
|
150 |
|
151 |
return $output;
|
594 |
$atts['for'] = $for;
|
595 |
}
|
596 |
|
597 |
+
$output = '<label ' . _wpsc_form_attributes( $atts ) . '>'
|
598 |
+
. $label
|
599 |
+
. apply_filters( 'wpsc_form_input_append_to_label', '</label>', $atts );
|
600 |
|
601 |
if ( $echo ) {
|
602 |
echo $output;
|
645 |
}
|
646 |
|
647 |
if ( $label ) {
|
648 |
+
$output = '<label class="wpsc-form-checkbox-wrapper">'
|
649 |
+
. _wpsc_input_type_field( $atts, false )
|
650 |
+
. ' '
|
651 |
+
. $label
|
652 |
+
. apply_filters( 'wpsc_form_input_append_to_label', '</label>', $atts );
|
653 |
if ( ! $echo ) {
|
654 |
return $output;
|
655 |
}
|
697 |
}
|
698 |
|
699 |
if ( $label ) {
|
700 |
+
$output = '<label class="wpsc-form-radio-wrapper">'
|
701 |
+
. _wpsc_input_type_field( $atts, false )
|
702 |
+
. ' '
|
703 |
+
. $label
|
704 |
+
. apply_filters( 'wpsc_form_input_append_to_label', '</label>', $atts );
|
705 |
if ( ! $echo ) {
|
706 |
return $output;
|
707 |
}
|
wpsc-components/theme-engine-v2/helpers/js.php
CHANGED
@@ -54,6 +54,29 @@ function _wpsc_action_enqueue_shipping_billing_scripts() {
|
|
54 |
) );
|
55 |
}
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
/**
|
58 |
* Enqueue a registered wpsc script (and optionally localize its JS data).
|
59 |
* If script cannot be enqueued yet, register the queued script for later enqueue.
|
54 |
) );
|
55 |
}
|
56 |
|
57 |
+
function _wpsc_enqueue_float_label_scripts() {
|
58 |
+
add_action(
|
59 |
+
'wp_enqueue_scripts',
|
60 |
+
'_wpsc_action_enqueue_float_label_scripts'
|
61 |
+
);
|
62 |
+
}
|
63 |
+
|
64 |
+
function _wpsc_action_enqueue_float_label_scripts() {
|
65 |
+
wpsc_enqueue_script( 'wpsc-float-labels' );
|
66 |
+
wpsc_enqueue_script( 'wpsc-checkout' );
|
67 |
+
}
|
68 |
+
|
69 |
+
function _wpsc_enqueue_product_scripts() {
|
70 |
+
add_action(
|
71 |
+
'wp_enqueue_scripts',
|
72 |
+
'_wpsc_action_enqueue_product_scripts'
|
73 |
+
);
|
74 |
+
}
|
75 |
+
|
76 |
+
function _wpsc_action_enqueue_product_scripts() {
|
77 |
+
wpsc_enqueue_script( 'wpsc-products' );
|
78 |
+
}
|
79 |
+
|
80 |
/**
|
81 |
* Enqueue a registered wpsc script (and optionally localize its JS data).
|
82 |
* If script cannot be enqueued yet, register the queued script for later enqueue.
|
wpsc-components/theme-engine-v2/helpers/template-tags/product.php
CHANGED
@@ -349,6 +349,22 @@ function wpsc_get_product_thumbnail_id( $product_id = null ) {
|
|
349 |
return $thumbnail_id;
|
350 |
}
|
351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
/**
|
353 |
* Sets the structured product name to the product title.
|
354 |
*
|
349 |
return $thumbnail_id;
|
350 |
}
|
351 |
|
352 |
+
/**
|
353 |
+
* Returns
|
354 |
+
* @return [type] [description]
|
355 |
+
*/
|
356 |
+
function wpsc_product_thumbnail_link() {
|
357 |
+
|
358 |
+
if ( ! wpsc_has_product_thumbnail() ) {
|
359 |
+
return wpsc_get_product_permalink();
|
360 |
+
}
|
361 |
+
|
362 |
+
return wp_get_attachment_image_url(
|
363 |
+
wpsc_get_product_thumbnail_id(),
|
364 |
+
apply_filters( 'wpsc_product_thumbnail_link_size', 'full' )
|
365 |
+
);
|
366 |
+
}
|
367 |
+
|
368 |
/**
|
369 |
* Sets the structured product name to the product title.
|
370 |
*
|
wpsc-components/theme-engine-v2/mvc/controllers/cart.php
CHANGED
@@ -5,6 +5,7 @@ class WPSC_Controller_Cart extends WPSC_Controller {
|
|
5 |
require_once( WPSC_TE_V2_CLASSES_PATH . '/cart-item-table.php' );
|
6 |
require_once( WPSC_TE_V2_CLASSES_PATH . '/cart-item-table-form.php' );
|
7 |
$this->view = 'cart';
|
|
|
8 |
$this->title = wpsc_get_cart_title();
|
9 |
$this->init_cart_item_table();
|
10 |
}
|
5 |
require_once( WPSC_TE_V2_CLASSES_PATH . '/cart-item-table.php' );
|
6 |
require_once( WPSC_TE_V2_CLASSES_PATH . '/cart-item-table-form.php' );
|
7 |
$this->view = 'cart';
|
8 |
+
_wpsc_enqueue_product_scripts();
|
9 |
$this->title = wpsc_get_cart_title();
|
10 |
$this->init_cart_item_table();
|
11 |
}
|
wpsc-components/theme-engine-v2/mvc/controllers/category.php
CHANGED
@@ -8,6 +8,7 @@ class WPSC_Controller_Category extends WPSC_Query_Controller {
|
|
8 |
|
9 |
public function index() {
|
10 |
$this->view = 'category';
|
|
|
11 |
$this->title = get_queried_object()->name;
|
12 |
}
|
13 |
|
8 |
|
9 |
public function index() {
|
10 |
$this->view = 'category';
|
11 |
+
_wpsc_enqueue_product_scripts();
|
12 |
$this->title = get_queried_object()->name;
|
13 |
}
|
14 |
|
wpsc-components/theme-engine-v2/mvc/controllers/checkout.php
CHANGED
@@ -30,8 +30,10 @@ class WPSC_Controller_Checkout extends WPSC_Controller {
|
|
30 |
wpsc_update_customer_meta( 'checkout_after_login', true );
|
31 |
if ( get_option( 'require_register' ) ) {
|
32 |
$this->view = 'checkout-login-required';
|
|
|
33 |
} else {
|
34 |
$this->view = 'checkout-login-prompt';
|
|
|
35 |
}
|
36 |
} else {
|
37 |
wp_redirect( wpsc_get_checkout_url( 'shipping-and-billing' ) );
|
@@ -177,6 +179,7 @@ class WPSC_Controller_Checkout extends WPSC_Controller {
|
|
177 |
public function shipping_and_billing() {
|
178 |
$this->view = 'checkout-shipping-and-billing';
|
179 |
_wpsc_enqueue_shipping_billing_scripts();
|
|
|
180 |
|
181 |
$this->maybe_add_guest_account();
|
182 |
|
30 |
wpsc_update_customer_meta( 'checkout_after_login', true );
|
31 |
if ( get_option( 'require_register' ) ) {
|
32 |
$this->view = 'checkout-login-required';
|
33 |
+
_wpsc_enqueue_float_label_scripts();
|
34 |
} else {
|
35 |
$this->view = 'checkout-login-prompt';
|
36 |
+
_wpsc_enqueue_float_label_scripts();
|
37 |
}
|
38 |
} else {
|
39 |
wp_redirect( wpsc_get_checkout_url( 'shipping-and-billing' ) );
|
179 |
public function shipping_and_billing() {
|
180 |
$this->view = 'checkout-shipping-and-billing';
|
181 |
_wpsc_enqueue_shipping_billing_scripts();
|
182 |
+
_wpsc_enqueue_float_label_scripts();
|
183 |
|
184 |
$this->maybe_add_guest_account();
|
185 |
|
wpsc-components/theme-engine-v2/mvc/controllers/customer-account.php
CHANGED
@@ -159,6 +159,7 @@ class WPSC_Controller_Customer_Account extends WPSC_Controller {
|
|
159 |
public function settings() {
|
160 |
$this->view = 'customer-account-settings';
|
161 |
_wpsc_enqueue_shipping_billing_scripts();
|
|
|
162 |
|
163 |
if ( isset( $_POST['action'] ) && $_POST['action'] == 'submit_customer_settings_form' ) {
|
164 |
$this->submit_customer_settings();
|
159 |
public function settings() {
|
160 |
$this->view = 'customer-account-settings';
|
161 |
_wpsc_enqueue_shipping_billing_scripts();
|
162 |
+
_wpsc_enqueue_float_label_scripts();
|
163 |
|
164 |
if ( isset( $_POST['action'] ) && $_POST['action'] == 'submit_customer_settings_form' ) {
|
165 |
$this->submit_customer_settings();
|
wpsc-components/theme-engine-v2/mvc/controllers/login.php
CHANGED
@@ -25,6 +25,7 @@ class WPSC_Controller_Login extends WPSC_Controller
|
|
25 |
}
|
26 |
|
27 |
$this->view = 'login';
|
|
|
28 |
}
|
29 |
|
30 |
private function callback_login() {
|
25 |
}
|
26 |
|
27 |
$this->view = 'login';
|
28 |
+
_wpsc_enqueue_float_label_scripts();
|
29 |
}
|
30 |
|
31 |
private function callback_login() {
|
wpsc-components/theme-engine-v2/mvc/controllers/main-store.php
CHANGED
@@ -10,6 +10,7 @@ class WPSC_Controller_Main_Store extends WPSC_Query_Controller {
|
|
10 |
public function index() {
|
11 |
$this->title = wpsc_get_store_title();
|
12 |
$this->view = 'main-store';
|
|
|
13 |
}
|
14 |
|
15 |
protected function get_native_template() {
|
10 |
public function index() {
|
11 |
$this->title = wpsc_get_store_title();
|
12 |
$this->view = 'main-store';
|
13 |
+
_wpsc_enqueue_product_scripts();
|
14 |
}
|
15 |
|
16 |
protected function get_native_template() {
|
wpsc-components/theme-engine-v2/mvc/controllers/password-reminder.php
CHANGED
@@ -157,6 +157,7 @@ class WPSC_Controller_Password_Reminder extends WPSC_Controller{
|
|
157 |
}
|
158 |
|
159 |
$this->view = 'password-reminder-reset';
|
|
|
160 |
|
161 |
if ( isset( $_POST['action'] ) && $_POST['action'] == 'reset_password' ) {
|
162 |
$this->callback_reset_password( $user );
|
157 |
}
|
158 |
|
159 |
$this->view = 'password-reminder-reset';
|
160 |
+
_wpsc_enqueue_float_label_scripts();
|
161 |
|
162 |
if ( isset( $_POST['action'] ) && $_POST['action'] == 'reset_password' ) {
|
163 |
$this->callback_reset_password( $user );
|
wpsc-components/theme-engine-v2/mvc/controllers/register.php
CHANGED
@@ -12,11 +12,12 @@ class WPSC_Controller_Register extends WPSC_Controller {
|
|
12 |
}
|
13 |
|
14 |
public function index() {
|
15 |
-
if ( isset( $_POST['action'] ) && $_POST['action']
|
16 |
$this->callback_register();
|
17 |
}
|
18 |
|
19 |
$this->view = 'register';
|
|
|
20 |
}
|
21 |
|
22 |
public function filter_fields_dont_match_message() {
|
@@ -38,4 +39,4 @@ class WPSC_Controller_Register extends WPSC_Controller {
|
|
38 |
private function send_registration_notification( $user_id, $username, $email, $password ) {
|
39 |
return wpsc_send_registration_notifiction( $user_id, $username, $email, $password );
|
40 |
}
|
41 |
-
}
|
12 |
}
|
13 |
|
14 |
public function index() {
|
15 |
+
if ( isset( $_POST['action'] ) && 'register' === $_POST['action'] ) {
|
16 |
$this->callback_register();
|
17 |
}
|
18 |
|
19 |
$this->view = 'register';
|
20 |
+
_wpsc_enqueue_float_label_scripts();
|
21 |
}
|
22 |
|
23 |
public function filter_fields_dont_match_message() {
|
39 |
private function send_registration_notification( $user_id, $username, $email, $password ) {
|
40 |
return wpsc_send_registration_notifiction( $user_id, $username, $email, $password );
|
41 |
}
|
42 |
+
}
|
wpsc-components/theme-engine-v2/mvc/controllers/single.php
CHANGED
@@ -9,9 +9,28 @@ class WPSC_Controller_Single extends WPSC_Query_Controller {
|
|
9 |
public function index() {
|
10 |
$this->title = get_queried_object()->post_title;
|
11 |
$this->view = 'single';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
}
|
13 |
|
14 |
public function get_native_template() {
|
15 |
return locate_template( 'single-wpsc-product.php' );
|
16 |
}
|
17 |
-
}
|
9 |
public function index() {
|
10 |
$this->title = get_queried_object()->post_title;
|
11 |
$this->view = 'single';
|
12 |
+
|
13 |
+
$this->load_lightbox();
|
14 |
+
}
|
15 |
+
|
16 |
+
public function load_lightbox() {
|
17 |
+
if ( apply_filters( 'wpsc_use_fluidbox', true ) ) {
|
18 |
+
add_action( 'wpsc_enqueue_styles', array( $this, '_fluidbox_styles' ) );
|
19 |
+
add_action( 'wp_enqueue_scripts', array( $this, '_fluidbox_scripts' ) );
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
public function _fluidbox_styles() {
|
24 |
+
wp_enqueue_style( 'wpsc-fluidbox' );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function _fluidbox_scripts() {
|
28 |
+
wp_enqueue_script( 'wpsc-fluidbox' );
|
29 |
+
wp_localize_script( 'wpsc-fluidbox', 'WPSC_Fluid_Box_Options', apply_filters( 'wpsc_fluidbox_options', array() ) );
|
30 |
+
_wpsc_enqueue_product_scripts();
|
31 |
}
|
32 |
|
33 |
public function get_native_template() {
|
34 |
return locate_template( 'single-wpsc-product.php' );
|
35 |
}
|
36 |
+
}
|
wpsc-components/theme-engine-v2/snippets/cart-item-table/display.php
CHANGED
@@ -19,7 +19,9 @@
|
|
19 |
<?php endif; ?>
|
20 |
</div>
|
21 |
<div class="wpsc-cart-cell update-quantity">
|
22 |
-
|
|
|
|
|
23 |
<input type="submit" class="wpsc-button wpsc-button-small wpsc-cart-update" name="update_quantity" value="<?php esc_html_e( 'Update Quantity', 'wp-e-commerce' ); ?>" />
|
24 |
<input type="hidden" name="action" value="update_quantity" />
|
25 |
<?php endif; ?>
|
19 |
<?php endif; ?>
|
20 |
</div>
|
21 |
<div class="wpsc-cart-cell update-quantity">
|
22 |
+
<div class="wpsc-quantity-field-wrapper">
|
23 |
+
<?php if ( $this->show_quantity_field ) : ?>
|
24 |
+
</div>
|
25 |
<input type="submit" class="wpsc-button wpsc-button-small wpsc-cart-update" name="update_quantity" value="<?php esc_html_e( 'Update Quantity', 'wp-e-commerce' ); ?>" />
|
26 |
<input type="hidden" name="action" value="update_quantity" />
|
27 |
<?php endif; ?>
|
wpsc-components/theme-engine-v2/theming/assets/css/common.css
CHANGED
@@ -509,7 +509,7 @@
|
|
509 |
|
510 |
.ui-button-text-icon-primary .ui-button-icon-primary{
|
511 |
float:none;
|
512 |
-
}*/
|
513 |
}
|
514 |
|
515 |
.wpsc-controller .ui-helper-hidden {
|
509 |
|
510 |
.ui-button-text-icon-primary .ui-button-icon-primary{
|
511 |
float:none;
|
512 |
+
} */
|
513 |
}
|
514 |
|
515 |
.wpsc-controller .ui-helper-hidden {
|
wpsc-components/theme-engine-v2/theming/assets/css/wpsc-fluid-box.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
@-webkit-keyframes a{0%{-webkit-transform:translate(-50%,-50%) rotateX(0) rotateY(0);transform:translate(-50%,-50%) rotateX(0) rotateY(0)}50%{-webkit-transform:translate(-50%,-50%) rotateX(-180deg) rotateY(0);transform:translate(-50%,-50%) rotateX(-180deg) rotateY(0)}to{-webkit-transform:translate(-50%,-50%) rotateX(-180deg) rotateY(-180deg);transform:translate(-50%,-50%) rotateX(-180deg) rotateY(-180deg)}}@keyframes a{0%{-webkit-transform:translate(-50%,-50%) rotateX(0) rotateY(0);transform:translate(-50%,-50%) rotateX(0) rotateY(0)}50%{-webkit-transform:translate(-50%,-50%) rotateX(-180deg) rotateY(0);transform:translate(-50%,-50%) rotateX(-180deg) rotateY(0)}to{-webkit-transform:translate(-50%,-50%) rotateX(-180deg) rotateY(-180deg);transform:translate(-50%,-50%) rotateX(-180deg) rotateY(-180deg)}}.fluidbox{outline:none}.fluidbox__overlay{background-color:hsla(0,0%,100%,.85);cursor:pointer;cursor:zoom-out;opacity:0;pointer-events:none;position:fixed;top:-100%;left:0;bottom:-100%;right:0;-webkit-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.fluidbox--opened .fluidbox__overlay{pointer-events:auto}.fluidbox__wrap{background-position:center center;background-size:cover;margin:0 auto;position:relative;-webkit-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.fluidbox--closed .fluidbox__thumb,.fluidbox__thumb{-webkit-transition:opacity 0s ease-in-out 0s;transition:opacity 0s ease-in-out 0s}.fluidbox__ghost{background-size:100% 100%;background-position:center center;background-repeat:no-repeat;position:absolute;transition-duration:0s,.5s;transition-delay:0s;-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:opacity,transform}.fluidbox--opened .fluidbox__ghost{cursor:pointer;cursor:zoom-out}.fluidbox--closed .fluidbox__ghost{-webkit-transition-delay:.5s,0s;transition-delay:.5s,0s}.fluidbox__loader{opacity:0;-webkit-perspective:200px;perspective:200px;pointer-events:none;position:absolute;top:0;left:0;bottom:0;right:0}.fluidbox__loader:before{background-color:hsla(0,0%,100%,.85);content:'';-webkit-transform-style:preserve-3d;transform-style:preserve-3d;position:absolute;top:50%;left:50%;width:20%;padding-bottom:20%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-delay:0s;transition-delay:0s}.fluidbox--loading .fluidbox__loader{opacity:1;-webkit-transition:opacity .5s ease-in-out .5s;transition:opacity .5s ease-in-out .5s}.fluidbox--loading .fluidbox__loader:before{-webkit-animation:a 1s 0s infinite ease-in-out forwards;animation:a 1s 0s infinite ease-in-out forwards}
|
wpsc-components/theme-engine-v2/theming/assets/css/wpsc-responsive.css
CHANGED
@@ -35,9 +35,14 @@ Variables
|
|
35 |
margin: 0 0 7% 2.5%;
|
36 |
font-size: initial;
|
37 |
vertical-align: top;
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
-
.wpsc-grid .wpsc-
|
41 |
width: 100%;
|
42 |
}
|
43 |
|
@@ -235,6 +240,34 @@ Variables
|
|
235 |
float: right;
|
236 |
}
|
237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
.wpsc-single { /*****************
|
239 |
Product List
|
240 |
*****************/
|
@@ -249,6 +282,34 @@ Variables
|
|
249 |
float: right;
|
250 |
}
|
251 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
/*******************
|
253 |
Shopping Cart
|
254 |
********************/
|
@@ -580,39 +641,74 @@ Shopping Cart
|
|
580 |
********************/
|
581 |
}
|
582 |
|
583 |
-
.wpsc-checkout .
|
584 |
width: 100%;
|
585 |
}
|
586 |
|
587 |
-
.wpsc-checkout
|
588 |
margin-left: 5%;
|
589 |
}
|
590 |
|
591 |
-
.wpsc-checkout .
|
592 |
-
|
593 |
-
|
594 |
-
|
|
|
595 |
}
|
596 |
|
597 |
-
.wpsc-checkout .
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
602 |
}
|
603 |
|
604 |
-
.wpsc-checkout .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
605 |
margin-bottom: 1.5em;
|
606 |
}
|
607 |
|
608 |
-
.wpsc-checkout .
|
609 |
width: 40px;
|
610 |
}
|
611 |
|
612 |
-
.wpsc-checkout .
|
613 |
vertical-align: middle;
|
614 |
}
|
615 |
|
|
|
|
|
|
|
|
|
616 |
/**********************
|
617 |
Accounts Page
|
618 |
***********************/
|
@@ -678,6 +774,135 @@ Accounts Page
|
|
678 |
border-top: 0;
|
679 |
}
|
680 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
/*****************
|
682 |
Media Queries
|
683 |
*****************/
|
35 |
margin: 0 0 7% 2.5%;
|
36 |
font-size: initial;
|
37 |
vertical-align: top;
|
38 |
+
padding-top: 0;
|
39 |
+
}
|
40 |
+
|
41 |
+
.wpsc-grid .wpsc-product + .wpsc-product {
|
42 |
+
margin-top: 0;
|
43 |
}
|
44 |
|
45 |
+
.wpsc-grid .wpsc-product-summary {
|
46 |
width: 100%;
|
47 |
}
|
48 |
|
240 |
float: right;
|
241 |
}
|
242 |
|
243 |
+
.wpsc-list .wpsc-add-to-cart-form {
|
244 |
+
display: -webkit-box;
|
245 |
+
display: -moz-box;
|
246 |
+
display: -ms-flexbox;
|
247 |
+
display: -webkit-flex;
|
248 |
+
display: flex;
|
249 |
+
-webkit-justify-content: flex-start;
|
250 |
+
-moz-justify-content: flex-start;
|
251 |
+
-ms-justify-content: flex-start;
|
252 |
+
justify-content: flex-start;
|
253 |
+
-webkit-flex-wrap: wrap;
|
254 |
+
-moz-flex-wrap: wrap;
|
255 |
+
-ms-flex-wrap: wrap;
|
256 |
+
flex-wrap: wrap;
|
257 |
+
-webkit-align-items: center;
|
258 |
+
-moz-align-items: center;
|
259 |
+
-ms-align-items: center;
|
260 |
+
align-items: center;
|
261 |
+
}
|
262 |
+
|
263 |
+
.wpsc-list .wpsc-add-to-cart-form .wpsc-form-actions {
|
264 |
+
margin-bottom: 0;
|
265 |
+
}
|
266 |
+
|
267 |
+
.wpsc-list .wpsc-add-to-cart-form .wpsc-field {
|
268 |
+
margin-right: 5%;
|
269 |
+
}
|
270 |
+
|
271 |
.wpsc-single { /*****************
|
272 |
Product List
|
273 |
*****************/
|
282 |
float: right;
|
283 |
}
|
284 |
|
285 |
+
.wpsc-single .wpsc-add-to-cart-form {
|
286 |
+
display: -webkit-box;
|
287 |
+
display: -moz-box;
|
288 |
+
display: -ms-flexbox;
|
289 |
+
display: -webkit-flex;
|
290 |
+
display: flex;
|
291 |
+
-webkit-justify-content: flex-start;
|
292 |
+
-moz-justify-content: flex-start;
|
293 |
+
-ms-justify-content: flex-start;
|
294 |
+
justify-content: flex-start;
|
295 |
+
-webkit-flex-wrap: wrap;
|
296 |
+
-moz-flex-wrap: wrap;
|
297 |
+
-ms-flex-wrap: wrap;
|
298 |
+
flex-wrap: wrap;
|
299 |
+
-webkit-align-items: center;
|
300 |
+
-moz-align-items: center;
|
301 |
+
-ms-align-items: center;
|
302 |
+
align-items: center;
|
303 |
+
}
|
304 |
+
|
305 |
+
.wpsc-single .wpsc-add-to-cart-form .wpsc-form-actions {
|
306 |
+
margin-bottom: 0;
|
307 |
+
}
|
308 |
+
|
309 |
+
.wpsc-single .wpsc-add-to-cart-form .wpsc-field {
|
310 |
+
margin-right: 5%;
|
311 |
+
}
|
312 |
+
|
313 |
/*******************
|
314 |
Shopping Cart
|
315 |
********************/
|
641 |
********************/
|
642 |
}
|
643 |
|
644 |
+
.wpsc-checkout .wpsc-field-textfield input {
|
645 |
width: 100%;
|
646 |
}
|
647 |
|
648 |
+
.wpsc-checkout #wpsc-checkout-form-shipping {
|
649 |
margin-left: 5%;
|
650 |
}
|
651 |
|
652 |
+
.wpsc-checkout .wpsc-field-wpsc_shipping_option,
|
653 |
+
.wpsc-checkout .wpsc-shipping-method,
|
654 |
+
.wpsc-checkout .wpsc-payment-method,
|
655 |
+
.wpsc-checkout .wpsc-checkout-form .wpsc-form-actions {
|
656 |
+
text-align: left;
|
657 |
}
|
658 |
|
659 |
+
.wpsc-checkout .wpsc-checkout-form {
|
660 |
+
display: -webkit-box;
|
661 |
+
display: -moz-box;
|
662 |
+
display: -ms-flexbox;
|
663 |
+
display: -webkit-flex;
|
664 |
+
display: flex;
|
665 |
+
-webkit-flex-wrap: wrap;
|
666 |
+
-moz-flex-wrap: wrap;
|
667 |
+
-ms-flex-wrap: wrap;
|
668 |
+
flex-wrap: wrap;
|
669 |
+
-webkit-justify-content: space-between;
|
670 |
+
-moz-justify-content: space-between;
|
671 |
+
-ms-justify-content: space-between;
|
672 |
+
justify-content: space-between;
|
673 |
+
}
|
674 |
+
|
675 |
+
.wpsc-checkout .wpsc-checkout-form .wpsc-form-actions {
|
676 |
+
width: 100%;
|
677 |
}
|
678 |
|
679 |
+
.wpsc-checkout .wpsc-checkout-form fieldset {
|
680 |
+
margin: 0 0 2em 0;
|
681 |
+
vertical-align: top;
|
682 |
+
-webkit-align-self: flex-start;
|
683 |
+
-moz-align-self: flex-start;
|
684 |
+
-ms-align-self: flex-start;
|
685 |
+
align-self: flex-start;
|
686 |
+
-webkit-flex-grow: 1;
|
687 |
+
-moz-flex-grow: 1;
|
688 |
+
-ms-flex-grow: 1;
|
689 |
+
flex-grow: 1;
|
690 |
+
-webkit-flex-basis: 3%;
|
691 |
+
-moz-flex-basis: 3%;
|
692 |
+
-ms-flex-basis: 3%;
|
693 |
+
flex-basis: 3%;
|
694 |
+
}
|
695 |
+
|
696 |
+
.wpsc-checkout .wpsc-order-preview {
|
697 |
margin-bottom: 1.5em;
|
698 |
}
|
699 |
|
700 |
+
.wpsc-checkout .wpsc-cart-quantity-input {
|
701 |
width: 40px;
|
702 |
}
|
703 |
|
704 |
+
.wpsc-checkout .wpsc-form-radio-wrapper img {
|
705 |
vertical-align: middle;
|
706 |
}
|
707 |
|
708 |
+
.wpsc-checkout .wpsc-paypal li {
|
709 |
+
list-style-type: none;
|
710 |
+
}
|
711 |
+
|
712 |
/**********************
|
713 |
Accounts Page
|
714 |
***********************/
|
774 |
border-top: 0;
|
775 |
}
|
776 |
|
777 |
+
/*******************
|
778 |
+
JS Float Label
|
779 |
+
********************/
|
780 |
+
|
781 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield,
|
782 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region,
|
783 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country,
|
784 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password {
|
785 |
+
position: relative;
|
786 |
+
}
|
787 |
+
|
788 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield input,
|
789 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield textarea,
|
790 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region input,
|
791 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region textarea,
|
792 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country input,
|
793 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country textarea,
|
794 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password input,
|
795 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password textarea {
|
796 |
+
padding: 1em;
|
797 |
+
}
|
798 |
+
|
799 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield input,
|
800 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield textarea,
|
801 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield label,
|
802 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region input,
|
803 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region textarea,
|
804 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region label,
|
805 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country input,
|
806 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country textarea,
|
807 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country label,
|
808 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password input,
|
809 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password textarea,
|
810 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password label {
|
811 |
+
-webkit-transition: 0.2s ease-in-out;
|
812 |
+
-moz-transition: 0.2s ease-in-out;
|
813 |
+
-ms-transition: 0.2s ease-in-out;
|
814 |
+
-o-transition: 0.2s ease-in-out;
|
815 |
+
transition: 0.2s ease-in-out;
|
816 |
+
}
|
817 |
+
|
818 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield label,
|
819 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region label,
|
820 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country label,
|
821 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password label {
|
822 |
+
position: absolute;
|
823 |
+
top: 1em;
|
824 |
+
left: 1em;
|
825 |
+
opacity: 0;
|
826 |
+
}
|
827 |
+
|
828 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield.focused label,
|
829 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield.populated label,
|
830 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region.focused label,
|
831 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region.populated label,
|
832 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country.focused label,
|
833 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country.populated label,
|
834 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password.focused label,
|
835 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password.populated label {
|
836 |
+
opacity: 1;
|
837 |
+
top: 0;
|
838 |
+
left: 1em;
|
839 |
+
font-size: 0.65em;
|
840 |
+
font-weight: 600;
|
841 |
+
}
|
842 |
+
|
843 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield.focused input,
|
844 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield.focused textarea,
|
845 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield.populated input,
|
846 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-textfield.populated textarea,
|
847 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region.focused input,
|
848 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region.focused textarea,
|
849 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region.populated input,
|
850 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_region.populated textarea,
|
851 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country.focused input,
|
852 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country.focused textarea,
|
853 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country.populated input,
|
854 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-select_country.populated textarea,
|
855 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password.focused input,
|
856 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password.focused textarea,
|
857 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password.populated input,
|
858 |
+
.wpsc-controller.wpsc-float-js .wpsc-field-password.populated textarea {
|
859 |
+
padding-top: 1.5em;
|
860 |
+
padding-bottom: .5em;
|
861 |
+
}
|
862 |
+
|
863 |
+
/*******************
|
864 |
+
Product Forms
|
865 |
+
********************/
|
866 |
+
|
867 |
+
.wpsc-field-quantity .wpsc-controls {
|
868 |
+
display: -webkit-box;
|
869 |
+
display: -moz-box;
|
870 |
+
display: -ms-flexbox;
|
871 |
+
display: -webkit-flex;
|
872 |
+
display: flex;
|
873 |
+
border: 1px solid #ccc;
|
874 |
+
}
|
875 |
+
|
876 |
+
.wpsc-field-quantity .wpsc-controls input[type="text"] {
|
877 |
+
width: 40px;
|
878 |
+
-webkit-order: 2;
|
879 |
+
-moz-order: 2;
|
880 |
+
-ms-order: 2;
|
881 |
+
order: 2;
|
882 |
+
text-align: center;
|
883 |
+
border: none;
|
884 |
+
box-shadow: none;
|
885 |
+
}
|
886 |
+
|
887 |
+
.wpsc-field-quantity .wpsc-controls .dec {
|
888 |
+
-webkit-order: 1;
|
889 |
+
-moz-order: 1;
|
890 |
+
-ms-order: 1;
|
891 |
+
order: 1;
|
892 |
+
}
|
893 |
+
|
894 |
+
.wpsc-field-quantity .wpsc-controls .inc {
|
895 |
+
-webkit-order: 3;
|
896 |
+
-moz-order: 3;
|
897 |
+
-ms-order: 3;
|
898 |
+
order: 3;
|
899 |
+
}
|
900 |
+
|
901 |
+
.wpsc-field-quantity .wpsc-qty-button {
|
902 |
+
padding: .5em .75em;
|
903 |
+
cursor: pointer;
|
904 |
+
}
|
905 |
+
|
906 |
/*****************
|
907 |
Media Queries
|
908 |
*****************/
|
wpsc-components/theme-engine-v2/theming/assets/css/wpsc-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/_variables.scss","../scss/wpsc-responsive.scss","../scss/partials/_product-grid.scss","../scss/partials/_product-grid-opinions.scss","../scss/partials/_mixins.scss","../scss/partials/_product-list.scss","../scss/partials/_shopping-cart.scss","../scss/partials/_mobile-and-sidebar.scss","../scss/partials/_checkout.scss","../scss/partials/_account.scss","../scss/partials/_media-queries.scss"],
|
5 |
"names": [],
|
6 |
"file": "wpsc-responsive.css"
|
7 |
}
|
1 |
{
|
2 |
"version": 3,
|
3 |
+
"mappings": "AAAA;;oBAEoB;AAEpB,gBAAgB;AAmBhB,kEAAkE;AAC9C,kCAAkC;AAStD,qBAAqB;AAOrB,8CAA8C;AAK9C,gBAAgB;AC1ChB,UAAW;ECHX;;qCAEmC;ECFnC;;uBAEqB;EAErB,gBAAgB;EA4BhB,6BAA6B;EAM7B,eAAe;EAef,aAAa;EAuBb,YAAY;;ADxEZ,oCAA0B;EACzB,OAAO,EAAE,IAAI;;AAGd,yBAAe;EACX,WAAW,EAAE,KAAiB;EAC9B,SAAS,EAAE,CAAC;;AAGhB,wBAAc;EACV,OAAO,EAAE,YAAY;EACrB,MAAM,EAAE,WAAmB;EAC3B,SAAS,EAAE,OAAO;EAClB,cAAc,EAAE,GAAG;EACnB,WAAW,EAAE,CAAC;;AACd,wCAAkB;EACjB,UAAU,EAAE,CAAC;;AAIlB,gCAAsB;EACrB,KAAK,EAAE,IAAI;;AAGZ,kCAAwB;EACvB,MAAM,EAAE,QAAQ;;AAChB,sCAAI;EACH,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,IAAI;;AAId,yBAAe;EACd,KAAK,EFUM,KAAkB;;AER9B,yBAAe;EACd,KAAK,EFQM,OAAsB;;AENlC,yBAAe;EACd,KAAK,EFMM,KAAkB;;AEJ9B,yBAAe;EACd,KAAK,EFIM,KAAkB;;AEF9B,yBAAe;EACd,KAAK,EFEM,OAAsB;;AG7ClC,wBAAc;EACb,SAAS,EHDE,IAAI;EGEf,UAAU,EAAE,MAAM;;AAWd,6CAAoB;EACn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,kBAAmB;IAClB,OAAO,EAAE,KAAK;;;EAEf;0BACyB;IACxB,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,CAAC;;;EAEf,wBAAyB;IACxB,aAAa,EAAE,IAAI;;;EAEpB,oBAAqB;IACpB,UAAU,EAAE,IAAI;;;EAGhB,wCAAuB;IACtB,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,IAAI;;EAErB,8CAA6B;IAC5B,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,KAAK;IACX,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,CAAC;;EAEb,kCAAiB;IAChB,OAAO,EAAE,YAAY;;EAEtB,sCAAoB;IACnB,UAAU,EAAE,IAAI;;EAEjB,+BAAc;IACb,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE,KAAK;;EAElB;6BACU;IACT,UAAU,EAAE,IAAI;;;EAKhB,sCAAQ;IACP,SAAS,EAAE,IAAI;IACZ,OAAO,EAAE,KAAK;;EAElB,0DAA6B;IACzB,WAAW,EAAE,CAAC;;;EAKpB;2CAC2C;IAC1C,KAAK,EAAE,IAAI;IAEX,KAAK,EAAE,IAAI;;;EAEZ;;gCACyB;IACxB,KAAK,EAAE,IAAI;;;EAGZ,wDAAyB;IACxB,UAAU,EAAE,GAAG;;;EAGhB,wDAAyD;IACxD,OAAO,EAAE,IAAI;;;EAGd,gCAAiC;IAChC,OAAO,EAAE,KAAK;;;EAGf,yCAA0C;IACzC,MAAM,EAAE,CAAC;;;EAGV,cAAe;IACd,OAAO,EAAE,KAAK;;;EAEf,yBAA0B;IACzB,SAAS,EAAE,GAAG",
|
4 |
+
"sources": ["../scss/partials/_variables.scss","../scss/wpsc-responsive.scss","../scss/partials/_product-grid.scss","../scss/partials/_product-grid-opinions.scss","../scss/partials/_mixins.scss","../scss/partials/_product-list.scss","../scss/partials/_shopping-cart.scss","../scss/partials/_mobile-and-sidebar.scss","../scss/partials/_checkout.scss","../scss/partials/_account.scss","../scss/partials/_js-float-label.scss","../scss/partials/_product-forms.scss","../scss/partials/_media-queries.scss"],
|
5 |
"names": [],
|
6 |
"file": "wpsc-responsive.css"
|
7 |
}
|
wpsc-components/theme-engine-v2/theming/assets/css/wpsc-responsive.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wpsc-grid .wpsc-product-description{display:none}.wpsc-grid #wpsc-products{margin-left:-2.5%;font-size:0}.wpsc-grid .wpsc-product{margin:0 0 7% 2.5%;vertical-align:top}.wpsc-grid .wpsc-page-main-store .wpsc-product-summary{width:100%}.wpsc-grid .wpsc-product-thumbnail{margin:0 0 10px}.wpsc-grid .wpsc-product-thumbnail img{max-width:100%;height:auto}.wpsc-grid .wpsc-column-2{width:47.5%}.wpsc-grid .wpsc-column-3{width:30.833%}.wpsc-grid .wpsc-column-4{width:22.5%}.wpsc-grid .wpsc-column-5{width:17.5%}.wpsc-grid .wpsc-column-6{width:14.166%}.wpsc-grid .wpsc-product{font-size:16px;text-align:center}.wpsc-grid .wpsc-column-2 .wpsc-product-title{font-size:1.75em}.wpsc-grid .wpsc-column-2 .wpsc-old-price{font-size:.85em}.wpsc-grid .wpsc-column-2 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-2 .wpsc-sale,.wpsc-grid .wpsc-column-2 .wpsc-sale-price .wpsc-amount{font-size:1.25em}.wpsc-grid .wpsc-column-3 .wpsc-product-title{font-size:1.35em}.wpsc-grid .wpsc-column-3 .wpsc-old-price{font-size:.8em}.wpsc-grid .wpsc-column-3 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-3 .wpsc-sale,.wpsc-grid .wpsc-column-3 .wpsc-sale-price .wpsc-amount{font-size:1em}.wpsc-grid .wpsc-column-4 .wpsc-product-title{font-size:1.25em}.wpsc-grid .wpsc-column-4 .wpsc-old-price{font-size:.7em}.wpsc-grid .wpsc-column-4 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-4 .wpsc-sale,.wpsc-grid .wpsc-column-4 .wpsc-sale-price .wpsc-amount{font-size:.9em}.wpsc-grid .wpsc-column-5 .wpsc-product-title{font-size:1.15em}.wpsc-grid .wpsc-column-5 .wpsc-old-price{font-size:.65em}.wpsc-grid .wpsc-column-5 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-sale,.wpsc-grid .wpsc-column-5 .wpsc-sale-price .wpsc-amount{font-size:.85em}.wpsc-grid .wpsc-column-6 .wpsc-product-title{font-size:1.05em}.wpsc-grid .wpsc-column-6 .wpsc-old-price{font-size:.6em}.wpsc-grid .wpsc-column-6 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-sale,.wpsc-grid .wpsc-column-6 .wpsc-sale-price .wpsc-amount{font-size:.8em}.wpsc-grid .wpsc-thumbnail-wrapper{margin-bottom:16px}.wpsc-grid .wpsc-field,.wpsc-grid .wpsc-field-quantity,.wpsc-grid .wpsc-product-price br{display:none}.wpsc-grid .wpsc-old-price{font-size:.8em;color:#666}.wpsc-grid ins.wpsc-sale-price{background:initial;margin-left:5px;white-space:nowrap;color:initial}.wpsc-grid #wpsc-products{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.wpsc-grid .wpsc-product,.wpsc-grid .wpsc-product-header,.wpsc-grid .wpsc-product-summary{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.wpsc-grid .wpsc-product-header,.wpsc-grid .wpsc-product-summary{-webkit-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;justify-content:space-between}.wpsc-grid .wpsc-product-summary{height:100%}.wpsc-grid .wpsc-product-header{-webkit-box-flex:1 0 auto;-moz-box-flex:1 0 auto;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto}.wpsc-grid .wpsc-form-actions button{margin-left:auto;margin-right:auto}.wpsc-list .wpsc-thumbnail-wrapper{display:inline-block}.wpsc-list .wpsc-product-summary{display:inline-block;float:right}.wpsc-single .wpsc-thumbnail-wrapper{display:inline-block}.wpsc-single .wpsc-product-summary{display:inline-block;float:right}.wpsc-cart-table{width:100%}.wpsc-cart-footer,.wpsc-cart-item,.wpsc-row{display:block;padding:20px 0;border-bottom:1px solid #ccc}.wpsc-cart-header{border-top:1px solid #ccc}.wpsc-cart-cell-header{font-size:12px;font-weight:600}.wpsc-cart-cell,.wpsc-cart-cell-header{display:inline-block;margin-right:2.5%}.wpsc-cart-cell-header:last-of-type,.wpsc-cart-cell:last-of-type{margin-right:0}.wpsc-form-actions{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:flex-end;-moz-justify-content:flex-end;-ms-justify-content:flex-end;justify-content:flex-end;-webkit-align-items:center;-moz-align-items:center;-ms-align-items:center;align-items:center}.express-checkout-button,.wpsc-begin-checkout{display:inline-block;vertical-align:bottom;box-shadow:none!important}.paypal-express-separator{margin:0 .5em}.wpsc-cart-cell-header.image,.wpsc-cart-cell.image{width:20%}.wpsc-cart-cell-header.items,.wpsc-cart-cell.items{width:34%}.wpsc-cart-cell-header.quantity,.wpsc-cart-cell-header.unit-price,.wpsc-cart-cell.quantity,.wpsc-cart-cell.unit-price{width:12%}.wpsc-cart-quantity-input{width:100%}.wpsc-cart-cell-header.item-total,.wpsc-cart-cell.item-total{width:12%}.wpsc-cart-footer .wpsc-cart-aggregate,.wpsc-cart-footer .wpsc-cart-cell{text-align:right;margin-right:0}.wpsc-cart-footer .wpsc-row{border:0;padding:0}.wpsc-cart-footer .wpsc-cart-actions-row{text-align:justify;padding-bottom:0}.wpsc-cart-footer .wpsc-cart-actions-row:after{content:'';display:inline-block;width:100%;height:0}.wpsc-cart-footer .apply-coupon{vertical-align:top;text-align:left}.wpsc-cart-footer .update-quantity{text-align:right}.widget-area .wpsc-cart-cell,.widget-area .wpsc-cart-cell-header{display:block}.widget-area .wpsc-cart-header{display:none}.widget-area .wpsc-cart-cell-header.date,.widget-area .wpsc-cart-cell-header.id,.widget-area .wpsc-cart-cell-header.image,.widget-area .wpsc-cart-cell-header.item-total,.widget-area .wpsc-cart-cell-header.items,.widget-area .wpsc-cart-cell-header.quantity,.widget-area .wpsc-cart-cell-header.status,.widget-area .wpsc-cart-cell-header.total,.widget-area .wpsc-cart-cell-header.tracking-id,.widget-area .wpsc-cart-cell-header.unit-price,.widget-area .wpsc-cart-cell.date,.widget-area .wpsc-cart-cell.id,.widget-area .wpsc-cart-cell.image,.widget-area .wpsc-cart-cell.item-total,.widget-area .wpsc-cart-cell.items,.widget-area .wpsc-cart-cell.quantity,.widget-area .wpsc-cart-cell.status,.widget-area .wpsc-cart-cell.total,.widget-area .wpsc-cart-cell.tracking-id,.widget-area .wpsc-cart-cell.unit-price{width:100%}.widget-area .wpsc-cart-cell-header.date:before,.widget-area .wpsc-cart-cell-header.id:before,.widget-area .wpsc-cart-cell-header.item-total:before,.widget-area .wpsc-cart-cell-header.quantity:before,.widget-area .wpsc-cart-cell-header.status:before,.widget-area .wpsc-cart-cell-header.total:before,.widget-area .wpsc-cart-cell-header.tracking-id:before,.widget-area .wpsc-cart-cell-header.unit-price:before,.widget-area .wpsc-cart-cell.date:before,.widget-area .wpsc-cart-cell.id:before,.widget-area .wpsc-cart-cell.item-total:before,.widget-area .wpsc-cart-cell.quantity:before,.widget-area .wpsc-cart-cell.status:before,.widget-area .wpsc-cart-cell.total:before,.widget-area .wpsc-cart-cell.tracking-id:before,.widget-area .wpsc-cart-cell.unit-price:before{font-weight:600;content:attr(data-title)}.widget-area .wpsc-cart-quantity-input{width:25%}.widget-area .wpsc-cart-item-title{font-size:1.15em}.widget-area .wpsc-cart-item:first-of-type{padding-top:0}.widget-area .wpsc-form-actions.bottom{padding-top:20px}.widget-area .wpsc-cart-cell.update-quantity{text-align:center}.widget-area .wpsc-cart-update{float:none}.widget-area .wpsc-clear-cart{display:block;text-align:center}.widget-area .wpsc-cart-subtotal-row .wpsc-cart-cell,.widget-area .wpsc-cart-subtotal-row .wpsc-cart-cell-header{text-align:center}.widget-area .wpsc-cart-subtotal-row .wpsc-cart-cell{font-size:1.35em}.widget-area .wpsc-form-actions button{margin-left:auto;margin-right:auto}.widget-area [class*=widget_wpsc_] ul{margin-left:0}.widget-area [class*=widget_wpsc_] li{list-style-type:none}.widget-area .wpsc-widget-latest-product-list-item{margin-bottom:1.5em}.widget-area .wpsc-widget-latest-product-list-item a{font-size:1.15em}.widget-area .widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-product-price{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;justify-content:space-between}.widget-area .widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-sale-price{font-weight:600}.widget-area .widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-you-save{width:100%;font-size:.8em}.wpsc-checkout .entry-content .wpsc-field-textfield input{width:100%}.wpsc-checkout .entry-content #wpsc-checkout-form-shipping{margin-left:5%}.wpsc-checkout .entry-content fieldset{width:47.5%;display:inline-block;vertical-align:top}.wpsc-checkout .entry-content #wpsc-checkout-form .wpsc-form-actions,.wpsc-checkout .entry-content .wpsc-field-wpsc_shipping_option,.wpsc-checkout .entry-content .wpsc-payment-method,.wpsc-checkout .entry-content .wpsc-shipping-method{text-align:left}.wpsc-checkout .entry-content .wpsc-order-preview{margin-bottom:1.5em}.wpsc-checkout .entry-content .wpsc-cart-quantity-input{width:40px}.wpsc-checkout .entry-content .wpsc-form-radio-wrapper img{vertical-align:middle}.wpsc-cart-cell-header.id,.wpsc-cart-cell.id{width:10%}.wpsc-cart-cell-header.date,.wpsc-cart-cell-header.status,.wpsc-cart-cell.date,.wpsc-cart-cell.status{width:20%}.wpsc-cart-cell-header.tracking-id,.wpsc-cart-cell.tracking-id{width:30%}.wpsc-cart-cell-header.total,.wpsc-cart-cell.total{width:10%}.wpsc-customer-account-order-details p{margin-bottom:3px}.wpsc-cart-cell-header.product,.wpsc-cart-cell.product{width:35%;margin-right:5%}.wpsc-customer-account-digital-content ul,.wpsc-page-customer-account ul{margin:0 0 10px;list-style-position:inside;padding:0}.wpsc-cart-cell-header.content,.wpsc-cart-cell.contents{width:60%}.wpsc-digital-product-title{font-size:1.35em;text-align:center;margin-bottom:1em}.wpsc-digital-product-items li:only-of-type{list-style:none}.wpsc-customer-account-digital-content .wpsc-cart-header{border-top:0}@media (max-width:960px){.wpsc-grid .wpsc-column-5,.wpsc-grid .wpsc-column-6{width:22.5%}.wpsc-grid .wpsc-column-5 .wpsc-product-title,.wpsc-grid .wpsc-column-6 .wpsc-product-title{font-size:1.25em}.wpsc-grid .wpsc-column-5 .wpsc-old-price,.wpsc-grid .wpsc-column-6 .wpsc-old-price{font-size:.7em}.wpsc-grid .wpsc-column-5 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-sale,.wpsc-grid .wpsc-column-5 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-sale,.wpsc-grid .wpsc-column-6 .wpsc-sale-price .wpsc-amount{font-size:.9em}}@media (max-width:700px){.wpsc-grid .wpsc-column-4,.wpsc-grid .wpsc-column-5,.wpsc-grid .wpsc-column-6{width:30.833%}.wpsc-grid .wpsc-column-4 .wpsc-product-title,.wpsc-grid .wpsc-column-5 .wpsc-product-title,.wpsc-grid .wpsc-column-6 .wpsc-product-title{font-size:1.35em}.wpsc-grid .wpsc-column-4 .wpsc-old-price,.wpsc-grid .wpsc-column-5 .wpsc-old-price,.wpsc-grid .wpsc-column-6 .wpsc-old-price{font-size:.8em}.wpsc-grid .wpsc-column-4 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-4 .wpsc-sale,.wpsc-grid .wpsc-column-4 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-sale,.wpsc-grid .wpsc-column-5 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-sale,.wpsc-grid .wpsc-column-6 .wpsc-sale-price .wpsc-amount{font-size:1em}.wpsc-cart-cell-header.date,.wpsc-cart-cell-header.id,.wpsc-cart-cell-header.status,.wpsc-cart-cell-header.total,.wpsc-cart-cell-header.tracking-id,.wpsc-cart-cell.date,.wpsc-cart-cell.id,.wpsc-cart-cell.status,.wpsc-cart-cell.total,.wpsc-cart-cell.tracking-id{width:100%}.wpsc-cart-cell-header.date:before,.wpsc-cart-cell-header.id:before,.wpsc-cart-cell-header.status:before,.wpsc-cart-cell-header.total:before,.wpsc-cart-cell-header.tracking-id:before,.wpsc-cart-cell.date:before,.wpsc-cart-cell.id:before,.wpsc-cart-cell.status:before,.wpsc-cart-cell.total:before,.wpsc-cart-cell.tracking-id:before{font-weight:600;content:attr(data-title)}.wpsc-customer-account-index .wpsc-cart-footer,.wpsc-customer-account-index .wpsc-cart-header{display:none}}@media (max-width:550px){.wpsc-cart-cell,.wpsc-cart-cell-header{display:block}.wpsc-cart-header{display:none}.wpsc-cart-cell-header.date,.wpsc-cart-cell-header.id,.wpsc-cart-cell-header.image,.wpsc-cart-cell-header.item-total,.wpsc-cart-cell-header.items,.wpsc-cart-cell-header.quantity,.wpsc-cart-cell-header.status,.wpsc-cart-cell-header.total,.wpsc-cart-cell-header.tracking-id,.wpsc-cart-cell-header.unit-price,.wpsc-cart-cell.date,.wpsc-cart-cell.id,.wpsc-cart-cell.image,.wpsc-cart-cell.item-total,.wpsc-cart-cell.items,.wpsc-cart-cell.quantity,.wpsc-cart-cell.status,.wpsc-cart-cell.total,.wpsc-cart-cell.tracking-id,.wpsc-cart-cell.unit-price{width:100%}.wpsc-cart-cell-header.date:before,.wpsc-cart-cell-header.id:before,.wpsc-cart-cell-header.item-total:before,.wpsc-cart-cell-header.quantity:before,.wpsc-cart-cell-header.status:before,.wpsc-cart-cell-header.total:before,.wpsc-cart-cell-header.tracking-id:before,.wpsc-cart-cell-header.unit-price:before,.wpsc-cart-cell.date:before,.wpsc-cart-cell.id:before,.wpsc-cart-cell.item-total:before,.wpsc-cart-cell.quantity:before,.wpsc-cart-cell.status:before,.wpsc-cart-cell.total:before,.wpsc-cart-cell.tracking-id:before,.wpsc-cart-cell.unit-price:before{font-weight:600;content:attr(data-title)}.wpsc-cart-quantity-input{width:25%}.wpsc-cart-item-title{font-size:1.15em}.wpsc-cart-item:first-of-type{padding-top:0}.wpsc-form-actions.bottom{padding-top:20px}.wpsc-cart-cell.update-quantity{text-align:center}.wpsc-cart-update{float:none}.wpsc-clear-cart{display:block;text-align:center}.wpsc-cart-subtotal-row .wpsc-cart-cell,.wpsc-cart-subtotal-row .wpsc-cart-cell-header{text-align:center}.wpsc-cart-subtotal-row .wpsc-cart-cell{font-size:1.35em}.wpsc-form-actions button{margin-left:auto;margin-right:auto}[class*=widget_wpsc_] ul{margin-left:0}[class*=widget_wpsc_] li{list-style-type:none}.wpsc-widget-latest-product-list-item{margin-bottom:1.5em}.wpsc-widget-latest-product-list-item a{font-size:1.15em}.widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-product-price{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;justify-content:space-between}.widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-sale-price{font-weight:600}.widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-you-save{width:100%;font-size:.8em}.wpsc-grid .wpsc-column-2,.wpsc-grid .wpsc-column-3,.wpsc-grid .wpsc-column-4,.wpsc-grid .wpsc-column-5,.wpsc-grid .wpsc-column-6{width:100%}.wpsc-grid .wpsc-column-2 .wpsc-product-title,.wpsc-grid .wpsc-column-3 .wpsc-product-title,.wpsc-grid .wpsc-column-4 .wpsc-product-title,.wpsc-grid .wpsc-column-5 .wpsc-product-title,.wpsc-grid .wpsc-column-6 .wpsc-product-title{font-size:1.75em}.wpsc-grid .wpsc-column-2 .wpsc-old-price,.wpsc-grid .wpsc-column-3 .wpsc-old-price,.wpsc-grid .wpsc-column-4 .wpsc-old-price,.wpsc-grid .wpsc-column-5 .wpsc-old-price,.wpsc-grid .wpsc-column-6 .wpsc-old-price{font-size:.85em}.wpsc-grid .wpsc-column-2 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-2 .wpsc-sale,.wpsc-grid .wpsc-column-2 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-3 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-3 .wpsc-sale,.wpsc-grid .wpsc-column-3 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-4 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-4 .wpsc-sale,.wpsc-grid .wpsc-column-4 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-sale,.wpsc-grid .wpsc-column-5 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-sale,.wpsc-grid .wpsc-column-6 .wpsc-sale-price .wpsc-amount{font-size:1.25em}.wpsc-list .wpsc-product-summary,.wpsc-list .wpsc-thumbnail-wrapper,.wpsc-single .wpsc-product-summary,.wpsc-single .wpsc-thumbnail-wrapper{display:block;float:none;width:100%}.wpsc-controller .wpsc-shopping-cart .wpsc-form-actions{text-align:left}.wpsc-form-actions{display:block}.express-checkout-button,.wpsc-begin-checkout{display:block;text-align:left;margin-left:0}.express-checkout-button{margin-bottom:20px}.wpsc-begin-checkout{margin-top:20px}.wpsc-cart-footer .wpsc-cart-actions-row{text-align:right;padding-bottom:20px}.wpsc-cart-footer .wpsc-cart-actions-row:after{text-align:right;display:block;width:100%;height:0}.wpsc-cart-footer .update-quantity{display:inline-block}.wpsc-cart-footer .wpsc-cart-aggregate{text-align:left}.wpsc-cart-footer .apply-coupon{margin-bottom:20px;text-align:right}.wpsc-cart-footer .wpsc-cart-cell,.wpsc-cart-footer .wpsc-row{text-align:left}.wpsc-checkout .entry-content fieldset{min-width:100%;display:block}.wpsc-checkout .entry-content #wpsc-checkout-form-shipping{margin-left:0}.wpsc-controller .wpsc-create-account-offer,.wpsc-controller .wpsc-login-form-wrapper{float:none;width:100%}.wpsc-cart-cell-header.content,.wpsc-cart-cell-header.product,.wpsc-cart-cell.contents,.wpsc-cart-cell.product{width:100%}.wpsc-cart-cell-header.content,.wpsc-cart-cell.contents{margin-top:1em}.wpsc-customer-account-digital-content .wpsc-cart-footer{display:none}.wpsc-controller .wpsc-tabs>li{display:block}.wpsc-controller .wpsc-tabs>.active>a{border:0}.wpsc-tab-item{padding:5px 0}.wpsc-cart-quantity-input{max-width:50%}}
|
1 |
+
.wpsc-grid .wpsc-product-description{display:none}.wpsc-grid #wpsc-products{margin-left:-2.5%;font-size:0}.wpsc-grid .wpsc-product{margin:0 0 7% 2.5%;vertical-align:top;padding-top:0}.wpsc-grid .wpsc-product+.wpsc-product{margin-top:0}.wpsc-grid .wpsc-product-summary{width:100%}.wpsc-grid .wpsc-product-thumbnail{margin:0 0 10px}.wpsc-grid .wpsc-product-thumbnail img{max-width:100%;height:auto}.wpsc-grid .wpsc-column-2{width:47.5%}.wpsc-grid .wpsc-column-3{width:30.833%}.wpsc-grid .wpsc-column-4{width:22.5%}.wpsc-grid .wpsc-column-5{width:17.5%}.wpsc-grid .wpsc-column-6{width:14.166%}.wpsc-grid .wpsc-product{font-size:16px;text-align:center}.wpsc-grid .wpsc-column-2 .wpsc-product-title{font-size:1.75em}.wpsc-grid .wpsc-column-2 .wpsc-old-price{font-size:.85em}.wpsc-grid .wpsc-column-2 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-2 .wpsc-sale,.wpsc-grid .wpsc-column-2 .wpsc-sale-price .wpsc-amount{font-size:1.25em}.wpsc-grid .wpsc-column-3 .wpsc-product-title{font-size:1.35em}.wpsc-grid .wpsc-column-3 .wpsc-old-price{font-size:.8em}.wpsc-grid .wpsc-column-3 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-3 .wpsc-sale,.wpsc-grid .wpsc-column-3 .wpsc-sale-price .wpsc-amount{font-size:1em}.wpsc-grid .wpsc-column-4 .wpsc-product-title{font-size:1.25em}.wpsc-grid .wpsc-column-4 .wpsc-old-price{font-size:.7em}.wpsc-grid .wpsc-column-4 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-4 .wpsc-sale,.wpsc-grid .wpsc-column-4 .wpsc-sale-price .wpsc-amount{font-size:.9em}.wpsc-grid .wpsc-column-5 .wpsc-product-title{font-size:1.15em}.wpsc-grid .wpsc-column-5 .wpsc-old-price{font-size:.65em}.wpsc-grid .wpsc-column-5 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-sale,.wpsc-grid .wpsc-column-5 .wpsc-sale-price .wpsc-amount{font-size:.85em}.wpsc-grid .wpsc-column-6 .wpsc-product-title{font-size:1.05em}.wpsc-grid .wpsc-column-6 .wpsc-old-price{font-size:.6em}.wpsc-grid .wpsc-column-6 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-sale,.wpsc-grid .wpsc-column-6 .wpsc-sale-price .wpsc-amount{font-size:.8em}.wpsc-grid .wpsc-thumbnail-wrapper{margin-bottom:16px}.wpsc-grid .wpsc-field,.wpsc-grid .wpsc-field-quantity,.wpsc-grid .wpsc-product-price br{display:none}.wpsc-grid .wpsc-old-price{font-size:.8em;color:#666}.wpsc-grid ins.wpsc-sale-price{background:initial;margin-left:5px;white-space:nowrap;color:initial}.wpsc-grid #wpsc-products{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.wpsc-grid .wpsc-product,.wpsc-grid .wpsc-product-header,.wpsc-grid .wpsc-product-summary{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.wpsc-grid .wpsc-product-header,.wpsc-grid .wpsc-product-summary{-webkit-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;justify-content:space-between}.wpsc-grid .wpsc-product-summary{height:100%}.wpsc-grid .wpsc-product-header{-webkit-box-flex:1 0 auto;-moz-box-flex:1 0 auto;-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto}.wpsc-grid .wpsc-form-actions button{margin-left:auto;margin-right:auto}.wpsc-list .wpsc-thumbnail-wrapper{display:inline-block}.wpsc-list .wpsc-product-summary{display:inline-block;float:right}.wpsc-list .wpsc-add-to-cart-form{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:flex-start;-moz-justify-content:flex-start;-ms-justify-content:flex-start;justify-content:flex-start;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-align-items:center;-moz-align-items:center;-ms-align-items:center;align-items:center}.wpsc-list .wpsc-add-to-cart-form .wpsc-form-actions{margin-bottom:0}.wpsc-list .wpsc-add-to-cart-form .wpsc-field{margin-right:5%}.wpsc-single .wpsc-thumbnail-wrapper{display:inline-block}.wpsc-single .wpsc-product-summary{display:inline-block;float:right}.wpsc-single .wpsc-add-to-cart-form{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:flex-start;-moz-justify-content:flex-start;-ms-justify-content:flex-start;justify-content:flex-start;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-align-items:center;-moz-align-items:center;-ms-align-items:center;align-items:center}.wpsc-single .wpsc-add-to-cart-form .wpsc-form-actions{margin-bottom:0}.wpsc-single .wpsc-add-to-cart-form .wpsc-field{margin-right:5%}.wpsc-cart-table{width:100%}.wpsc-cart-footer,.wpsc-cart-item,.wpsc-row{display:block;padding:20px 0;border-bottom:1px solid #ccc}.wpsc-cart-header{border-top:1px solid #ccc}.wpsc-cart-cell-header{font-size:12px;font-weight:600}.wpsc-cart-cell,.wpsc-cart-cell-header{display:inline-block;margin-right:2.5%}.wpsc-cart-cell-header:last-of-type,.wpsc-cart-cell:last-of-type{margin-right:0}.wpsc-form-actions{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:flex-end;-moz-justify-content:flex-end;-ms-justify-content:flex-end;justify-content:flex-end;-webkit-align-items:center;-moz-align-items:center;-ms-align-items:center;align-items:center}.express-checkout-button,.wpsc-begin-checkout{display:inline-block;vertical-align:bottom;box-shadow:none!important}.paypal-express-separator{margin:0 .5em}.wpsc-cart-cell-header.image,.wpsc-cart-cell.image{width:20%}.wpsc-cart-cell-header.items,.wpsc-cart-cell.items{width:34%}.wpsc-cart-cell-header.quantity,.wpsc-cart-cell-header.unit-price,.wpsc-cart-cell.quantity,.wpsc-cart-cell.unit-price{width:12%}.wpsc-cart-quantity-input{width:100%}.wpsc-cart-cell-header.item-total,.wpsc-cart-cell.item-total{width:12%}.wpsc-cart-footer .wpsc-cart-aggregate,.wpsc-cart-footer .wpsc-cart-cell{text-align:right;margin-right:0}.wpsc-cart-footer .wpsc-row{border:0;padding:0}.wpsc-cart-footer .wpsc-cart-actions-row{text-align:justify;padding-bottom:0}.wpsc-cart-footer .wpsc-cart-actions-row:after{content:'';display:inline-block;width:100%;height:0}.wpsc-cart-footer .apply-coupon{vertical-align:top;text-align:left}.wpsc-cart-footer .update-quantity{text-align:right}.widget-area .wpsc-cart-cell,.widget-area .wpsc-cart-cell-header{display:block}.widget-area .wpsc-cart-header{display:none}.widget-area .wpsc-cart-cell-header.date,.widget-area .wpsc-cart-cell-header.id,.widget-area .wpsc-cart-cell-header.image,.widget-area .wpsc-cart-cell-header.item-total,.widget-area .wpsc-cart-cell-header.items,.widget-area .wpsc-cart-cell-header.quantity,.widget-area .wpsc-cart-cell-header.status,.widget-area .wpsc-cart-cell-header.total,.widget-area .wpsc-cart-cell-header.tracking-id,.widget-area .wpsc-cart-cell-header.unit-price,.widget-area .wpsc-cart-cell.date,.widget-area .wpsc-cart-cell.id,.widget-area .wpsc-cart-cell.image,.widget-area .wpsc-cart-cell.item-total,.widget-area .wpsc-cart-cell.items,.widget-area .wpsc-cart-cell.quantity,.widget-area .wpsc-cart-cell.status,.widget-area .wpsc-cart-cell.total,.widget-area .wpsc-cart-cell.tracking-id,.widget-area .wpsc-cart-cell.unit-price{width:100%}.widget-area .wpsc-cart-cell-header.date:before,.widget-area .wpsc-cart-cell-header.id:before,.widget-area .wpsc-cart-cell-header.item-total:before,.widget-area .wpsc-cart-cell-header.quantity:before,.widget-area .wpsc-cart-cell-header.status:before,.widget-area .wpsc-cart-cell-header.total:before,.widget-area .wpsc-cart-cell-header.tracking-id:before,.widget-area .wpsc-cart-cell-header.unit-price:before,.widget-area .wpsc-cart-cell.date:before,.widget-area .wpsc-cart-cell.id:before,.widget-area .wpsc-cart-cell.item-total:before,.widget-area .wpsc-cart-cell.quantity:before,.widget-area .wpsc-cart-cell.status:before,.widget-area .wpsc-cart-cell.total:before,.widget-area .wpsc-cart-cell.tracking-id:before,.widget-area .wpsc-cart-cell.unit-price:before{font-weight:600;content:attr(data-title)}.widget-area .wpsc-cart-quantity-input{width:25%}.widget-area .wpsc-cart-item-title{font-size:1.15em}.widget-area .wpsc-cart-item:first-of-type{padding-top:0}.widget-area .wpsc-form-actions.bottom{padding-top:20px}.widget-area .wpsc-cart-cell.update-quantity{text-align:center}.widget-area .wpsc-cart-update{float:none}.widget-area .wpsc-clear-cart{display:block;text-align:center}.widget-area .wpsc-cart-subtotal-row .wpsc-cart-cell,.widget-area .wpsc-cart-subtotal-row .wpsc-cart-cell-header{text-align:center}.widget-area .wpsc-cart-subtotal-row .wpsc-cart-cell{font-size:1.35em}.widget-area .wpsc-form-actions button{margin-left:auto;margin-right:auto}.widget-area [class*=widget_wpsc_] ul{margin-left:0}.widget-area [class*=widget_wpsc_] li{list-style-type:none}.widget-area .wpsc-widget-latest-product-list-item{margin-bottom:1.5em}.widget-area .wpsc-widget-latest-product-list-item a{font-size:1.15em}.widget-area .widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-product-price{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;justify-content:space-between}.widget-area .widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-sale-price{font-weight:600}.widget-area .widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-you-save{width:100%;font-size:.8em}.wpsc-checkout .wpsc-field-textfield input{width:100%}.wpsc-checkout #wpsc-checkout-form-shipping{margin-left:5%}.wpsc-checkout .wpsc-checkout-form .wpsc-form-actions,.wpsc-checkout .wpsc-field-wpsc_shipping_option,.wpsc-checkout .wpsc-payment-method,.wpsc-checkout .wpsc-shipping-method{text-align:left}.wpsc-checkout .wpsc-checkout-form{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;justify-content:space-between}.wpsc-checkout .wpsc-checkout-form .wpsc-form-actions{width:100%}.wpsc-checkout .wpsc-checkout-form fieldset{margin:0 0 2em;vertical-align:top;-webkit-align-self:flex-start;-moz-align-self:flex-start;-ms-align-self:flex-start;align-self:flex-start;-webkit-flex-grow:1;-moz-flex-grow:1;-ms-flex-grow:1;flex-grow:1;-webkit-flex-basis:3%;-moz-flex-basis:3%;-ms-flex-basis:3%;flex-basis:3%}.wpsc-checkout .wpsc-order-preview{margin-bottom:1.5em}.wpsc-checkout .wpsc-cart-quantity-input{width:40px}.wpsc-checkout .wpsc-form-radio-wrapper img{vertical-align:middle}.wpsc-checkout .wpsc-paypal li{list-style-type:none}.wpsc-cart-cell-header.id,.wpsc-cart-cell.id{width:10%}.wpsc-cart-cell-header.date,.wpsc-cart-cell-header.status,.wpsc-cart-cell.date,.wpsc-cart-cell.status{width:20%}.wpsc-cart-cell-header.tracking-id,.wpsc-cart-cell.tracking-id{width:30%}.wpsc-cart-cell-header.total,.wpsc-cart-cell.total{width:10%}.wpsc-customer-account-order-details p{margin-bottom:3px}.wpsc-cart-cell-header.product,.wpsc-cart-cell.product{width:35%;margin-right:5%}.wpsc-customer-account-digital-content ul,.wpsc-page-customer-account ul{margin:0 0 10px;list-style-position:inside;padding:0}.wpsc-cart-cell-header.content,.wpsc-cart-cell.contents{width:60%}.wpsc-digital-product-title{font-size:1.35em;text-align:center;margin-bottom:1em}.wpsc-digital-product-items li:only-of-type{list-style:none}.wpsc-customer-account-digital-content .wpsc-cart-header{border-top:0}.wpsc-controller.wpsc-float-js .wpsc-field-password,.wpsc-controller.wpsc-float-js .wpsc-field-select_country,.wpsc-controller.wpsc-float-js .wpsc-field-select_region,.wpsc-controller.wpsc-float-js .wpsc-field-textfield{position:relative}.wpsc-controller.wpsc-float-js .wpsc-field-password input,.wpsc-controller.wpsc-float-js .wpsc-field-password textarea,.wpsc-controller.wpsc-float-js .wpsc-field-select_country input,.wpsc-controller.wpsc-float-js .wpsc-field-select_country textarea,.wpsc-controller.wpsc-float-js .wpsc-field-select_region input,.wpsc-controller.wpsc-float-js .wpsc-field-select_region textarea,.wpsc-controller.wpsc-float-js .wpsc-field-textfield input,.wpsc-controller.wpsc-float-js .wpsc-field-textfield textarea{padding:1em}.wpsc-controller.wpsc-float-js .wpsc-field-password input,.wpsc-controller.wpsc-float-js .wpsc-field-password label,.wpsc-controller.wpsc-float-js .wpsc-field-password textarea,.wpsc-controller.wpsc-float-js .wpsc-field-select_country input,.wpsc-controller.wpsc-float-js .wpsc-field-select_country label,.wpsc-controller.wpsc-float-js .wpsc-field-select_country textarea,.wpsc-controller.wpsc-float-js .wpsc-field-select_region input,.wpsc-controller.wpsc-float-js .wpsc-field-select_region label,.wpsc-controller.wpsc-float-js .wpsc-field-select_region textarea,.wpsc-controller.wpsc-float-js .wpsc-field-textfield input,.wpsc-controller.wpsc-float-js .wpsc-field-textfield label,.wpsc-controller.wpsc-float-js .wpsc-field-textfield textarea{-webkit-transition:.2s ease-in-out;-moz-transition:.2s ease-in-out;-ms-transition:.2s ease-in-out;-o-transition:.2s ease-in-out;transition:.2s ease-in-out}.wpsc-controller.wpsc-float-js .wpsc-field-password label,.wpsc-controller.wpsc-float-js .wpsc-field-select_country label,.wpsc-controller.wpsc-float-js .wpsc-field-select_region label,.wpsc-controller.wpsc-float-js .wpsc-field-textfield label{position:absolute;top:1em;left:1em;opacity:0}.wpsc-controller.wpsc-float-js .wpsc-field-password.focused label,.wpsc-controller.wpsc-float-js .wpsc-field-password.populated label,.wpsc-controller.wpsc-float-js .wpsc-field-select_country.focused label,.wpsc-controller.wpsc-float-js .wpsc-field-select_country.populated label,.wpsc-controller.wpsc-float-js .wpsc-field-select_region.focused label,.wpsc-controller.wpsc-float-js .wpsc-field-select_region.populated label,.wpsc-controller.wpsc-float-js .wpsc-field-textfield.focused label,.wpsc-controller.wpsc-float-js .wpsc-field-textfield.populated label{opacity:1;top:0;left:1em;font-size:.65em;font-weight:600}.wpsc-controller.wpsc-float-js .wpsc-field-password.focused input,.wpsc-controller.wpsc-float-js .wpsc-field-password.focused textarea,.wpsc-controller.wpsc-float-js .wpsc-field-password.populated input,.wpsc-controller.wpsc-float-js .wpsc-field-password.populated textarea,.wpsc-controller.wpsc-float-js .wpsc-field-select_country.focused input,.wpsc-controller.wpsc-float-js .wpsc-field-select_country.focused textarea,.wpsc-controller.wpsc-float-js .wpsc-field-select_country.populated input,.wpsc-controller.wpsc-float-js .wpsc-field-select_country.populated textarea,.wpsc-controller.wpsc-float-js .wpsc-field-select_region.focused input,.wpsc-controller.wpsc-float-js .wpsc-field-select_region.focused textarea,.wpsc-controller.wpsc-float-js .wpsc-field-select_region.populated input,.wpsc-controller.wpsc-float-js .wpsc-field-select_region.populated textarea,.wpsc-controller.wpsc-float-js .wpsc-field-textfield.focused input,.wpsc-controller.wpsc-float-js .wpsc-field-textfield.focused textarea,.wpsc-controller.wpsc-float-js .wpsc-field-textfield.populated input,.wpsc-controller.wpsc-float-js .wpsc-field-textfield.populated textarea{padding-top:1.5em;padding-bottom:.5em}.wpsc-field-quantity .wpsc-controls{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;border:1px solid #ccc}.wpsc-field-quantity .wpsc-controls input[type=text]{width:40px;-webkit-order:2;-moz-order:2;-ms-order:2;order:2;text-align:center;border:none;box-shadow:none}.wpsc-field-quantity .wpsc-controls .dec{-webkit-order:1;-moz-order:1;-ms-order:1;order:1}.wpsc-field-quantity .wpsc-controls .inc{-webkit-order:3;-moz-order:3;-ms-order:3;order:3}.wpsc-field-quantity .wpsc-qty-button{padding:.5em .75em;cursor:pointer}@media (max-width:960px){.wpsc-grid .wpsc-column-5,.wpsc-grid .wpsc-column-6{width:22.5%}.wpsc-grid .wpsc-column-5 .wpsc-product-title,.wpsc-grid .wpsc-column-6 .wpsc-product-title{font-size:1.25em}.wpsc-grid .wpsc-column-5 .wpsc-old-price,.wpsc-grid .wpsc-column-6 .wpsc-old-price{font-size:.7em}.wpsc-grid .wpsc-column-5 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-sale,.wpsc-grid .wpsc-column-5 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-sale,.wpsc-grid .wpsc-column-6 .wpsc-sale-price .wpsc-amount{font-size:.9em}}@media (max-width:700px){.wpsc-grid .wpsc-column-4,.wpsc-grid .wpsc-column-5,.wpsc-grid .wpsc-column-6{width:30.833%}.wpsc-grid .wpsc-column-4 .wpsc-product-title,.wpsc-grid .wpsc-column-5 .wpsc-product-title,.wpsc-grid .wpsc-column-6 .wpsc-product-title{font-size:1.35em}.wpsc-grid .wpsc-column-4 .wpsc-old-price,.wpsc-grid .wpsc-column-5 .wpsc-old-price,.wpsc-grid .wpsc-column-6 .wpsc-old-price{font-size:.8em}.wpsc-grid .wpsc-column-4 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-4 .wpsc-sale,.wpsc-grid .wpsc-column-4 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-sale,.wpsc-grid .wpsc-column-5 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-sale,.wpsc-grid .wpsc-column-6 .wpsc-sale-price .wpsc-amount{font-size:1em}.wpsc-cart-cell-header.date,.wpsc-cart-cell-header.id,.wpsc-cart-cell-header.status,.wpsc-cart-cell-header.total,.wpsc-cart-cell-header.tracking-id,.wpsc-cart-cell.date,.wpsc-cart-cell.id,.wpsc-cart-cell.status,.wpsc-cart-cell.total,.wpsc-cart-cell.tracking-id{width:100%}.wpsc-cart-cell-header.date:before,.wpsc-cart-cell-header.id:before,.wpsc-cart-cell-header.status:before,.wpsc-cart-cell-header.total:before,.wpsc-cart-cell-header.tracking-id:before,.wpsc-cart-cell.date:before,.wpsc-cart-cell.id:before,.wpsc-cart-cell.status:before,.wpsc-cart-cell.total:before,.wpsc-cart-cell.tracking-id:before{font-weight:600;content:attr(data-title)}.wpsc-customer-account-index .wpsc-cart-footer,.wpsc-customer-account-index .wpsc-cart-header{display:none}}@media (max-width:550px){.wpsc-cart-cell,.wpsc-cart-cell-header{display:block}.wpsc-cart-header{display:none}.wpsc-cart-cell-header.date,.wpsc-cart-cell-header.id,.wpsc-cart-cell-header.image,.wpsc-cart-cell-header.item-total,.wpsc-cart-cell-header.items,.wpsc-cart-cell-header.quantity,.wpsc-cart-cell-header.status,.wpsc-cart-cell-header.total,.wpsc-cart-cell-header.tracking-id,.wpsc-cart-cell-header.unit-price,.wpsc-cart-cell.date,.wpsc-cart-cell.id,.wpsc-cart-cell.image,.wpsc-cart-cell.item-total,.wpsc-cart-cell.items,.wpsc-cart-cell.quantity,.wpsc-cart-cell.status,.wpsc-cart-cell.total,.wpsc-cart-cell.tracking-id,.wpsc-cart-cell.unit-price{width:100%}.wpsc-cart-cell-header.date:before,.wpsc-cart-cell-header.id:before,.wpsc-cart-cell-header.item-total:before,.wpsc-cart-cell-header.quantity:before,.wpsc-cart-cell-header.status:before,.wpsc-cart-cell-header.total:before,.wpsc-cart-cell-header.tracking-id:before,.wpsc-cart-cell-header.unit-price:before,.wpsc-cart-cell.date:before,.wpsc-cart-cell.id:before,.wpsc-cart-cell.item-total:before,.wpsc-cart-cell.quantity:before,.wpsc-cart-cell.status:before,.wpsc-cart-cell.total:before,.wpsc-cart-cell.tracking-id:before,.wpsc-cart-cell.unit-price:before{font-weight:600;content:attr(data-title)}.wpsc-cart-quantity-input{width:25%}.wpsc-cart-item-title{font-size:1.15em}.wpsc-cart-item:first-of-type{padding-top:0}.wpsc-form-actions.bottom{padding-top:20px}.wpsc-cart-cell.update-quantity{text-align:center}.wpsc-cart-update{float:none}.wpsc-clear-cart{display:block;text-align:center}.wpsc-cart-subtotal-row .wpsc-cart-cell,.wpsc-cart-subtotal-row .wpsc-cart-cell-header{text-align:center}.wpsc-cart-subtotal-row .wpsc-cart-cell{font-size:1.35em}.wpsc-form-actions button{margin-left:auto;margin-right:auto}[class*=widget_wpsc_] ul{margin-left:0}[class*=widget_wpsc_] li{list-style-type:none}.wpsc-widget-latest-product-list-item{margin-bottom:1.5em}.wpsc-widget-latest-product-list-item a{font-size:1.15em}.widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-product-price{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-justify-content:space-between;-moz-justify-content:space-between;-ms-justify-content:space-between;justify-content:space-between}.widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-sale-price{font-weight:600}.widget_wpsc_widget_on_sale .wpsc-widget-latest-product-list-item .wpsc-you-save{width:100%;font-size:.8em}.wpsc-grid .wpsc-column-2,.wpsc-grid .wpsc-column-3,.wpsc-grid .wpsc-column-4,.wpsc-grid .wpsc-column-5,.wpsc-grid .wpsc-column-6{width:100%}.wpsc-grid .wpsc-column-2 .wpsc-product-title,.wpsc-grid .wpsc-column-3 .wpsc-product-title,.wpsc-grid .wpsc-column-4 .wpsc-product-title,.wpsc-grid .wpsc-column-5 .wpsc-product-title,.wpsc-grid .wpsc-column-6 .wpsc-product-title{font-size:1.75em}.wpsc-grid .wpsc-column-2 .wpsc-old-price,.wpsc-grid .wpsc-column-3 .wpsc-old-price,.wpsc-grid .wpsc-column-4 .wpsc-old-price,.wpsc-grid .wpsc-column-5 .wpsc-old-price,.wpsc-grid .wpsc-column-6 .wpsc-old-price{font-size:.85em}.wpsc-grid .wpsc-column-2 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-2 .wpsc-sale,.wpsc-grid .wpsc-column-2 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-3 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-3 .wpsc-sale,.wpsc-grid .wpsc-column-3 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-4 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-4 .wpsc-sale,.wpsc-grid .wpsc-column-4 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-5 .wpsc-sale,.wpsc-grid .wpsc-column-5 .wpsc-sale-price .wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-product-price>.wpsc-amount,.wpsc-grid .wpsc-column-6 .wpsc-sale,.wpsc-grid .wpsc-column-6 .wpsc-sale-price .wpsc-amount{font-size:1.25em}.wpsc-list .wpsc-product-summary,.wpsc-list .wpsc-thumbnail-wrapper,.wpsc-single .wpsc-product-summary,.wpsc-single .wpsc-thumbnail-wrapper{display:block;float:none;width:100%}.wpsc-controller .wpsc-shopping-cart .wpsc-form-actions{text-align:left}.wpsc-form-actions{display:block}.express-checkout-button,.wpsc-begin-checkout{display:block;text-align:left;margin-left:0}.express-checkout-button{margin-bottom:20px}.wpsc-begin-checkout{margin-top:20px}.wpsc-cart-footer .wpsc-cart-actions-row{text-align:right;padding-bottom:20px}.wpsc-cart-footer .wpsc-cart-actions-row:after{text-align:right;display:block;width:100%;height:0}.wpsc-cart-footer .update-quantity{display:inline-block}.wpsc-cart-footer .wpsc-cart-aggregate{text-align:left}.wpsc-cart-footer .apply-coupon{margin-bottom:20px;text-align:right}.wpsc-cart-footer .wpsc-cart-cell,.wpsc-cart-footer .wpsc-row{text-align:left}.wpsc-checkout .entry-content fieldset{min-width:100%;display:block}.wpsc-checkout .entry-content #wpsc-checkout-form-shipping{margin-left:0}.wpsc-controller .wpsc-create-account-offer,.wpsc-controller .wpsc-login-form-wrapper{float:none;width:100%}.wpsc-cart-cell-header.content,.wpsc-cart-cell-header.product,.wpsc-cart-cell.contents,.wpsc-cart-cell.product{width:100%}.wpsc-cart-cell-header.content,.wpsc-cart-cell.contents{margin-top:1em}.wpsc-customer-account-digital-content .wpsc-cart-footer{display:none}.wpsc-controller .wpsc-tabs>li{display:block}.wpsc-controller .wpsc-tabs>.active>a{border:0}.wpsc-tab-item{padding:5px 0}.wpsc-cart-quantity-input{max-width:50%}}
|
wpsc-components/theme-engine-v2/theming/assets/js/checkout.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
;(function($) {
|
2 |
+
$( '.wpsc-field-textfield' ).FloatLabel();
|
3 |
+
$( '.wpsc-field-select_region' ).FloatLabel();
|
4 |
+
$( '.wpsc-field-select_country' ).FloatLabel();
|
5 |
+
$( '.wpsc-field-password' ).FloatLabel();
|
6 |
+
})(jQuery);
|
wpsc-components/theme-engine-v2/theming/assets/js/fluidbox.js
ADDED
@@ -0,0 +1,711 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global console, WPSC_Fluid_Box_Options */
|
2 |
+
// the semi-colon before function invocation is a safety net against concatenated
|
3 |
+
// scripts and/or other plugins which may not be closed properly.
|
4 |
+
;(function ( $, window, document, _, undefined ) {
|
5 |
+
|
6 |
+
'use strict';
|
7 |
+
|
8 |
+
// undefined is used here as the undefined global variable in ECMAScript 3 is
|
9 |
+
// mutable (ie. it can be changed by someone else). undefined isn't really being
|
10 |
+
// passed in so we can ensure the value of it is truly undefined. In ES5, undefined
|
11 |
+
// can no longer be modified.
|
12 |
+
|
13 |
+
// window and document are passed through as local variable rather than global
|
14 |
+
// as this (slightly) quickens the resolution process and can be more efficiently
|
15 |
+
// minified (especially when both are regularly referenced in your plugin).
|
16 |
+
|
17 |
+
// Create the defaults once
|
18 |
+
var $w = $(window),
|
19 |
+
$d = $(document),
|
20 |
+
pluginName = "fluidbox",
|
21 |
+
defaults = {
|
22 |
+
immediateOpen: false,
|
23 |
+
loader: false,
|
24 |
+
maxWidth: 0,
|
25 |
+
maxHeight: 0,
|
26 |
+
resizeThrottle: 500,
|
27 |
+
stackIndex: 1000,
|
28 |
+
stackIndexDelta: 10,
|
29 |
+
viewportFill: 0.95,
|
30 |
+
},
|
31 |
+
globalData = {},
|
32 |
+
keyboardEvents = ['keyup', 'keydown', 'keypress'];
|
33 |
+
|
34 |
+
// Global plugin instance tracker
|
35 |
+
var fbInstance = 0;
|
36 |
+
|
37 |
+
// Check the availability of the console object. This ensures compatibility with IE8.
|
38 |
+
if(typeof console === "undefined" || console.warn === "undefined" ) {
|
39 |
+
console = {};
|
40 |
+
console.warn = function(){};
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
// ---------------------------------------------------------------------------------------------------------------------- //
|
45 |
+
// Dependency: David Walsh (http://davidwalsh.name/css-animation-callback) //
|
46 |
+
// and //
|
47 |
+
// Jonathan Suh (https://jonsuh.com/blog/detect-the-end-of-css-animations-and-transitions-with-javascript/) //
|
48 |
+
// ---------------------------------------------------------------------------------------------------------------------- //
|
49 |
+
var whichTransitionEvent = function() {
|
50 |
+
var t,
|
51 |
+
el = document.createElement('fakeelement');
|
52 |
+
|
53 |
+
var transitions = {
|
54 |
+
'transition' : 'transitionend',
|
55 |
+
'OTransition' : 'oTransitionEnd',
|
56 |
+
'MozTransition' : 'transitionend',
|
57 |
+
'WebkitTransition' : 'webkitTransitionEnd'
|
58 |
+
};
|
59 |
+
|
60 |
+
for (t in transitions){
|
61 |
+
if (el.style[t] !== undefined){
|
62 |
+
return transitions[t];
|
63 |
+
}
|
64 |
+
}
|
65 |
+
};
|
66 |
+
var customTransitionEnd = whichTransitionEvent();
|
67 |
+
|
68 |
+
// The actual plugin constructor
|
69 |
+
function Plugin (element, options) {
|
70 |
+
// Assign element
|
71 |
+
this.element = element;
|
72 |
+
|
73 |
+
// Manipulate HTML5 dataset object
|
74 |
+
// - Format: data-fluidbox-(setting-name). When converted into camel case: fluidboxSettingName
|
75 |
+
// - So, we will have to remove 'fluidbox' in the front, and change the first letter to lowercase
|
76 |
+
var elementData = {};
|
77 |
+
$.each($(this.element).data(), function(k,v) {
|
78 |
+
var capitalize = function(s) {
|
79 |
+
return s && s[0].toLowerCase() + s.slice(1);
|
80 |
+
},
|
81 |
+
key = capitalize(k.replace('fluidbox',''));
|
82 |
+
|
83 |
+
// Only push non-empty keys (that are part of the Fluidbox HTML5 data- attributes) into new object
|
84 |
+
if(key !== '' || key !== null) {
|
85 |
+
// Coerce boolean values
|
86 |
+
if (v === 'false') {
|
87 |
+
v = false;
|
88 |
+
} else {
|
89 |
+
v = true;
|
90 |
+
}
|
91 |
+
elementData[key] = v;
|
92 |
+
}
|
93 |
+
});
|
94 |
+
|
95 |
+
// Merge defaults into options, into dataset
|
96 |
+
this.settings = $.extend( {}, defaults, options, elementData);
|
97 |
+
|
98 |
+
// Coerce settings
|
99 |
+
this.settings.viewportFill = Math.max(Math.min(parseFloat(this.settings.viewportFill), 1), 0);
|
100 |
+
if(this.settings.stackIndex < this.settings.stackIndexDelta) {
|
101 |
+
this.settings.stackIndexDelta = this.settings.stackIndex;
|
102 |
+
}
|
103 |
+
|
104 |
+
// Store plugin name
|
105 |
+
this._name = pluginName;
|
106 |
+
|
107 |
+
// Initialize
|
108 |
+
this.init();
|
109 |
+
}
|
110 |
+
|
111 |
+
// Private functions
|
112 |
+
var _fun = {
|
113 |
+
dom: function() {
|
114 |
+
// Wrap and add ghost element
|
115 |
+
var $fb_innerWrap = $('<div />', {
|
116 |
+
'class': 'fluidbox__wrap',
|
117 |
+
css: {
|
118 |
+
zIndex: this.settings.stackIndex - this.settings.stackIndexDelta
|
119 |
+
}
|
120 |
+
});
|
121 |
+
$(this.element)
|
122 |
+
.addClass('fluidbox--closed')
|
123 |
+
.wrapInner($fb_innerWrap)
|
124 |
+
.find('img')
|
125 |
+
.first()
|
126 |
+
.css({ opacity: 1})
|
127 |
+
.addClass('fluidbox__thumb')
|
128 |
+
.after('<div class="fluidbox__ghost" />');
|
129 |
+
|
130 |
+
// Append loader
|
131 |
+
if(this.settings.loader) {
|
132 |
+
var $fbLoader = $('<div />', {
|
133 |
+
'class': 'fluidbox__loader',
|
134 |
+
css: {
|
135 |
+
zIndex: 2
|
136 |
+
}
|
137 |
+
});
|
138 |
+
$(this.element).find('.fluidbox__wrap').append($fbLoader);
|
139 |
+
}
|
140 |
+
},
|
141 |
+
prepareFb: function() {
|
142 |
+
var fb = this,
|
143 |
+
$fb = $(this.element);
|
144 |
+
|
145 |
+
// Thumbnail is successfully loaded, fire event
|
146 |
+
$fb.trigger('thumbloaddone.fluidbox');
|
147 |
+
|
148 |
+
// Get basic measurements and to resize the ghost element
|
149 |
+
_fun.measure.fbElements.call(this);
|
150 |
+
|
151 |
+
// Bind events
|
152 |
+
fb.bindEvents();
|
153 |
+
|
154 |
+
// Status: Fluidbox is ready to use
|
155 |
+
$fb.addClass('fluidbox--ready');
|
156 |
+
|
157 |
+
// Bind listeners
|
158 |
+
fb.bindListeners();
|
159 |
+
|
160 |
+
// Emit custom event
|
161 |
+
$fb.trigger('ready.fluidbox');
|
162 |
+
},
|
163 |
+
measure: {
|
164 |
+
viewport: function() {
|
165 |
+
globalData.viewport = {
|
166 |
+
w: $w.width(),
|
167 |
+
h: $w.height()
|
168 |
+
};
|
169 |
+
},
|
170 |
+
fbElements: function() {
|
171 |
+
var fb = this,
|
172 |
+
$fb = $(this.element),
|
173 |
+
$fbThumb = $fb.find('img').first(),
|
174 |
+
$fbGhost = $fb.find('.fluidbox__ghost'),
|
175 |
+
$fbWrap = $fb.find('.fluidbox__wrap');
|
176 |
+
|
177 |
+
// Store image dimensions in instance data
|
178 |
+
fb.instanceData.thumb = {
|
179 |
+
natW: $fbThumb[0].naturalWidth,
|
180 |
+
natH: $fbThumb[0].naturalHeight,
|
181 |
+
w: $fbThumb.width(),
|
182 |
+
h: $fbThumb.height()
|
183 |
+
};
|
184 |
+
|
185 |
+
// Set ghost dimensions
|
186 |
+
$fbGhost
|
187 |
+
.css({
|
188 |
+
width: $fbThumb.width(),
|
189 |
+
height: $fbThumb.height(),
|
190 |
+
top: $fbThumb.offset().top - $fbWrap.offset().top + parseInt($fbThumb.css('borderTopWidth'), 10) + parseInt($fbThumb.css('paddingTop'),10),
|
191 |
+
left: $fbThumb.offset().left - $fbWrap.offset().left + parseInt($fbThumb.css('borderLeftWidth'), 10) + parseInt($fbThumb.css('paddingLeft'),10)
|
192 |
+
});
|
193 |
+
}
|
194 |
+
},
|
195 |
+
checkURL: function(url) {
|
196 |
+
var exitCode = 0;
|
197 |
+
|
198 |
+
if(/[\s+]/g.test(url)) {
|
199 |
+
console.warn('Fluidbox: Fluidbox opening is halted because it has detected characters in your URL string that need to be properly encoded/escaped. Whitespace(s) have to be escaped manually. See RFC3986 documentation.');
|
200 |
+
exitCode = 1;
|
201 |
+
} else if(/[\"\'\(\)]/g.test(url)) {
|
202 |
+
console.warn('Fluidbox: Fluidbox opening will proceed, but it has detected characters in your URL string that need to be properly encoded/escaped. These will be escaped for you. See RFC3986 documentation.');
|
203 |
+
exitCode = 0;
|
204 |
+
}
|
205 |
+
return exitCode;
|
206 |
+
},
|
207 |
+
formatURL: function(url) {
|
208 |
+
return url
|
209 |
+
.replace(/"/g, '%22')
|
210 |
+
.replace(/'/g, '%27')
|
211 |
+
.replace(/\(/g, '%28')
|
212 |
+
.replace(/\)/g, '%29');
|
213 |
+
}
|
214 |
+
};
|
215 |
+
|
216 |
+
// Public functions
|
217 |
+
$.extend(Plugin.prototype, {
|
218 |
+
init: function () {
|
219 |
+
|
220 |
+
// Define elements
|
221 |
+
var fb = this,
|
222 |
+
$fb = $(this.element),
|
223 |
+
$fbThumb = $fb.find('img').first();
|
224 |
+
|
225 |
+
// Get basic measurements
|
226 |
+
_fun.measure.viewport();
|
227 |
+
|
228 |
+
// Only perform initialization when
|
229 |
+
// - It is not yet initialized
|
230 |
+
// + DOM checks are satisfied:
|
231 |
+
// +-- An anchor element is selected
|
232 |
+
// +-- Contains one and only one child
|
233 |
+
// +-- The only child is an image element OR a picture element
|
234 |
+
// +-- The element must not be hidden (itself or its parents)
|
235 |
+
if(
|
236 |
+
(!fb.instanceData || !fb.instanceData.initialized) &&
|
237 |
+
(
|
238 |
+
$fb.is('a') &&
|
239 |
+
$fb.children().length === 1 &&
|
240 |
+
(
|
241 |
+
$fb.children().is('img') || (
|
242 |
+
$fb.children().is('picture') &&
|
243 |
+
$fb.find('img').length === 1
|
244 |
+
)
|
245 |
+
) &&
|
246 |
+
$fb.css('display') !== 'none' &&
|
247 |
+
$fb.children().css('display') !== 'none' &&
|
248 |
+
$fb.parents().css('display') !== 'none'
|
249 |
+
)
|
250 |
+
) {
|
251 |
+
|
252 |
+
// Initialize and store original node
|
253 |
+
$fb.removeClass('fluidbox--destroyed');
|
254 |
+
fb.instanceData = {};
|
255 |
+
fb.instanceData.initialized = true;
|
256 |
+
fb.instanceData.originalNode = $fb.html();
|
257 |
+
|
258 |
+
// Append instance ID
|
259 |
+
fbInstance += 1;
|
260 |
+
fb.instanceData.id = fbInstance;
|
261 |
+
$fb.addClass('fluidbox__instance-'+fbInstance);
|
262 |
+
|
263 |
+
// Status: Fluidbox has been initialized
|
264 |
+
$fb.addClass('fluidbox--initialized');
|
265 |
+
|
266 |
+
// DOM replacement
|
267 |
+
_fun.dom.call(fb);
|
268 |
+
|
269 |
+
// Emit custom event
|
270 |
+
$fb.trigger('init.fluidbox');
|
271 |
+
|
272 |
+
// Wait for image to load, but only if image is not found in cache
|
273 |
+
var img = new Image();
|
274 |
+
if($fbThumb.width() > 0 && $fbThumb.height() > 0) {
|
275 |
+
// Thumbnail loaded from cache, let's prepare fluidbox
|
276 |
+
_fun.prepareFb.call(fb);
|
277 |
+
} else {
|
278 |
+
img.onload = function() {
|
279 |
+
// Thumbnail loaded, let's prepare fluidbox
|
280 |
+
_fun.prepareFb.call(fb);
|
281 |
+
};
|
282 |
+
img.onerror = function() {
|
283 |
+
// Trigger custom error event
|
284 |
+
$fb.trigger('thumbloadfail.fluidbox');
|
285 |
+
};
|
286 |
+
img.src = $fbThumb.attr('src');
|
287 |
+
}
|
288 |
+
}
|
289 |
+
|
290 |
+
},
|
291 |
+
open: function() {
|
292 |
+
|
293 |
+
// Open Fluidbox
|
294 |
+
var fb = this,
|
295 |
+
$fb = $(this.element),
|
296 |
+
$fbThumb = $fb.find('img').first(),
|
297 |
+
$fbGhost = $fb.find('.fluidbox__ghost'),
|
298 |
+
$fbWrap = $fb.find('.fluidbox__wrap');
|
299 |
+
|
300 |
+
// Update state
|
301 |
+
fb.instanceData.state = 1;
|
302 |
+
|
303 |
+
// Forcibly turn off transition end detection,
|
304 |
+
// otherwise users will get choppy transition if toggling between states rapidly
|
305 |
+
$fbGhost.off(customTransitionEnd);
|
306 |
+
|
307 |
+
// Close all other Fluidbox instances
|
308 |
+
$('.fluidbox--opened').fluidbox('close');
|
309 |
+
|
310 |
+
// Append overlay
|
311 |
+
var $fbOverlay = $('<div />', {
|
312 |
+
'class': 'fluidbox__overlay',
|
313 |
+
css: {
|
314 |
+
zIndex: -1
|
315 |
+
}
|
316 |
+
});
|
317 |
+
$fbWrap.append($fbOverlay);
|
318 |
+
|
319 |
+
// Add class to indicate larger image being loaded
|
320 |
+
$fb
|
321 |
+
.removeClass('fluidbox--closed')
|
322 |
+
.addClass('fluidbox--loading');
|
323 |
+
|
324 |
+
// Check of URL is properly formatted
|
325 |
+
if(_fun.checkURL($fbThumb.attr('src'))) {
|
326 |
+
fb.close();
|
327 |
+
return false;
|
328 |
+
}
|
329 |
+
|
330 |
+
// Set thumbnail image source as background image first, worry later
|
331 |
+
$fbGhost.css({
|
332 |
+
'background-image': 'url(' + _fun.formatURL($fbThumb.attr('src')) + ')',
|
333 |
+
opacity: 1
|
334 |
+
});
|
335 |
+
|
336 |
+
// Set dimensions for ghost
|
337 |
+
_fun.measure.fbElements.call(fb);
|
338 |
+
|
339 |
+
// Wait for ghost image to preload
|
340 |
+
var img;
|
341 |
+
if (fb.settings.immediateOpen) {
|
342 |
+
// Update classes
|
343 |
+
$fb
|
344 |
+
.addClass('fluidbox--opened fluidbox--loaded')
|
345 |
+
.find('.fluidbox__wrap')
|
346 |
+
.css({ zIndex: fb.settings.stackIndex + fb.settings.stackIndexDelta });
|
347 |
+
|
348 |
+
// Emit custom event
|
349 |
+
$fb.trigger('openstart.fluidbox');
|
350 |
+
|
351 |
+
// Compute
|
352 |
+
fb.compute();
|
353 |
+
|
354 |
+
// Hide thumbnail
|
355 |
+
$fbThumb.css({ opacity: 0 });
|
356 |
+
|
357 |
+
// Show overlay
|
358 |
+
$('.fluidbox__overlay').css({ opacity: 1 });
|
359 |
+
|
360 |
+
// Emit custom event when ghost image finishes transition
|
361 |
+
$fbGhost.one(customTransitionEnd, function() {
|
362 |
+
$fb.trigger('openend.fluidbox');
|
363 |
+
});
|
364 |
+
|
365 |
+
img = new Image();
|
366 |
+
img.onload = function() {
|
367 |
+
// Perform only if the Fluidbox instance is still open
|
368 |
+
if (fb.instanceData.state === 1) {
|
369 |
+
// Set new natural dimensions
|
370 |
+
fb.instanceData.thumb.natW = img.naturalWidth;
|
371 |
+
fb.instanceData.thumb.natH = img.naturalHeight;
|
372 |
+
|
373 |
+
// Remove loading status
|
374 |
+
$fb.removeClass('fluidbox--loading');
|
375 |
+
|
376 |
+
// Check of URL is properly formatted
|
377 |
+
if(_fun.checkURL(img.src)) {
|
378 |
+
fb.close();
|
379 |
+
return false;
|
380 |
+
}
|
381 |
+
|
382 |
+
// Set new image background
|
383 |
+
$fbGhost.css({ 'background-image': 'url(' + _fun.formatURL(img.src) + ')' });
|
384 |
+
|
385 |
+
// Compute
|
386 |
+
fb.compute();
|
387 |
+
}
|
388 |
+
};
|
389 |
+
img.onerror = function() {
|
390 |
+
// Trigger closing
|
391 |
+
fb.close();
|
392 |
+
|
393 |
+
// Emit custom event
|
394 |
+
$fb.trigger('imageloadfail.fluidbox');
|
395 |
+
$fb.trigger('delayedloadfail.fluidbox');
|
396 |
+
};
|
397 |
+
img.src = $fb.attr('href');
|
398 |
+
|
399 |
+
} else {
|
400 |
+
img = new Image();
|
401 |
+
img.onload = function() {
|
402 |
+
|
403 |
+
// Update classes
|
404 |
+
$fb
|
405 |
+
.removeClass('fluidbox--loading')
|
406 |
+
.addClass('fluidbox--opened fluidbox--loaded')
|
407 |
+
.find('.fluidbox__wrap')
|
408 |
+
.css({ zIndex: fb.settings.stackIndex + fb.settings.stackIndexDelta });
|
409 |
+
|
410 |
+
// Emit custom event
|
411 |
+
$fb.trigger('openstart.fluidbox');
|
412 |
+
|
413 |
+
// Check of URL is properly formatted
|
414 |
+
if(_fun.checkURL(img.src)) {
|
415 |
+
fb.close();
|
416 |
+
return false;
|
417 |
+
}
|
418 |
+
|
419 |
+
// Set new image background
|
420 |
+
$fbGhost.css({ 'background-image': 'url(' + _fun.formatURL(img.src) + ')' });
|
421 |
+
|
422 |
+
// Set new natural dimensions
|
423 |
+
fb.instanceData.thumb.natW = img.naturalWidth;
|
424 |
+
fb.instanceData.thumb.natH = img.naturalHeight;
|
425 |
+
|
426 |
+
// Compute
|
427 |
+
fb.compute();
|
428 |
+
|
429 |
+
// Hide thumbnail
|
430 |
+
$fbThumb.css({ opacity: 0 });
|
431 |
+
|
432 |
+
// Show overlay
|
433 |
+
$('.fluidbox__overlay').css({ opacity: 1 });
|
434 |
+
|
435 |
+
// Emit custom event when ghost image finishes transition
|
436 |
+
$fbGhost.one(customTransitionEnd, function() {
|
437 |
+
$fb.trigger('openend.fluidbox');
|
438 |
+
});
|
439 |
+
};
|
440 |
+
img.onerror = function() {
|
441 |
+
// Trigger closing
|
442 |
+
fb.close();
|
443 |
+
|
444 |
+
// Emit custom event
|
445 |
+
$fb.trigger('imageloadfail.fluidbox');
|
446 |
+
};
|
447 |
+
img.src = $fb.attr('href');
|
448 |
+
}
|
449 |
+
|
450 |
+
},
|
451 |
+
compute: function() {
|
452 |
+
var fb = this,
|
453 |
+
$fb = $(this.element),
|
454 |
+
$fbThumb = $fb.find('img').first(),
|
455 |
+
$fbGhost = $fb.find('.fluidbox__ghost'),
|
456 |
+
$fbWrap = $fb.find('.fluidbox__wrap');
|
457 |
+
|
458 |
+
// Shorthand for dimensions
|
459 |
+
var imgNatW = fb.instanceData.thumb.natW,
|
460 |
+
imgNatH = fb.instanceData.thumb.natH,
|
461 |
+
imgW = fb.instanceData.thumb.w,
|
462 |
+
imgH = fb.instanceData.thumb.h;
|
463 |
+
|
464 |
+
// Calculate aspect ratios
|
465 |
+
var thumbRatio = imgNatW / imgNatH,
|
466 |
+
viewportRatio = globalData.viewport.w / globalData.viewport.h;
|
467 |
+
|
468 |
+
// Replace dimensions if maxWidth or maxHeight is declared
|
469 |
+
if (fb.settings.maxWidth > 0) {
|
470 |
+
imgNatW = fb.settings.maxWidth;
|
471 |
+
imgNatH = imgNatW / thumbRatio;
|
472 |
+
} else if (fb.settings.maxHeight > 0) {
|
473 |
+
imgNatH = fb.settings.maxHeight;
|
474 |
+
imgNatW = imgNatH * thumbRatio;
|
475 |
+
}
|
476 |
+
|
477 |
+
// Compare image ratio with viewport ratio
|
478 |
+
var computedHeight, computedWidth, imgScaleY, imgScaleX, imgMinScale;
|
479 |
+
if (viewportRatio > thumbRatio) {
|
480 |
+
computedHeight = (imgNatH < globalData.viewport.h) ? imgNatH : globalData.viewport.h*fb.settings.viewportFill;
|
481 |
+
imgScaleY = computedHeight / imgH;
|
482 |
+
imgScaleX = imgNatW * (imgH * imgScaleY / imgNatH) / imgW;
|
483 |
+
imgMinScale = imgScaleY;
|
484 |
+
} else {
|
485 |
+
computedWidth = (imgNatW < globalData.viewport.w) ? imgNatW : globalData.viewport.w*fb.settings.viewportFill;
|
486 |
+
imgScaleX = computedWidth / imgW;
|
487 |
+
imgScaleY = imgNatH * (imgW * imgScaleX / imgNatW) / imgH;
|
488 |
+
imgMinScale = imgScaleX;
|
489 |
+
}
|
490 |
+
|
491 |
+
// Display console error if both maxHeight and maxWidth are specific
|
492 |
+
if (fb.settings.maxWidth && fb.settings.maxHeight) {
|
493 |
+
console.warn('Fluidbox: Both maxHeight and maxWidth are specified. You can only specify one. If both are specified, only the maxWidth property will be respected. This will not generate any error, but may cause unexpected sizing behavior.');
|
494 |
+
}
|
495 |
+
|
496 |
+
// Scale
|
497 |
+
var offsetY = $w.scrollTop() - $fbThumb.offset().top + 0.5*(imgH*(imgMinScale-1)) + 0.5*($w.height() - imgH*imgMinScale),
|
498 |
+
offsetX = 0.5*(imgW*(imgMinScale-1)) + 0.5*($w.width() - imgW*imgMinScale) - $fbThumb.offset().left,
|
499 |
+
scale = parseInt(imgScaleX*100, 10)/100 + ',' + parseInt(imgScaleY*100, 10)/100;
|
500 |
+
|
501 |
+
// Apply styles to ghost and loader (if present)
|
502 |
+
$fbGhost
|
503 |
+
.css({
|
504 |
+
'transform': 'translate(' + parseInt(offsetX*100, 10)/100 + 'px,' + parseInt(offsetY*100, 10)/100 + 'px) scale(' + scale + ')',
|
505 |
+
top: $fbThumb.offset().top - $fbWrap.offset().top,
|
506 |
+
left: $fbThumb.offset().left - $fbWrap.offset().left
|
507 |
+
});
|
508 |
+
$fb.find('.fluidbox__loader').css({
|
509 |
+
'transform': 'translate(' + parseInt(offsetX*100, 10)/100 + 'px,' + parseInt(offsetY*100, 10)/100 + 'px) scale(' + scale + ')'
|
510 |
+
});
|
511 |
+
|
512 |
+
// Emit custom event
|
513 |
+
$fb.trigger('computeend.fluidbox');
|
514 |
+
},
|
515 |
+
recompute: function() {
|
516 |
+
// Recompute is simply an alias for the compute method
|
517 |
+
this.compute();
|
518 |
+
},
|
519 |
+
close: function() {
|
520 |
+
|
521 |
+
// Close Fluidbox
|
522 |
+
var fb = this,
|
523 |
+
$fb = $(this.element),
|
524 |
+
$fbThumb = $fb.find('img').first(),
|
525 |
+
$fbGhost = $fb.find('.fluidbox__ghost'),
|
526 |
+
$fbWrap = $fb.find('.fluidbox__wrap'),
|
527 |
+
$fbOverlay = $fb.find('.fluidbox__overlay');
|
528 |
+
|
529 |
+
// Do not do anything if Fluidbox is not opened/closed, for performance reasons
|
530 |
+
if (fb.instanceData.state === null || typeof fb.instanceData.state === typeof undefined || fb.instanceData.state === 0) {
|
531 |
+
return false;
|
532 |
+
}
|
533 |
+
|
534 |
+
// Update state
|
535 |
+
fb.instanceData.state = 0;
|
536 |
+
|
537 |
+
// Emit custom event
|
538 |
+
$fb.trigger('closestart.fluidbox');
|
539 |
+
|
540 |
+
// Change classes
|
541 |
+
$fb
|
542 |
+
.removeClass(function(i,c) {
|
543 |
+
return (c.match (/(^|\s)fluidbox--(opened|loaded|loading)+/g) || []).join(' ');
|
544 |
+
})
|
545 |
+
.addClass('fluidbox--closed');
|
546 |
+
|
547 |
+
$fbGhost
|
548 |
+
.css({
|
549 |
+
'transform': 'translate(0,0) scale(1,1)',
|
550 |
+
top: $fbThumb.offset().top - $fbWrap.offset().top + parseInt($fbThumb.css('borderTopWidth'),10) + parseInt($fbThumb.css('paddingTop'),10),
|
551 |
+
left: $fbThumb.offset().left - $fbWrap.offset().left + parseInt($fbThumb.css('borderLeftWidth'),10) + parseInt($fbThumb.css('paddingLeft'),10)
|
552 |
+
});
|
553 |
+
|
554 |
+
$fb.find('.fluidbox__loader')
|
555 |
+
.css({
|
556 |
+
'transform': 'none'
|
557 |
+
});
|
558 |
+
|
559 |
+
$fbGhost.one(customTransitionEnd, function() {
|
560 |
+
$fbGhost.css({ opacity: 0 });
|
561 |
+
$fbThumb.css({ opacity: 1 });
|
562 |
+
$fbOverlay.remove();
|
563 |
+
$fbWrap.css({ zIndex: fb.settings.stackIndex - fb.settings.stackIndexDelta });
|
564 |
+
$fb.trigger('closeend.fluidbox');
|
565 |
+
});
|
566 |
+
|
567 |
+
// Fadeout overlay
|
568 |
+
$fbOverlay.css({ opacity: 0 });
|
569 |
+
},
|
570 |
+
bindEvents: function() {
|
571 |
+
var fb = this,
|
572 |
+
$fb = $(this.element);
|
573 |
+
|
574 |
+
// Click handler
|
575 |
+
$fb.on('click.fluidbox', function(e) {
|
576 |
+
e.preventDefault();
|
577 |
+
|
578 |
+
// Check state
|
579 |
+
// If state does not exist, or if Fluidbox is closed, we open it
|
580 |
+
if(!fb.instanceData.state || fb.instanceData.state === 0) {
|
581 |
+
|
582 |
+
// Open Fluidbox
|
583 |
+
fb.open();
|
584 |
+
|
585 |
+
// If state exists, we close it
|
586 |
+
} else {
|
587 |
+
|
588 |
+
// Close Fluidbox
|
589 |
+
fb.close();
|
590 |
+
}
|
591 |
+
});
|
592 |
+
},
|
593 |
+
bindListeners: function() {
|
594 |
+
var fb = this,
|
595 |
+
$fb = $(this.element);
|
596 |
+
|
597 |
+
// Window resize
|
598 |
+
// Namespaced using unique instance IDs so that we can unbind resize event specific to a Fluidbox instance
|
599 |
+
var resizeFunction = function() {
|
600 |
+
// Re-measure viewport dimensions
|
601 |
+
_fun.measure.viewport();
|
602 |
+
_fun.measure.fbElements.call(fb);
|
603 |
+
|
604 |
+
// Re-compute, but only for the active element
|
605 |
+
if($fb.hasClass('fluidbox--opened')) {
|
606 |
+
fb.compute();
|
607 |
+
}
|
608 |
+
};
|
609 |
+
|
610 |
+
$w.on('resize.fluidbox'+fb.instanceData.id, _.throttle(resizeFunction, fb.settings.resizeThrottle));
|
611 |
+
|
612 |
+
// Reposition
|
613 |
+
$fb.on('reposition.fluidbox', function() {
|
614 |
+
fb.reposition();
|
615 |
+
});
|
616 |
+
|
617 |
+
// Recompute
|
618 |
+
$fb.on('recompute.fluidbox, compute.fluidbox', function() {
|
619 |
+
fb.compute();
|
620 |
+
});
|
621 |
+
|
622 |
+
// Destroy
|
623 |
+
$fb.on('destroy.fluidbox', function() {
|
624 |
+
fb.destroy();
|
625 |
+
});
|
626 |
+
|
627 |
+
// Close
|
628 |
+
$fb.on('close.fluidbox', function() {
|
629 |
+
fb.close();
|
630 |
+
});
|
631 |
+
},
|
632 |
+
unbind: function() {
|
633 |
+
$(this.element).off('click.fluidbox reposition.fluidbox recompute.fluidbox compute.fluidbox destroy.fluidbox close.fluidbox');
|
634 |
+
$w.off('resize.fluidbox'+this.instanceData.id);
|
635 |
+
},
|
636 |
+
reposition: function() {
|
637 |
+
_fun.measure.fbElements.call(this);
|
638 |
+
},
|
639 |
+
destroy: function() {
|
640 |
+
// Cache original node
|
641 |
+
var originalNode = this.instanceData.originalNode;
|
642 |
+
|
643 |
+
// Unbind event hanlders
|
644 |
+
this.unbind();
|
645 |
+
|
646 |
+
// Destroy plugin data entirely
|
647 |
+
$.data(this.element, 'plugin_' + pluginName, null);
|
648 |
+
|
649 |
+
// DOM reversal
|
650 |
+
$(this.element)
|
651 |
+
.removeClass(function(i,c) {
|
652 |
+
return (c.match (/(^|\s)fluidbox[--|__]\S+/g) || []).join(' ');
|
653 |
+
})
|
654 |
+
.empty()
|
655 |
+
.html(originalNode)
|
656 |
+
.addClass('fluidbox--destroyed')
|
657 |
+
.trigger('destroyed.fluidbox');
|
658 |
+
},
|
659 |
+
getMetadata: function() {
|
660 |
+
// Return instance data
|
661 |
+
return this.instanceData;
|
662 |
+
}
|
663 |
+
});
|
664 |
+
|
665 |
+
// A really lightweight plugin wrapper around the constructor,
|
666 |
+
// preventing against multiple instantiations
|
667 |
+
$.fn[pluginName] = function (options) {
|
668 |
+
|
669 |
+
var args = arguments;
|
670 |
+
|
671 |
+
// Check the options parameter
|
672 |
+
// If it is undefined or is an object (plugin configuration),
|
673 |
+
// we create a new instance (conditionally, see inside) of the plugin
|
674 |
+
if (options === undefined || typeof options === 'object') {
|
675 |
+
|
676 |
+
return this.each(function() {
|
677 |
+
// Only if the plugin_fluidbox data is not present,
|
678 |
+
// to prevent multiple instances being created
|
679 |
+
if (!$.data(this, 'plugin_' + pluginName)) {
|
680 |
+
|
681 |
+
$.data(this, 'plugin_' + pluginName, new Plugin(this, options));
|
682 |
+
}
|
683 |
+
});
|
684 |
+
|
685 |
+
// If it is defined, but it is a string, does not start with an underscore and does not call init(),
|
686 |
+
// we allow users to make calls to public methods
|
687 |
+
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
|
688 |
+
var returnVal;
|
689 |
+
|
690 |
+
this.each(function() {
|
691 |
+
var instance = $.data(this, 'plugin_' + pluginName);
|
692 |
+
if (instance instanceof Plugin && typeof instance[options] === 'function') {
|
693 |
+
returnVal = instance[options].apply(instance, Array.prototype.slice.call(args, 1));
|
694 |
+
} else {
|
695 |
+
console.warn('Fluidbox: The method "' + options + '" used is not defined in Fluidbox. Please make sure you are calling the correct public method.');
|
696 |
+
}
|
697 |
+
});
|
698 |
+
return returnVal !== undefined ? returnVal : this;
|
699 |
+
}
|
700 |
+
|
701 |
+
// Return to allow chaining
|
702 |
+
return this;
|
703 |
+
};
|
704 |
+
|
705 |
+
|
706 |
+
|
707 |
+
})(jQuery, window, document, _);
|
708 |
+
|
709 |
+
(function($, wpsc) {
|
710 |
+
$( '.wpsc-product-thumbnail' ).fluidbox( wpsc );
|
711 |
+
})(jQuery, WPSC_Fluid_Box_Options);
|
wpsc-components/theme-engine-v2/theming/assets/js/jquery.FloatLabel.js
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function( $ ){
|
2 |
+
|
3 |
+
$.fn.FloatLabel = function( options ){
|
4 |
+
|
5 |
+
$('body').addClass( 'wpsc-float-js' );
|
6 |
+
|
7 |
+
var defaults = {
|
8 |
+
populatedClass : 'populated',
|
9 |
+
focusedClass : 'focused'
|
10 |
+
},
|
11 |
+
settings = $.extend({}, defaults, options);
|
12 |
+
|
13 |
+
return this.each(function(){
|
14 |
+
|
15 |
+
var element = $(this),
|
16 |
+
label = element.find('label'),
|
17 |
+
input = element.find('textarea, input');
|
18 |
+
|
19 |
+
if( input.val() == '' ) {
|
20 |
+
input.val( label.text() );
|
21 |
+
} else {
|
22 |
+
element.addClass( settings.populatedClass );
|
23 |
+
}
|
24 |
+
|
25 |
+
input.on( 'focus', function(){
|
26 |
+
element.addClass( settings.focusedClass );
|
27 |
+
|
28 |
+
if( input.val() === label.text() ){
|
29 |
+
input.val('');
|
30 |
+
} else {
|
31 |
+
element.addClass( settings.populatedClass );
|
32 |
+
}
|
33 |
+
|
34 |
+
});
|
35 |
+
|
36 |
+
input.on( 'blur', function(){
|
37 |
+
element.removeClass( settings.focusedClass );
|
38 |
+
|
39 |
+
if( !input.val() ){
|
40 |
+
input.val( label.text() );
|
41 |
+
element.removeClass( settings.populatedClass );
|
42 |
+
}
|
43 |
+
|
44 |
+
});
|
45 |
+
|
46 |
+
input.on( 'keyup', function(){
|
47 |
+
element.addClass( settings.populatedClass );
|
48 |
+
});
|
49 |
+
|
50 |
+
});
|
51 |
+
|
52 |
+
};
|
53 |
+
|
54 |
+
})( jQuery );
|
wpsc-components/theme-engine-v2/theming/assets/js/products.js
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
;(function($) {
|
2 |
+
|
3 |
+
$( ".wpsc-field-quantity .wpsc-controls" ).append( '<div class="inc wpsc-qty-button">+</div><div class="dec wpsc-qty-button">-</div>' );
|
4 |
+
|
5 |
+
$(".wpsc-qty-button").on("click", function() {
|
6 |
+
|
7 |
+
var $button = $(this);
|
8 |
+
var oldValue = $button.parent().find("input").val();
|
9 |
+
|
10 |
+
if ($button.text() == "+") {
|
11 |
+
var newVal = parseFloat(oldValue) + 1;
|
12 |
+
} else {
|
13 |
+
// Don't allow decrementing below zero
|
14 |
+
if (oldValue > 0) {
|
15 |
+
var newVal = parseFloat(oldValue) - 1;
|
16 |
+
} else {
|
17 |
+
newVal = 0;
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
$button.parent().find("input").val(newVal);
|
22 |
+
|
23 |
+
});
|
24 |
+
|
25 |
+
})(jQuery);
|
wpsc-components/theme-engine-v2/theming/assets/scss/partials/_checkout.scss
CHANGED
@@ -1,40 +1,49 @@
|
|
1 |
/*******************
|
2 |
Checkout
|
3 |
********************/
|
4 |
-
.
|
5 |
-
|
6 |
-
|
7 |
-
}
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
fieldset{
|
14 |
-
|
15 |
-
display: inline-block;
|
16 |
vertical-align: top;
|
|
|
|
|
|
|
17 |
}
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
@extend .wpsc-field-wpsc_shipping_option;
|
29 |
-
}
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
}
|
34 |
-
.wpsc-cart-quantity-input {
|
35 |
-
width: 40px;
|
36 |
-
}
|
37 |
-
.wpsc-form-radio-wrapper img {
|
38 |
-
vertical-align: middle;
|
39 |
-
}
|
40 |
}
|
1 |
/*******************
|
2 |
Checkout
|
3 |
********************/
|
4 |
+
.wpsc-field-textfield input {
|
5 |
+
width: 100%;
|
6 |
+
}
|
|
|
7 |
|
8 |
+
#wpsc-checkout-form-shipping {
|
9 |
+
margin-left: 5%;
|
10 |
+
}
|
11 |
|
12 |
+
.wpsc-field-wpsc_shipping_option{
|
13 |
+
text-align: left;
|
14 |
+
}
|
15 |
+
.wpsc-shipping-method {
|
16 |
+
@extend .wpsc-field-wpsc_shipping_option;
|
17 |
+
}
|
18 |
+
.wpsc-payment-method {
|
19 |
+
@extend .wpsc-field-wpsc_shipping_option;
|
20 |
+
}
|
21 |
+
.wpsc-checkout-form {
|
22 |
+
@include flexbox();
|
23 |
+
@include flex-wrap(wrap);
|
24 |
+
@include justify-content(space-between);
|
25 |
+
.wpsc-form-actions {
|
26 |
+
@extend .wpsc-field-wpsc_shipping_option;
|
27 |
+
width: 100%;
|
28 |
+
}
|
29 |
fieldset{
|
30 |
+
margin: 0 0 2em 0;
|
|
|
31 |
vertical-align: top;
|
32 |
+
@include align-self(flex-start);
|
33 |
+
@include flex-grow(1);
|
34 |
+
@include flex-basis(3%);
|
35 |
}
|
36 |
+
}
|
37 |
+
.wpsc-order-preview {
|
38 |
+
margin-bottom: 1.5em;
|
39 |
+
}
|
40 |
+
.wpsc-cart-quantity-input {
|
41 |
+
width: 40px;
|
42 |
+
}
|
43 |
+
.wpsc-form-radio-wrapper img {
|
44 |
+
vertical-align: middle;
|
45 |
+
}
|
|
|
|
|
46 |
|
47 |
+
.wpsc-paypal li {
|
48 |
+
list-style-type: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
wpsc-components/theme-engine-v2/theming/assets/scss/partials/_fluidbox.scss
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Variable
|
2 |
+
$fluidbox__transition-duration: .5s !default;
|
3 |
+
$fluidbox__overlay-bg-color: rgba(255,255,255,.85) !default;
|
4 |
+
$fluidbox__animation-bg-color: $fluidbox__overlay-bg-color !default;
|
5 |
+
|
6 |
+
// Animation
|
7 |
+
@keyframes fluidboxLoading {
|
8 |
+
0% { transform: translate(-50%, -50%) rotateX(0) rotateY(0); }
|
9 |
+
50% { transform: translate(-50%, -50%) rotateX(-180deg) rotateY(0); }
|
10 |
+
100% { transform: translate(-50%, -50%) rotateX(-180deg) rotateY(-180deg); }
|
11 |
+
}
|
12 |
+
|
13 |
+
// Rules
|
14 |
+
.fluidbox {
|
15 |
+
outline: none;
|
16 |
+
}
|
17 |
+
.fluidbox__overlay {
|
18 |
+
background-color: $fluidbox__overlay-bg-color;
|
19 |
+
cursor: pointer;
|
20 |
+
cursor: zoom-out;
|
21 |
+
opacity: 0;
|
22 |
+
pointer-events: none;
|
23 |
+
position: fixed;
|
24 |
+
top: -100%; /* Negative top and bottom is to fix some Safari cases where image got blurry */
|
25 |
+
left: 0;
|
26 |
+
bottom: -100%; /* Negative top and bottom is to fix some Safari cases where image got blurry */
|
27 |
+
right: 0;
|
28 |
+
/* Transition time for overlay is halved to ensure that flickering doesn't happen */
|
29 |
+
transition: all $fluidbox__transition-duration ease-in-out;
|
30 |
+
|
31 |
+
.fluidbox--opened & { pointer-events: auto;}
|
32 |
+
}
|
33 |
+
.fluidbox__wrap {
|
34 |
+
background-position: center center;
|
35 |
+
background-size: cover;
|
36 |
+
margin: 0 auto;
|
37 |
+
position: relative;
|
38 |
+
transition: all $fluidbox__transition-duration ease-in-out;
|
39 |
+
}
|
40 |
+
.fluidbox__thumb {
|
41 |
+
transition: opacity 0s ease-in-out 0s;
|
42 |
+
/* To prevent flickering, we delay the showing of the image */
|
43 |
+
.fluidbox--closed & { transition: opacity 0s ease-in-out 0s; }
|
44 |
+
}
|
45 |
+
.fluidbox__ghost {
|
46 |
+
background-size: 100% 100%;
|
47 |
+
background-position: center center;
|
48 |
+
background-repeat: no-repeat;
|
49 |
+
position: absolute;
|
50 |
+
transition-duration: 0s, $fluidbox__transition-duration;
|
51 |
+
transition-delay: 0s;
|
52 |
+
|
53 |
+
// transition-property manually prefixed
|
54 |
+
// Autoprefixer insists on adding the line:
|
55 |
+
// > transition-property: opacity, transform, -webkit-transform;
|
56 |
+
// ...which will break Fluidbox
|
57 |
+
-webkit-transition-property: opacity, -webkit-transform; /* autoprefixer: off */
|
58 |
+
transition-property: opacity, -webkit-transform; /* autoprefixer: off */
|
59 |
+
transition-property: opacity, transform; /* autoprefixer: off */
|
60 |
+
|
61 |
+
.fluidbox--opened & {
|
62 |
+
cursor: pointer;
|
63 |
+
cursor: -webkit-zoom-out;
|
64 |
+
cursor: -moz-zoom-out;
|
65 |
+
cursor: zoom-out;
|
66 |
+
}
|
67 |
+
.fluidbox--closed & {
|
68 |
+
transition-delay: $fluidbox__transition-duration, 0s;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
.fluidbox__loader {
|
72 |
+
opacity: 0;
|
73 |
+
perspective: 200px;
|
74 |
+
pointer-events: none;
|
75 |
+
position: absolute;
|
76 |
+
top: 0;
|
77 |
+
left: 0;
|
78 |
+
bottom: 0;
|
79 |
+
right: 0;
|
80 |
+
|
81 |
+
&::before {
|
82 |
+
/* You can replace this with any color you want, or even a loading gif if desired */
|
83 |
+
background-color: $fluidbox__animation-bg-color;
|
84 |
+
content: '';
|
85 |
+
transform-style: preserve-3d;
|
86 |
+
position: absolute;
|
87 |
+
top: 50%;
|
88 |
+
left: 50%;
|
89 |
+
width: 20%;
|
90 |
+
padding-bottom: 20%;
|
91 |
+
transform: translate(-50%, -50%);
|
92 |
+
transition-property: transform;
|
93 |
+
transition-duration: $fluidbox__transition-duration;
|
94 |
+
transition-delay: 0s;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
.fluidbox--loading .fluidbox__loader {
|
99 |
+
opacity: 1;
|
100 |
+
transition: opacity $fluidbox__transition-duration ease-in-out $fluidbox__transition-duration;
|
101 |
+
&::before {
|
102 |
+
animation: fluidboxLoading 1s 0s infinite ease-in-out forwards;
|
103 |
+
}
|
104 |
+
}
|
wpsc-components/theme-engine-v2/theming/assets/scss/partials/_js-float-label.scss
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*******************
|
2 |
+
JS Float Label
|
3 |
+
********************/
|
4 |
+
|
5 |
+
.wpsc-controller.wpsc-float-js {
|
6 |
+
.wpsc-field-textfield,
|
7 |
+
.wpsc-field-select_region,
|
8 |
+
.wpsc-field-select_country,
|
9 |
+
.wpsc-field-password {
|
10 |
+
position: relative;
|
11 |
+
|
12 |
+
input,
|
13 |
+
textarea {
|
14 |
+
padding: 1em;
|
15 |
+
}
|
16 |
+
|
17 |
+
input,
|
18 |
+
textarea,
|
19 |
+
label {
|
20 |
+
-webkit-transition: 0.2s ease-in-out;
|
21 |
+
-moz-transition: 0.2s ease-in-out;
|
22 |
+
-ms-transition: 0.2s ease-in-out;
|
23 |
+
-o-transition: 0.2s ease-in-out;
|
24 |
+
transition: 0.2s ease-in-out;
|
25 |
+
}
|
26 |
+
|
27 |
+
label {
|
28 |
+
position: absolute;
|
29 |
+
top: 1em; left: 1em;
|
30 |
+
opacity: 0;
|
31 |
+
}
|
32 |
+
|
33 |
+
&.focused,
|
34 |
+
&.populated {
|
35 |
+
|
36 |
+
label {
|
37 |
+
opacity: 1;
|
38 |
+
top: 0;
|
39 |
+
left: 1em;
|
40 |
+
font-size: $sml-size-col-5;
|
41 |
+
font-weight: $bold;
|
42 |
+
}
|
43 |
+
|
44 |
+
input,
|
45 |
+
textarea {
|
46 |
+
padding-top: 1.5em;
|
47 |
+
padding-bottom: .5em;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
wpsc-components/theme-engine-v2/theming/assets/scss/partials/_product-forms.scss
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*******************
|
2 |
+
Product Forms
|
3 |
+
********************/
|
4 |
+
|
5 |
+
.wpsc-field-quantity {
|
6 |
+
.wpsc-controls {
|
7 |
+
@include flexbox();
|
8 |
+
border: 1px solid #ccc;
|
9 |
+
input[type="text"] {
|
10 |
+
width: 40px;
|
11 |
+
@include flex-order(2);
|
12 |
+
text-align: center;
|
13 |
+
border: none;
|
14 |
+
box-shadow: none;
|
15 |
+
}
|
16 |
+
.dec {
|
17 |
+
@include flex-order(1);
|
18 |
+
}
|
19 |
+
.inc {
|
20 |
+
@include flex-order(3);
|
21 |
+
}
|
22 |
+
}
|
23 |
+
.wpsc-qty-button {
|
24 |
+
padding: .5em .75em;
|
25 |
+
cursor: pointer;
|
26 |
+
}
|
27 |
+
}
|
wpsc-components/theme-engine-v2/theming/assets/scss/partials/_product-grid.scss
CHANGED
@@ -16,9 +16,13 @@ Product Grid on Archive Store Pages
|
|
16 |
margin: 0 0 7% $grid_margin;
|
17 |
font-size: initial;
|
18 |
vertical-align: top;
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
-
.wpsc-
|
22 |
width: 100%;
|
23 |
}
|
24 |
|
16 |
margin: 0 0 7% $grid_margin;
|
17 |
font-size: initial;
|
18 |
vertical-align: top;
|
19 |
+
padding-top: 0;
|
20 |
+
& + .wpsc-product {
|
21 |
+
margin-top: 0;
|
22 |
+
}
|
23 |
}
|
24 |
|
25 |
+
.wpsc-product-summary {
|
26 |
width: 100%;
|
27 |
}
|
28 |
|
wpsc-components/theme-engine-v2/theming/assets/scss/partials/_product-list.scss
CHANGED
@@ -9,3 +9,18 @@ Product List
|
|
9 |
display: inline-block;
|
10 |
float: right;
|
11 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
display: inline-block;
|
10 |
float: right;
|
11 |
}
|
12 |
+
|
13 |
+
.wpsc-add-to-cart-form {
|
14 |
+
@include flexbox();
|
15 |
+
@include justify-content(flex-start);
|
16 |
+
@include flex-wrap(wrap);
|
17 |
+
@include align-items(center);
|
18 |
+
|
19 |
+
.wpsc-form-actions {
|
20 |
+
margin-bottom: 0;
|
21 |
+
}
|
22 |
+
|
23 |
+
.wpsc-field {
|
24 |
+
margin-right: 5%;
|
25 |
+
}
|
26 |
+
}
|
wpsc-components/theme-engine-v2/theming/assets/scss/wpsc-responsive.scss
CHANGED
@@ -21,5 +21,7 @@
|
|
21 |
}
|
22 |
|
23 |
@import 'partials/account';
|
|
|
|
|
24 |
|
25 |
@import 'partials/media-queries';
|
21 |
}
|
22 |
|
23 |
@import 'partials/account';
|
24 |
+
@import 'partials/js-float-label';
|
25 |
+
@import 'partials/product-forms';
|
26 |
|
27 |
@import 'partials/media-queries';
|
wpsc-components/theme-engine-v2/theming/template-parts/single.php
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
<div class="wpsc-thumbnail-wrapper">
|
18 |
<a
|
19 |
class="wpsc-thumbnail wpsc-product-thumbnail"
|
20 |
-
href="<?php
|
21 |
>
|
22 |
<?php if ( wpsc_has_product_thumbnail() ): ?>
|
23 |
<?php wpsc_product_thumbnail(); ?>
|
@@ -33,7 +33,7 @@
|
|
33 |
<meta itemprop="priceCurrency" content="<?php wpsc_base_country_code(); ?>" />
|
34 |
<?php if ( wpsc_is_product_on_sale() ): ?>
|
35 |
<del class="wpsc-old-price">
|
36 |
-
<?php /* translators: Reg. means Regular */
|
37 |
esc_html_e( 'Reg.', 'wp-e-commerce' ); ?>
|
38 |
<span class="wpsc-amount"><?php wpsc_product_original_price(); ?></span>
|
39 |
</del><br />
|
@@ -61,4 +61,4 @@
|
|
61 |
<?php wpsc_edit_product_link() ?>
|
62 |
</div><!-- .entry-meta -->
|
63 |
</div><!-- .wpsc-product-summary -->
|
64 |
-
</div><!-- #product-<?php the_ID(); ?> -->
|
17 |
<div class="wpsc-thumbnail-wrapper">
|
18 |
<a
|
19 |
class="wpsc-thumbnail wpsc-product-thumbnail"
|
20 |
+
href="<?php echo esc_url( wpsc_product_thumbnail_link() ); ?>"
|
21 |
>
|
22 |
<?php if ( wpsc_has_product_thumbnail() ): ?>
|
23 |
<?php wpsc_product_thumbnail(); ?>
|
33 |
<meta itemprop="priceCurrency" content="<?php wpsc_base_country_code(); ?>" />
|
34 |
<?php if ( wpsc_is_product_on_sale() ): ?>
|
35 |
<del class="wpsc-old-price">
|
36 |
+
<?php /* translators: Reg. means Regular */
|
37 |
esc_html_e( 'Reg.', 'wp-e-commerce' ); ?>
|
38 |
<span class="wpsc-amount"><?php wpsc_product_original_price(); ?></span>
|
39 |
</del><br />
|
61 |
<?php wpsc_edit_product_link() ?>
|
62 |
</div><!-- .entry-meta -->
|
63 |
</div><!-- .wpsc-product-summary -->
|
64 |
+
</div><!-- #product-<?php the_ID(); ?> -->
|
wpsc-core/js/wp-e-commerce.js
CHANGED
@@ -110,7 +110,7 @@ function wpsc_var_set( name, value ) {
|
|
110 |
* Create an <option> tag in a cross-browser manner.
|
111 |
* See: https://github.com/wp-e-commerce/WP-e-Commerce/issues/1792
|
112 |
*
|
113 |
-
* @since
|
114 |
*
|
115 |
* @param {string} displaytext The text to put between the <option></option> tags.
|
116 |
* @param {string|int|float} [value=''] The value's option, (for the "value" attribute).
|
110 |
* Create an <option> tag in a cross-browser manner.
|
111 |
* See: https://github.com/wp-e-commerce/WP-e-Commerce/issues/1792
|
112 |
*
|
113 |
+
* @since 3.11.0
|
114 |
*
|
115 |
* @param {string} displaytext The text to put between the <option></option> tags.
|
116 |
* @param {string|int|float} [value=''] The value's option, (for the "value" attribute).
|
wpsc-core/wpsc-constants.php
CHANGED
@@ -55,7 +55,7 @@ function wpsc_core_constants() {
|
|
55 |
|
56 |
// Define Plugin version
|
57 |
if ( ! defined( 'WPSC_VERSION' ) ) {
|
58 |
-
define( 'WPSC_VERSION' , '3.
|
59 |
}
|
60 |
|
61 |
if ( ! defined( 'WPSC_MINOR_VERSION' ) ) {
|
@@ -63,7 +63,7 @@ function wpsc_core_constants() {
|
|
63 |
}
|
64 |
|
65 |
if ( ! defined( 'WPSC_PRESENTABLE_VERSION' ) ) {
|
66 |
-
define( 'WPSC_PRESENTABLE_VERSION', '3.
|
67 |
}
|
68 |
|
69 |
// Define a salt to use when we hash, WPSC_SALT may be defined for us in our config file, so check first
|
55 |
|
56 |
// Define Plugin version
|
57 |
if ( ! defined( 'WPSC_VERSION' ) ) {
|
58 |
+
define( 'WPSC_VERSION' , '3.12.0' );
|
59 |
}
|
60 |
|
61 |
if ( ! defined( 'WPSC_MINOR_VERSION' ) ) {
|
63 |
}
|
64 |
|
65 |
if ( ! defined( 'WPSC_PRESENTABLE_VERSION' ) ) {
|
66 |
+
define( 'WPSC_PRESENTABLE_VERSION', '3.12.0' );
|
67 |
}
|
68 |
|
69 |
// Define a salt to use when we hash, WPSC_SALT may be defined for us in our config file, so check first
|
wpsc-core/wpsc-functions.php
CHANGED
@@ -308,6 +308,39 @@ function wpsc_core_load_purchase_log_statuses() {
|
|
308 |
),
|
309 |
'order' => 6,
|
310 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
);
|
312 |
$wpsc_purchlog_statuses = apply_filters( 'wpsc_set_purchlog_statuses', $wpsc_purchlog_statuses );
|
313 |
}
|
@@ -674,7 +707,7 @@ function wpsc_get_page_post_names() {
|
|
674 |
* @return void
|
675 |
*/
|
676 |
function wpsc_cron() {
|
677 |
-
$default_schedules = array( 'hourly', 'twicedaily', 'daily', 'weekly');
|
678 |
|
679 |
/*
|
680 |
* Create a cron event for each likely cron schedule. The likely cron schedules
|
@@ -993,7 +1026,7 @@ add_action( 'admin_init', '_wpsc_clear_wp_cache_on_version_change', 1 );
|
|
993 |
*
|
994 |
* In a future version, we will likely have a `System` page that would include a link to the repair.php page.
|
995 |
*
|
996 |
-
* @since
|
997 |
*
|
998 |
* @param array $tables Core tables
|
999 |
*
|
308 |
),
|
309 |
'order' => 6,
|
310 |
),
|
311 |
+
array(
|
312 |
+
'internalname' => 'refunded',
|
313 |
+
'label' => __( 'Refunded', 'wp-e-commerce' ),
|
314 |
+
'view_label' => _nx_noop(
|
315 |
+
'Refunded <span class="count">(%d)</span>',
|
316 |
+
'Refunded <span class="count">(%d)</span>',
|
317 |
+
'Purchase log view links',
|
318 |
+
'wp-e-commerce'
|
319 |
+
),
|
320 |
+
'order' => 7,
|
321 |
+
),
|
322 |
+
array(
|
323 |
+
'internalname' => 'refund_pending',
|
324 |
+
'label' => __( 'Refund Pending', 'wp-e-commerce' ),
|
325 |
+
'view_label' => _nx_noop(
|
326 |
+
'Refund Pending <span class="count">(%d)</span>',
|
327 |
+
'Refund Pending <span class="count">(%d)</span>',
|
328 |
+
'Purchase log view links',
|
329 |
+
'wp-e-commerce'
|
330 |
+
),
|
331 |
+
'order' => 8,
|
332 |
+
),
|
333 |
+
array(
|
334 |
+
'internalname' => 'partially_refunded',
|
335 |
+
'label' => __( 'Partially Refunded', 'wp-e-commerce' ),
|
336 |
+
'view_label' => _nx_noop(
|
337 |
+
'Partially Refunded <span class="count">(%d)</span>',
|
338 |
+
'Partially Refunded <span class="count">(%d)</span>',
|
339 |
+
'Purchase log view links',
|
340 |
+
'wp-e-commerce'
|
341 |
+
),
|
342 |
+
'order' => 9,
|
343 |
+
),
|
344 |
);
|
345 |
$wpsc_purchlog_statuses = apply_filters( 'wpsc_set_purchlog_statuses', $wpsc_purchlog_statuses );
|
346 |
}
|
707 |
* @return void
|
708 |
*/
|
709 |
function wpsc_cron() {
|
710 |
+
$default_schedules = array( 'hourly', 'twicedaily', 'daily', 'weekly' );
|
711 |
|
712 |
/*
|
713 |
* Create a cron event for each likely cron schedule. The likely cron schedules
|
1026 |
*
|
1027 |
* In a future version, we will likely have a `System` page that would include a link to the repair.php page.
|
1028 |
*
|
1029 |
+
* @since 3.11.0
|
1030 |
*
|
1031 |
* @param array $tables Core tables
|
1032 |
*
|
wpsc-core/wpsc-includes.php
CHANGED
@@ -80,9 +80,6 @@ if ( is_admin() ) {
|
|
80 |
include_once( WPSC_FILE_PATH . '/wpsc-admin/admin.php' );
|
81 |
}
|
82 |
|
83 |
-
// Cron
|
84 |
-
require_once( WPSC_FILE_PATH . '/wpsc-includes/cron.php' );
|
85 |
-
|
86 |
// WP-CLI support
|
87 |
if ( defined( 'WP_CLI' ) && WP_CLI && version_compare( phpversion(), '5.3', '>=' ) ) {
|
88 |
require_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-wp-cli.php' );
|
@@ -90,3 +87,6 @@ if ( defined( 'WP_CLI' ) && WP_CLI && version_compare( phpversion(), '5.3', '>='
|
|
90 |
|
91 |
// Tracking
|
92 |
require_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-tracking.php' );
|
|
|
|
|
|
80 |
include_once( WPSC_FILE_PATH . '/wpsc-admin/admin.php' );
|
81 |
}
|
82 |
|
|
|
|
|
|
|
83 |
// WP-CLI support
|
84 |
if ( defined( 'WP_CLI' ) && WP_CLI && version_compare( phpversion(), '5.3', '>=' ) ) {
|
85 |
require_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-wp-cli.php' );
|
87 |
|
88 |
// Tracking
|
89 |
require_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-tracking.php' );
|
90 |
+
|
91 |
+
// Cron
|
92 |
+
require_once( WPSC_FILE_PATH . '/wpsc-includes/cron.php' );
|
wpsc-includes/cart.class.php
CHANGED
@@ -429,7 +429,7 @@ class WPSC_Cart {
|
|
429 |
* @return none
|
430 |
*/
|
431 |
function get_shipping_option() {
|
432 |
-
global $
|
433 |
|
434 |
if ( ( count( $this->shipping_quotes ) < 1 ) &&
|
435 |
isset( $wpsc_shipping_modules[$this->selected_shipping_method] ) &&
|
@@ -464,8 +464,7 @@ class WPSC_Cart {
|
|
464 |
* @access public
|
465 |
*/
|
466 |
function update_shipping( $method, $option ) {
|
467 |
-
global $
|
468 |
-
|
469 |
|
470 |
if ( ! empty( $method ) ) {
|
471 |
$this->selected_shipping_method = $method;
|
@@ -841,7 +840,6 @@ class WPSC_Cart {
|
|
841 |
* @return float returns the price as a floating point value
|
842 |
*/
|
843 |
function calculate_subtotal( $for_shipping = false ) {
|
844 |
-
global $wpdb;
|
845 |
if ( $for_shipping == true ) {
|
846 |
$total = 0;
|
847 |
foreach ( $this->cart_items as $key => $cart_item ) {
|
@@ -928,7 +926,6 @@ class WPSC_Cart {
|
|
928 |
* @return float returns the price as a floating point value
|
929 |
*/
|
930 |
function calculate_total_weight( $for_shipping = false ) {
|
931 |
-
global $wpdb;
|
932 |
$total = '';
|
933 |
if ( $for_shipping == true ) {
|
934 |
foreach ( $this->cart_items as $key => $cart_item ) {
|
@@ -1028,7 +1025,7 @@ class WPSC_Cart {
|
|
1028 |
* @return float returns the shipping as a floating point value
|
1029 |
*/
|
1030 |
function calculate_base_shipping() {
|
1031 |
-
global $
|
1032 |
|
1033 |
if ( $this->uses_shipping() ) {
|
1034 |
if ( isset( $wpsc_shipping_modules[ $this->selected_shipping_method ] )
|
@@ -1057,7 +1054,7 @@ class WPSC_Cart {
|
|
1057 |
* @return float returns the shipping as a floating point value
|
1058 |
*/
|
1059 |
function calculate_per_item_shipping( $method = null ) {
|
1060 |
-
global $
|
1061 |
$total = '';
|
1062 |
if ( $method == null ) {
|
1063 |
$method = $this->selected_shipping_method;
|
@@ -1080,8 +1077,6 @@ class WPSC_Cart {
|
|
1080 |
* @return float returns the price as a floating point value
|
1081 |
*/
|
1082 |
function uses_shipping() {
|
1083 |
-
global $wpdb;
|
1084 |
-
|
1085 |
if ( get_option( 'do_not_use_shipping' ) ) {
|
1086 |
return false;
|
1087 |
}
|
@@ -1120,8 +1115,6 @@ class WPSC_Cart {
|
|
1120 |
*
|
1121 |
*/
|
1122 |
function save_to_db( $purchase_log_id ) {
|
1123 |
-
global $wpdb;
|
1124 |
-
|
1125 |
foreach ( $this->cart_items as $key => $cart_item ) {
|
1126 |
$cart_item->save_to_db( $purchase_log_id );
|
1127 |
}
|
@@ -1209,7 +1202,7 @@ class WPSC_Cart {
|
|
1209 |
*/
|
1210 |
function get_shipping_quotes() {
|
1211 |
|
1212 |
-
global $
|
1213 |
$this->shipping_quotes = array();
|
1214 |
if ( $this->shipping_method == null ) {
|
1215 |
$this->get_shipping_method();
|
429 |
* @return none
|
430 |
*/
|
431 |
function get_shipping_option() {
|
432 |
+
global $wpsc_shipping_modules;
|
433 |
|
434 |
if ( ( count( $this->shipping_quotes ) < 1 ) &&
|
435 |
isset( $wpsc_shipping_modules[$this->selected_shipping_method] ) &&
|
464 |
* @access public
|
465 |
*/
|
466 |
function update_shipping( $method, $option ) {
|
467 |
+
global $wpsc_shipping_modules;
|
|
|
468 |
|
469 |
if ( ! empty( $method ) ) {
|
470 |
$this->selected_shipping_method = $method;
|
840 |
* @return float returns the price as a floating point value
|
841 |
*/
|
842 |
function calculate_subtotal( $for_shipping = false ) {
|
|
|
843 |
if ( $for_shipping == true ) {
|
844 |
$total = 0;
|
845 |
foreach ( $this->cart_items as $key => $cart_item ) {
|
926 |
* @return float returns the price as a floating point value
|
927 |
*/
|
928 |
function calculate_total_weight( $for_shipping = false ) {
|
|
|
929 |
$total = '';
|
930 |
if ( $for_shipping == true ) {
|
931 |
foreach ( $this->cart_items as $key => $cart_item ) {
|
1025 |
* @return float returns the shipping as a floating point value
|
1026 |
*/
|
1027 |
function calculate_base_shipping() {
|
1028 |
+
global $wpsc_shipping_modules;
|
1029 |
|
1030 |
if ( $this->uses_shipping() ) {
|
1031 |
if ( isset( $wpsc_shipping_modules[ $this->selected_shipping_method ] )
|
1054 |
* @return float returns the shipping as a floating point value
|
1055 |
*/
|
1056 |
function calculate_per_item_shipping( $method = null ) {
|
1057 |
+
global $wpsc_shipping_modules;
|
1058 |
$total = '';
|
1059 |
if ( $method == null ) {
|
1060 |
$method = $this->selected_shipping_method;
|
1077 |
* @return float returns the price as a floating point value
|
1078 |
*/
|
1079 |
function uses_shipping() {
|
|
|
|
|
1080 |
if ( get_option( 'do_not_use_shipping' ) ) {
|
1081 |
return false;
|
1082 |
}
|
1115 |
*
|
1116 |
*/
|
1117 |
function save_to_db( $purchase_log_id ) {
|
|
|
|
|
1118 |
foreach ( $this->cart_items as $key => $cart_item ) {
|
1119 |
$cart_item->save_to_db( $purchase_log_id );
|
1120 |
}
|
1202 |
*/
|
1203 |
function get_shipping_quotes() {
|
1204 |
|
1205 |
+
global $wpsc_shipping_modules;
|
1206 |
$this->shipping_quotes = array();
|
1207 |
if ( $this->shipping_method == null ) {
|
1208 |
$this->get_shipping_method();
|
wpsc-includes/category.functions.php
CHANGED
@@ -158,7 +158,7 @@ add_filter( 'get_terms','wpsc_get_terms_variation_sort_filter', 10 );
|
|
158 |
* By default, taxonomy queries include posts assigned to child categories.
|
159 |
* To disable this the taxonomy query needs to set `include_children` to false.
|
160 |
*
|
161 |
-
* @since
|
162 |
* @access private
|
163 |
*
|
164 |
* @param WP_Query $query Query object.
|
158 |
* By default, taxonomy queries include posts assigned to child categories.
|
159 |
* To disable this the taxonomy query needs to set `include_children` to false.
|
160 |
*
|
161 |
+
* @since 3.11.0
|
162 |
* @access private
|
163 |
*
|
164 |
* @param WP_Query $query Query object.
|
wpsc-includes/checkout-form-data.class.php
CHANGED
@@ -41,7 +41,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
41 |
* Fetches the actual $data array.
|
42 |
*
|
43 |
* @access protected
|
44 |
-
* @since
|
45 |
*
|
46 |
* @return WPSC_Checkout_Form_Data
|
47 |
*/
|
@@ -101,7 +101,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
101 |
/**
|
102 |
* Get the raw data indexed by the 'id' column.
|
103 |
*
|
104 |
-
* @since
|
105 |
*
|
106 |
* @return array
|
107 |
*/
|
@@ -119,7 +119,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
119 |
/**
|
120 |
* Determines if values in shipping fields matches values in billing fields.
|
121 |
*
|
122 |
-
* @since
|
123 |
*
|
124 |
* @return bool Whether shipping values match billing values.
|
125 |
*/
|
@@ -152,7 +152,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
152 |
/**
|
153 |
* Get the segmented billing info.
|
154 |
*
|
155 |
-
* @since
|
156 |
*
|
157 |
* @return array
|
158 |
*/
|
@@ -165,7 +165,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
165 |
/**
|
166 |
* Get the segmented shipping info.
|
167 |
*
|
168 |
-
* @since
|
169 |
*
|
170 |
* @return array
|
171 |
*/
|
@@ -178,7 +178,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
178 |
/**
|
179 |
* Gets the raw data array.
|
180 |
*
|
181 |
-
* @since
|
182 |
*
|
183 |
* @return array
|
184 |
*/
|
@@ -192,7 +192,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
192 |
* Prepares the return value for get() (apply_filters, etc).
|
193 |
*
|
194 |
* @access protected
|
195 |
-
* @since
|
196 |
*
|
197 |
* @param mixed $value Value fetched
|
198 |
* @param string $key Key for $data.
|
@@ -207,7 +207,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
207 |
* Prepares the return value for get_data() (apply_filters, etc).
|
208 |
*
|
209 |
* @access protected
|
210 |
-
* @since
|
211 |
*
|
212 |
* @return mixed
|
213 |
*/
|
@@ -266,7 +266,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
266 |
* @param string|int $key Expects either form ID or unique name.
|
267 |
* @param string $value Value to be set for field.
|
268 |
*
|
269 |
-
* @since
|
270 |
* @return WPSC_Checkout_Form_Data Current instance of form data.
|
271 |
*/
|
272 |
public function set( $key, $value = '' ) {
|
@@ -284,7 +284,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
284 |
/**
|
285 |
* Used in conjunction with set() method, saves individual checkout form fields to database.
|
286 |
*
|
287 |
-
* @since
|
288 |
* @return void
|
289 |
*/
|
290 |
public function save() {
|
@@ -361,7 +361,7 @@ class WPSC_Checkout_Form_Data extends WPSC_Query_Base {
|
|
361 |
/**
|
362 |
* Returns the log id property.
|
363 |
*
|
364 |
-
* @since
|
365 |
*
|
366 |
* @return int The log id.
|
367 |
*/
|
41 |
* Fetches the actual $data array.
|
42 |
*
|
43 |
* @access protected
|
44 |
+
* @since 3.11.5
|
45 |
*
|
46 |
* @return WPSC_Checkout_Form_Data
|
47 |
*/
|
101 |
/**
|
102 |
* Get the raw data indexed by the 'id' column.
|
103 |
*
|
104 |
+
* @since 3.11.5
|
105 |
*
|
106 |
* @return array
|
107 |
*/
|
119 |
/**
|
120 |
* Determines if values in shipping fields matches values in billing fields.
|
121 |
*
|
122 |
+
* @since 3.11.5
|
123 |
*
|
124 |
* @return bool Whether shipping values match billing values.
|
125 |
*/
|
152 |
/**
|
153 |
* Get the segmented billing info.
|
154 |
*
|
155 |
+
* @since 3.11.5
|
156 |
*
|
157 |
* @return array
|
158 |
*/
|
165 |
/**
|
166 |
* Get the segmented shipping info.
|
167 |
*
|
168 |
+
* @since 3.11.5
|
169 |
*
|
170 |
* @return array
|
171 |
*/
|
178 |
/**
|
179 |
* Gets the raw data array.
|
180 |
*
|
181 |
+
* @since 3.11.5
|
182 |
*
|
183 |
* @return array
|
184 |
*/
|
192 |
* Prepares the return value for get() (apply_filters, etc).
|
193 |
*
|
194 |
* @access protected
|
195 |
+
* @since 3.11.5
|
196 |
*
|
197 |
* @param mixed $value Value fetched
|
198 |
* @param string $key Key for $data.
|
207 |
* Prepares the return value for get_data() (apply_filters, etc).
|
208 |
*
|
209 |
* @access protected
|
210 |
+
* @since 3.11.5
|
211 |
*
|
212 |
* @return mixed
|
213 |
*/
|
266 |
* @param string|int $key Expects either form ID or unique name.
|
267 |
* @param string $value Value to be set for field.
|
268 |
*
|
269 |
+
* @since 3.11.5
|
270 |
* @return WPSC_Checkout_Form_Data Current instance of form data.
|
271 |
*/
|
272 |
public function set( $key, $value = '' ) {
|
284 |
/**
|
285 |
* Used in conjunction with set() method, saves individual checkout form fields to database.
|
286 |
*
|
287 |
+
* @since 3.11.5
|
288 |
* @return void
|
289 |
*/
|
290 |
public function save() {
|
361 |
/**
|
362 |
* Returns the log id property.
|
363 |
*
|
364 |
+
* @since 3.11.5
|
365 |
*
|
366 |
* @return int The log id.
|
367 |
*/
|
wpsc-includes/coupon.class.php
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
3 |
class WPSC_Coupon extends WPSC_Query_Base {
|
4 |
|
5 |
const IS_PERCENTAGE = 1;
|
@@ -12,7 +16,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
12 |
* to fetch a property with the same object.
|
13 |
*
|
14 |
* @access private
|
15 |
-
* @since
|
16 |
*
|
17 |
* @var int
|
18 |
*/
|
@@ -24,7 +28,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
24 |
*
|
25 |
* @access private
|
26 |
* @static
|
27 |
-
* @since
|
28 |
*
|
29 |
* @var array
|
30 |
*/
|
@@ -38,7 +42,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
38 |
*
|
39 |
* @access private
|
40 |
* @static
|
41 |
-
* @since
|
42 |
*
|
43 |
* @var array
|
44 |
*/
|
@@ -66,7 +70,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
66 |
* DB using the coupon id.
|
67 |
*
|
68 |
* @access public
|
69 |
-
* @since
|
70 |
*
|
71 |
* @param false|integer|array $value Optional. Defaults to false.
|
72 |
*/
|
@@ -101,7 +105,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
101 |
* as arguments, or an associative array containing key value pairs.
|
102 |
*
|
103 |
* @access public
|
104 |
-
* @since
|
105 |
*
|
106 |
* @param string|array $key Name of the property (column), or an array containing key value pairs.
|
107 |
* @param string|integer|null $value Optional. Defaults to false. In case $key is a string, this should be specified.
|
@@ -134,7 +138,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
134 |
* Prepares the return value for get() (apply_filters, etc).
|
135 |
*
|
136 |
* @access protected
|
137 |
-
* @since
|
138 |
*
|
139 |
* @param mixed $value Value fetched
|
140 |
* @param string $key Key for $data.
|
@@ -149,7 +153,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
149 |
* Prepares the return value for get_data() (apply_filters, etc).
|
150 |
*
|
151 |
* @access protected
|
152 |
-
* @since
|
153 |
*
|
154 |
* @return mixed
|
155 |
*/
|
@@ -161,7 +165,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
161 |
* Get the SQL query format for a column.
|
162 |
*
|
163 |
* @access private
|
164 |
-
* @since
|
165 |
*
|
166 |
* @param string $col Name of the column.
|
167 |
* @return string Placeholder.
|
@@ -185,7 +189,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
185 |
* $wpdb methods (update, insert etc.)
|
186 |
*
|
187 |
* @access private
|
188 |
-
* @since
|
189 |
*
|
190 |
* @param array $data
|
191 |
* @return array
|
@@ -206,7 +210,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
206 |
* Fetches the actual record from the database.
|
207 |
*
|
208 |
* @access private
|
209 |
-
* @since
|
210 |
*
|
211 |
* @return WPSC_Coupon
|
212 |
*/
|
@@ -258,7 +262,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
258 |
* Update cache of the passed coupon object.
|
259 |
*
|
260 |
* @access public
|
261 |
-
* @since
|
262 |
*/
|
263 |
public function update_cache() {
|
264 |
|
@@ -271,7 +275,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
271 |
* Deletes cache of a coupon.
|
272 |
*
|
273 |
* @access public
|
274 |
-
* @since
|
275 |
*/
|
276 |
public function delete_cache() {
|
277 |
|
@@ -286,7 +290,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
286 |
* Saves the coupon back to the database.
|
287 |
*
|
288 |
* @access public
|
289 |
-
* @since
|
290 |
*/
|
291 |
public function save() {
|
292 |
|
@@ -338,7 +342,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
338 |
* Deletes a coupon from the database.
|
339 |
*
|
340 |
* @access public
|
341 |
-
* @since
|
342 |
*
|
343 |
* @return boolean
|
344 |
*/
|
@@ -432,7 +436,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
432 |
* Checks if the current coupon is valid to use (expiry date, active, used).
|
433 |
*
|
434 |
* @access public
|
435 |
-
* @since
|
436 |
*
|
437 |
* @return boolean True if coupon is not expired, used and still active, false otherwise.
|
438 |
*/
|
@@ -489,7 +493,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
489 |
* Check whether this coupon is active.
|
490 |
*
|
491 |
* @access public
|
492 |
-
* @since
|
493 |
*
|
494 |
* @return boolean
|
495 |
*/
|
@@ -503,7 +507,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
503 |
* Check whether this coupon is a "Free shipping" coupon.
|
504 |
*
|
505 |
* @access public
|
506 |
-
* @since
|
507 |
*
|
508 |
* @return boolean
|
509 |
*/
|
@@ -517,7 +521,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
517 |
* Check whether this coupon is a "percentage" coupon.
|
518 |
*
|
519 |
* @access public
|
520 |
-
* @since
|
521 |
*
|
522 |
* @return boolean
|
523 |
*/
|
@@ -531,7 +535,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
531 |
* Check whether this coupon is a fixed amount coupon.
|
532 |
*
|
533 |
* @access public
|
534 |
-
* @since
|
535 |
*
|
536 |
* @return boolean
|
537 |
*/
|
@@ -545,7 +549,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
545 |
* Check whether this coupon can only be used once.
|
546 |
*
|
547 |
* @access public
|
548 |
-
* @since
|
549 |
*
|
550 |
* @return boolean
|
551 |
*/
|
@@ -559,7 +563,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
559 |
* Check if a single use coupon is used.
|
560 |
*
|
561 |
* @access public
|
562 |
-
* @since
|
563 |
*
|
564 |
* @return boolean
|
565 |
*/
|
@@ -575,7 +579,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
575 |
* If the coupon can only be used once it will be marked as used and made inactive.
|
576 |
*
|
577 |
* @access public
|
578 |
-
* @since
|
579 |
*/
|
580 |
public function used() {
|
581 |
|
@@ -591,7 +595,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
591 |
* Check whether this coupon can be applied to all items.
|
592 |
*
|
593 |
* @access public
|
594 |
-
* @since
|
595 |
*
|
596 |
* @return boolean
|
597 |
*/
|
@@ -605,7 +609,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
605 |
* Check whether the coupon has conditions.
|
606 |
*
|
607 |
* @access public
|
608 |
-
* @since
|
609 |
*
|
610 |
* @return boolean True if there are conditions.
|
611 |
*/
|
@@ -621,7 +625,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
621 |
* Get Percentage Discount
|
622 |
*
|
623 |
* @access public
|
624 |
-
* @since
|
625 |
*
|
626 |
* @param integer|double $price Price.
|
627 |
* @return integer|double Discount amount.
|
@@ -642,7 +646,7 @@ class WPSC_Coupon extends WPSC_Query_Base {
|
|
642 |
* Get Fixed Discount
|
643 |
*
|
644 |
* @access public
|
645 |
-
* @since
|
646 |
*
|
647 |
* @param int $quantity Discount multiplier.
|
648 |
* @return int Discount amount.
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* WPSC Coupon Class.
|
5 |
+
* @since 3.8.2
|
6 |
+
*/
|
7 |
class WPSC_Coupon extends WPSC_Query_Base {
|
8 |
|
9 |
const IS_PERCENTAGE = 1;
|
16 |
* to fetch a property with the same object.
|
17 |
*
|
18 |
* @access private
|
19 |
+
* @since 3.11.5
|
20 |
*
|
21 |
* @var int
|
22 |
*/
|
28 |
*
|
29 |
* @access private
|
30 |
* @static
|
31 |
+
* @since 3.11.5
|
32 |
*
|
33 |
* @var array
|
34 |
*/
|
42 |
*
|
43 |
* @access private
|
44 |
* @static
|
45 |
+
* @since 3.11.5
|
46 |
*
|
47 |
* @var array
|
48 |
*/
|
70 |
* DB using the coupon id.
|
71 |
*
|
72 |
* @access public
|
73 |
+
* @since 3.11.5
|
74 |
*
|
75 |
* @param false|integer|array $value Optional. Defaults to false.
|
76 |
*/
|
105 |
* as arguments, or an associative array containing key value pairs.
|
106 |
*
|
107 |
* @access public
|
108 |
+
* @since 3.11.5
|
109 |
*
|
110 |
* @param string|array $key Name of the property (column), or an array containing key value pairs.
|
111 |
* @param string|integer|null $value Optional. Defaults to false. In case $key is a string, this should be specified.
|
138 |
* Prepares the return value for get() (apply_filters, etc).
|
139 |
*
|
140 |
* @access protected
|
141 |
+
* @since 3.11.5
|
142 |
*
|
143 |
* @param mixed $value Value fetched
|
144 |
* @param string $key Key for $data.
|
153 |
* Prepares the return value for get_data() (apply_filters, etc).
|
154 |
*
|
155 |
* @access protected
|
156 |
+
* @since 3.11.5
|
157 |
*
|
158 |
* @return mixed
|
159 |
*/
|
165 |
* Get the SQL query format for a column.
|
166 |
*
|
167 |
* @access private
|
168 |
+
* @since 3.11.5
|
169 |
*
|
170 |
* @param string $col Name of the column.
|
171 |
* @return string Placeholder.
|
189 |
* $wpdb methods (update, insert etc.)
|
190 |
*
|
191 |
* @access private
|
192 |
+
* @since 3.11.5
|
193 |
*
|
194 |
* @param array $data
|
195 |
* @return array
|
210 |
* Fetches the actual record from the database.
|
211 |
*
|
212 |
* @access private
|
213 |
+
* @since 3.11.5
|
214 |
*
|
215 |
* @return WPSC_Coupon
|
216 |
*/
|
262 |
* Update cache of the passed coupon object.
|
263 |
*
|
264 |
* @access public
|
265 |
+
* @since 3.11.5
|
266 |
*/
|
267 |
public function update_cache() {
|
268 |
|
275 |
* Deletes cache of a coupon.
|
276 |
*
|
277 |
* @access public
|
278 |
+
* @since 3.11.5
|
279 |
*/
|
280 |
public function delete_cache() {
|
281 |
|
290 |
* Saves the coupon back to the database.
|
291 |
*
|
292 |
* @access public
|
293 |
+
* @since 3.11.5
|
294 |
*/
|
295 |
public function save() {
|
296 |
|
342 |
* Deletes a coupon from the database.
|
343 |
*
|
344 |
* @access public
|
345 |
+
* @since 3.11.5
|
346 |
*
|
347 |
* @return boolean
|
348 |
*/
|
436 |
* Checks if the current coupon is valid to use (expiry date, active, used).
|
437 |
*
|
438 |
* @access public
|
439 |
+
* @since 3.11.5
|
440 |
*
|
441 |
* @return boolean True if coupon is not expired, used and still active, false otherwise.
|
442 |
*/
|
493 |
* Check whether this coupon is active.
|
494 |
*
|
495 |
* @access public
|
496 |
+
* @since 3.11.5
|
497 |
*
|
498 |
* @return boolean
|
499 |
*/
|
507 |
* Check whether this coupon is a "Free shipping" coupon.
|
508 |
*
|
509 |
* @access public
|
510 |
+
* @since 3.11.5
|
511 |
*
|
512 |
* @return boolean
|
513 |
*/
|
521 |
* Check whether this coupon is a "percentage" coupon.
|
522 |
*
|
523 |
* @access public
|
524 |
+
* @since 3.11.5
|
525 |
*
|
526 |
* @return boolean
|
527 |
*/
|
535 |
* Check whether this coupon is a fixed amount coupon.
|
536 |
*
|
537 |
* @access public
|
538 |
+
* @since 3.11.5
|
539 |
*
|
540 |
* @return boolean
|
541 |
*/
|
549 |
* Check whether this coupon can only be used once.
|
550 |
*
|
551 |
* @access public
|
552 |
+
* @since 3.11.5
|
553 |
*
|
554 |
* @return boolean
|
555 |
*/
|
563 |
* Check if a single use coupon is used.
|
564 |
*
|
565 |
* @access public
|
566 |
+
* @since 3.11.5
|
567 |
*
|
568 |
* @return boolean
|
569 |
*/
|
579 |
* If the coupon can only be used once it will be marked as used and made inactive.
|
580 |
*
|
581 |
* @access public
|
582 |
+
* @since 3.11.5
|
583 |
*/
|
584 |
public function used() {
|
585 |
|
595 |
* Check whether this coupon can be applied to all items.
|
596 |
*
|
597 |
* @access public
|
598 |
+
* @since 3.11.5
|
599 |
*
|
600 |
* @return boolean
|
601 |
*/
|
609 |
* Check whether the coupon has conditions.
|
610 |
*
|
611 |
* @access public
|
612 |
+
* @since 3.11.5
|
613 |
*
|
614 |
* @return boolean True if there are conditions.
|
615 |
*/
|
625 |
* Get Percentage Discount
|
626 |
*
|
627 |
* @access public
|
628 |
+
* @since 3.11.5
|
629 |
*
|
630 |
* @param integer|double $price Price.
|
631 |
* @return integer|double Discount amount.
|
646 |
* Get Fixed Discount
|
647 |
*
|
648 |
* @access public
|
649 |
+
* @since 3.11.5
|
650 |
*
|
651 |
* @param int $quantity Discount multiplier.
|
652 |
* @return int Discount amount.
|
wpsc-includes/cron.php
CHANGED
@@ -1,6 +1,57 @@
|
|
1 |
<?php
|
2 |
add_action( 'wpsc_hourly_cron_task', 'wpsc_clear_stock_claims' );
|
3 |
add_action( 'wpsc_hourly_cron_task', '_wpsc_delete_expired_visitors' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
/**
|
6 |
* wpsc_clear_stock_claims, clears the stock claims, runs using wp-cron and when editing purchase log statuses via the dashboard
|
@@ -128,4 +179,3 @@ function wpsc_do_delete_visitor_ajax( $visitor_id ) {
|
|
128 |
|
129 |
// add admin action for convenience
|
130 |
add_action( '_wpsc_delete_expired_visitors_action' , '_wpsc_delete_expired_visitors' );
|
131 |
-
|
1 |
<?php
|
2 |
add_action( 'wpsc_hourly_cron_task', 'wpsc_clear_stock_claims' );
|
3 |
add_action( 'wpsc_hourly_cron_task', '_wpsc_delete_expired_visitors' );
|
4 |
+
add_action( 'wpsc_weekly_cron_task', 'wpsc_lic_weekly_license_check' );
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Checks any active Addons license keys and updates license data
|
8 |
+
*
|
9 |
+
* @since 3.12.0
|
10 |
+
*/
|
11 |
+
function wpsc_lic_weekly_license_check() {
|
12 |
+
|
13 |
+
$active_licenses = get_option( 'wpec_licenses_active_products', array() );
|
14 |
+
|
15 |
+
if ( empty( $active_licenses ) ) {
|
16 |
+
return;
|
17 |
+
}
|
18 |
+
|
19 |
+
foreach ( (array) $active_licenses as $license ) {
|
20 |
+
$license_info = get_option( 'wpec_product_' . $license . '_license_active' );
|
21 |
+
|
22 |
+
// data to send in our API request
|
23 |
+
$api_params = array(
|
24 |
+
'wpec_lic_action'=> 'check_license',
|
25 |
+
'license' => $license_info->license_key,
|
26 |
+
'item_id' => $license_info->item_id,
|
27 |
+
'url' => home_url()
|
28 |
+
);
|
29 |
+
|
30 |
+
// Call the API
|
31 |
+
$response = wp_safe_remote_post(
|
32 |
+
'https://wpecommerce.org/',
|
33 |
+
array(
|
34 |
+
'timeout' => 15,
|
35 |
+
'sslverify' => false,
|
36 |
+
'body' => $api_params
|
37 |
+
)
|
38 |
+
);
|
39 |
+
|
40 |
+
// make sure the response came back okay
|
41 |
+
if ( is_wp_error( $response ) ) {
|
42 |
+
return false;
|
43 |
+
}
|
44 |
+
|
45 |
+
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
46 |
+
update_option( 'wpec_product_' . $license . '_license_active', $license_data );
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
function wpsc_add_tracking_cron() {
|
51 |
+
$tracking = new WPSC_Tracking();
|
52 |
+
$tracking->send_data();
|
53 |
+
}
|
54 |
+
add_action( 'wpsc_weekly_cron_task', 'wpsc_add_tracking_cron' );
|
55 |
|
56 |
/**
|
57 |
* wpsc_clear_stock_claims, clears the stock claims, runs using wp-cron and when editing purchase log statuses via the dashboard
|
179 |
|
180 |
// add admin action for convenience
|
181 |
add_action( '_wpsc_delete_expired_visitors_action' , '_wpsc_delete_expired_visitors' );
|
|
wpsc-includes/mimetype.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
_wpsc_deprecated_file( __FILE__, '
|
4 |
|
5 |
class mimetype {
|
6 |
function getType($filename) {
|
@@ -172,4 +172,4 @@ class mimetype {
|
|
172 |
"ice" => "x-conference-xcooltalk"
|
173 |
);
|
174 |
}
|
175 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
_wpsc_deprecated_file( __FILE__, '3.11.0', __( 'The mimetype class has been deprecated in favor of core WordPress functionality.', 'wp-e-commerce' ) );
|
4 |
|
5 |
class mimetype {
|
6 |
function getType($filename) {
|
172 |
"ice" => "x-conference-xcooltalk"
|
173 |
);
|
174 |
}
|
175 |
+
}
|
wpsc-includes/processing.functions.php
CHANGED
@@ -42,7 +42,7 @@ function wpsc_currency_display( $price_in, $args = null ) {
|
|
42 |
wp_cache_set( $currency_type, $wpsc_currency_data, 'wpsc_currency_id' );
|
43 |
}
|
44 |
} elseif ( ! $wpsc_currency_data = wp_cache_get( $query['isocode'], 'wpsc_currency_isocode' ) ) {
|
45 |
-
$wpsc_currency_data = WPSC_Countries::get_currency_data( $
|
46 |
wp_cache_set( $query['isocode'], $wpsc_currency_data, 'wpsc_currency_isocode' );
|
47 |
}
|
48 |
|
42 |
wp_cache_set( $currency_type, $wpsc_currency_data, 'wpsc_currency_id' );
|
43 |
}
|
44 |
} elseif ( ! $wpsc_currency_data = wp_cache_get( $query['isocode'], 'wpsc_currency_isocode' ) ) {
|
45 |
+
$wpsc_currency_data = WPSC_Countries::get_currency_data( $query['isocode'], true );
|
46 |
wp_cache_set( $query['isocode'], $wpsc_currency_data, 'wpsc_currency_isocode' );
|
47 |
}
|
48 |
|
wpsc-includes/product-template.php
CHANGED
@@ -290,20 +290,20 @@ function wpsc_product_has_variations( $id = 0 ) {
|
|
290 |
* Check whether or not a product is a variation.
|
291 |
*
|
292 |
* @param int $product_id Product ID to check.
|
293 |
-
* @since
|
294 |
* @return mixed Returns parent product ID if product is a variation, false otherwise.
|
295 |
*/
|
296 |
function wpsc_product_is_variation( $product_id ) {
|
297 |
$product = get_post( $product_id );
|
298 |
-
|
299 |
if ( ! is_a( $product, 'WP_Post' ) ) {
|
300 |
return false;
|
301 |
}
|
302 |
-
|
303 |
if ( 'wpsc-product' !== $product->post_type || ! $product->post_parent ) {
|
304 |
return false;
|
305 |
}
|
306 |
-
|
307 |
return $product->post_parent;
|
308 |
}
|
309 |
|
290 |
* Check whether or not a product is a variation.
|
291 |
*
|
292 |
* @param int $product_id Product ID to check.
|
293 |
+
* @since 3.11.0
|
294 |
* @return mixed Returns parent product ID if product is a variation, false otherwise.
|
295 |
*/
|
296 |
function wpsc_product_is_variation( $product_id ) {
|
297 |
$product = get_post( $product_id );
|
298 |
+
|
299 |
if ( ! is_a( $product, 'WP_Post' ) ) {
|
300 |
return false;
|
301 |
}
|
302 |
+
|
303 |
if ( 'wpsc-product' !== $product->post_type || ! $product->post_parent ) {
|
304 |
return false;
|
305 |
}
|
306 |
+
|
307 |
return $product->post_parent;
|
308 |
}
|
309 |
|
wpsc-includes/purchase-log-notes.class.php
CHANGED
@@ -34,7 +34,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
34 |
if ( $log instanceof WPSC_Purchase_Log ) {
|
35 |
$this->log = $log;
|
36 |
} else {
|
37 |
-
$this->log =
|
38 |
}
|
39 |
|
40 |
if ( empty( self::$map_text ) ) {
|
@@ -119,7 +119,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
119 |
* Prepares the return value for get() (apply_filters, etc).
|
120 |
*
|
121 |
* @access protected
|
122 |
-
* @since
|
123 |
*
|
124 |
* @param mixed $value Value fetched
|
125 |
* @param string $key Key for $data.
|
@@ -134,7 +134,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
134 |
* Prepares the return value for get_data() (apply_filters, etc).
|
135 |
*
|
136 |
* @access protected
|
137 |
-
* @since
|
138 |
*
|
139 |
* @return mixed
|
140 |
*/
|
@@ -142,6 +142,18 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
142 |
return apply_filters( 'wpsc_get_purchase_log_notes', $this->data, $this );
|
143 |
}
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
public function add( $note_args ) {
|
146 |
if ( ! is_array( $note_args ) ) {
|
147 |
$note_args = self::parse_args( array( self::$map_keys[ self::KEY_CONTENT ] => $note_args ) );
|
@@ -150,6 +162,15 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
150 |
return $this->set( false, $note_args );
|
151 |
}
|
152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
public function remove( $note_id ) {
|
154 |
$this->fetch();
|
155 |
unset( $this->data[ $note_id ] );
|
@@ -162,7 +183,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
162 |
* as arguments, or an associative array containing key value pairs.
|
163 |
*
|
164 |
* @access public
|
165 |
-
* @since
|
166 |
*
|
167 |
* @param mixed $key Name of the property (column), or an array containing
|
168 |
* key value pairs
|
@@ -196,18 +217,20 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
196 |
* Saves the object back to the database.
|
197 |
*
|
198 |
* @access public
|
199 |
-
* @since
|
200 |
*
|
201 |
* @return mixed
|
202 |
*/
|
203 |
public function save() {
|
204 |
global $wpdb;
|
205 |
|
|
|
206 |
$this->data = apply_filters( 'wpsc_purchase_log_notes_to_save', $this->data, $this );
|
207 |
|
208 |
$meta = $this->log->get_meta();
|
209 |
|
210 |
$deleted = array();
|
|
|
211 |
if ( ! empty( $meta['notes'] ) ) {
|
212 |
foreach ( $meta['notes'] as $key => $note ) {
|
213 |
$deleted[] = wpsc_delete_purchase_meta( $this->log->get( 'id' ), 'notes', $note );
|
@@ -257,7 +280,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
257 |
/**
|
258 |
* Merge arguments into defaults array.
|
259 |
*
|
260 |
-
* @since
|
261 |
*
|
262 |
* @param array $args Value to merge with defaults.
|
263 |
* @return array Merged arguments with defaults.
|
@@ -274,7 +297,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
274 |
/**
|
275 |
* Merge arguments into defaults array.
|
276 |
*
|
277 |
-
* @since
|
278 |
*
|
279 |
* @param array $args Value to merge with defaults.
|
280 |
* @return array Merged arguments with defaults.
|
@@ -291,7 +314,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
291 |
/**
|
292 |
* Get current for Iterator.
|
293 |
*
|
294 |
-
* @since
|
295 |
*
|
296 |
* @return mixed
|
297 |
*/
|
@@ -303,7 +326,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
303 |
/**
|
304 |
* Get key for Iterator.
|
305 |
*
|
306 |
-
* @since
|
307 |
*
|
308 |
* @return scalar
|
309 |
*/
|
@@ -315,7 +338,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
315 |
/**
|
316 |
* Get next for Iterator.
|
317 |
*
|
318 |
-
* @since
|
319 |
*
|
320 |
* @return void
|
321 |
*/
|
@@ -327,7 +350,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
327 |
/**
|
328 |
* Get prev for Iterator.
|
329 |
*
|
330 |
-
* @since
|
331 |
*
|
332 |
* @return void
|
333 |
*/
|
@@ -339,7 +362,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
339 |
/**
|
340 |
* Get rewind for Iterator.
|
341 |
*
|
342 |
-
* @since
|
343 |
*
|
344 |
* @return void
|
345 |
*/
|
@@ -351,7 +374,7 @@ class WPSC_Purchase_Log_Notes extends WPSC_Query_Base implements Iterator {
|
|
351 |
/**
|
352 |
* Get valid for Iterator.
|
353 |
*
|
354 |
-
* @since
|
355 |
*
|
356 |
* @return boolean
|
357 |
*/
|
34 |
if ( $log instanceof WPSC_Purchase_Log ) {
|
35 |
$this->log = $log;
|
36 |
} else {
|
37 |
+
$this->log = wpsc_get_order( $log );
|
38 |
}
|
39 |
|
40 |
if ( empty( self::$map_text ) ) {
|
119 |
* Prepares the return value for get() (apply_filters, etc).
|
120 |
*
|
121 |
* @access protected
|
122 |
+
* @since 3.11.5
|
123 |
*
|
124 |
* @param mixed $value Value fetched
|
125 |
* @param string $key Key for $data.
|
134 |
* Prepares the return value for get_data() (apply_filters, etc).
|
135 |
*
|
136 |
* @access protected
|
137 |
+
* @since 3.11.5
|
138 |
*
|
139 |
* @return mixed
|
140 |
*/
|
142 |
return apply_filters( 'wpsc_get_purchase_log_notes', $this->data, $this );
|
143 |
}
|
144 |
|
145 |
+
/**
|
146 |
+
* Add a note to the log.
|
147 |
+
*
|
148 |
+
* @since 3.11.5
|
149 |
+
*
|
150 |
+
* @param mixed $note_args String to add note. Optionally Accepts an array to specify note attributes: {
|
151 |
+
* @type string $type The note type. Defaults to 'default', but can be 'error'.
|
152 |
+
* @type string $status The note status. Defaults to 'public'.
|
153 |
+
* @type int $time The note timestamp. Defaults to time().
|
154 |
+
* @type string $content The note text.
|
155 |
+
* }
|
156 |
+
*/
|
157 |
public function add( $note_args ) {
|
158 |
if ( ! is_array( $note_args ) ) {
|
159 |
$note_args = self::parse_args( array( self::$map_keys[ self::KEY_CONTENT ] => $note_args ) );
|
162 |
return $this->set( false, $note_args );
|
163 |
}
|
164 |
|
165 |
+
/**
|
166 |
+
* Remove a note from the log by the note_id (or index).
|
167 |
+
*
|
168 |
+
* @since 3.11.5
|
169 |
+
*
|
170 |
+
* @param int $note_id Note index.
|
171 |
+
*
|
172 |
+
* @return WPSC_Query_Base The current object (for method chaining)
|
173 |
+
*/
|
174 |
public function remove( $note_id ) {
|
175 |
$this->fetch();
|
176 |
unset( $this->data[ $note_id ] );
|
183 |
* as arguments, or an associative array containing key value pairs.
|
184 |
*
|
185 |
* @access public
|
186 |
+
* @since 3.11.5
|
187 |
*
|
188 |
* @param mixed $key Name of the property (column), or an array containing
|
189 |
* key value pairs
|
217 |
* Saves the object back to the database.
|
218 |
*
|
219 |
* @access public
|
220 |
+
* @since 3.11.5
|
221 |
*
|
222 |
* @return mixed
|
223 |
*/
|
224 |
public function save() {
|
225 |
global $wpdb;
|
226 |
|
227 |
+
$this->fetch();
|
228 |
$this->data = apply_filters( 'wpsc_purchase_log_notes_to_save', $this->data, $this );
|
229 |
|
230 |
$meta = $this->log->get_meta();
|
231 |
|
232 |
$deleted = array();
|
233 |
+
|
234 |
if ( ! empty( $meta['notes'] ) ) {
|
235 |
foreach ( $meta['notes'] as $key => $note ) {
|
236 |
$deleted[] = wpsc_delete_purchase_meta( $this->log->get( 'id' ), 'notes', $note );
|
280 |
/**
|
281 |
* Merge arguments into defaults array.
|
282 |
*
|
283 |
+
* @since 3.11.5
|
284 |
*
|
285 |
* @param array $args Value to merge with defaults.
|
286 |
* @return array Merged arguments with defaults.
|
297 |
/**
|
298 |
* Merge arguments into defaults array.
|
299 |
*
|
300 |
+
* @since 3.11.5
|
301 |
*
|
302 |
* @param array $args Value to merge with defaults.
|
303 |
* @return array Merged arguments with defaults.
|
314 |
/**
|
315 |
* Get current for Iterator.
|
316 |
*
|
317 |
+
* @since 3.11.5
|
318 |
*
|
319 |
* @return mixed
|
320 |
*/
|
326 |
/**
|
327 |
* Get key for Iterator.
|
328 |
*
|
329 |
+
* @since 3.11.5
|
330 |
*
|
331 |
* @return scalar
|
332 |
*/
|
338 |
/**
|
339 |
* Get next for Iterator.
|
340 |
*
|
341 |
+
* @since 3.11.5
|
342 |
*
|
343 |
* @return void
|
344 |
*/
|
350 |
/**
|
351 |
* Get prev for Iterator.
|
352 |
*
|
353 |
+
* @since 3.11.5
|
354 |
*
|
355 |
* @return void
|
356 |
*/
|
362 |
/**
|
363 |
* Get rewind for Iterator.
|
364 |
*
|
365 |
+
* @since 3.11.5
|
366 |
*
|
367 |
* @return void
|
368 |
*/
|
374 |
/**
|
375 |
* Get valid for Iterator.
|
376 |
*
|
377 |
+
* @since 3.11.5
|
378 |
*
|
379 |
* @return boolean
|
380 |
*/
|
wpsc-includes/purchase-log.class.php
CHANGED
@@ -70,7 +70,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
70 |
* into the database
|
71 |
*
|
72 |
* @static
|
73 |
-
* @since
|
74 |
* @var array
|
75 |
*/
|
76 |
private static $float_cols = array(
|
@@ -85,7 +85,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
85 |
* Array of metadata
|
86 |
*
|
87 |
* @static
|
88 |
-
* @since
|
89 |
* @var array
|
90 |
*/
|
91 |
private static $metadata = array(
|
@@ -393,7 +393,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
393 |
*
|
394 |
* @access public
|
395 |
* @static
|
396 |
-
* @since
|
397 |
*
|
398 |
* @return void
|
399 |
*/
|
@@ -435,7 +435,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
435 |
*
|
436 |
* @access public
|
437 |
* @static
|
438 |
-
* @since
|
439 |
*
|
440 |
* @param string|null $value Optional (left for back-compatibility). The value which was queried.
|
441 |
* @param string|null $col Optional (left for back-compatibility). The column used as the identifier.
|
@@ -493,7 +493,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
493 |
|
494 |
if ( $log_id > 0 ) {
|
495 |
|
496 |
-
do_action( 'wpsc_purchase_log_before_delete', $log_id );
|
497 |
|
498 |
$this->delete_caches();
|
499 |
|
@@ -514,7 +514,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
514 |
$wpdb->query( $wpdb->prepare( "DELETE FROM `" . WPSC_TABLE_PURCHASE_META . "` WHERE `wpsc_purchase_id` = %d", $log_id ) );
|
515 |
$wpdb->query( $wpdb->prepare( "DELETE FROM `" . WPSC_TABLE_DOWNLOAD_STATUS . "` WHERE `purchid` = %d ", $log_id ) );
|
516 |
|
517 |
-
do_action( 'wpsc_purchase_log_delete', $log_id );
|
518 |
|
519 |
return true;
|
520 |
|
@@ -696,14 +696,14 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
696 |
* Returns the value of the specified property of the $data array if it exists.
|
697 |
*
|
698 |
* @access public
|
699 |
-
* @since
|
700 |
*
|
701 |
* @param string $key Name of the property (column)
|
702 |
* @return mixed
|
703 |
*/
|
704 |
public function get( $key ) {
|
705 |
if ( 'notes' === $key ) {
|
706 |
-
_wpsc_doing_it_wrong( __FUNCTION__, __( 'Getting notes from the Log object has been deprecated in favor of the wpsc_get_order_notes() function.', 'wp-e-commerce' ), '
|
707 |
}
|
708 |
|
709 |
return parent::get( $key );
|
@@ -713,7 +713,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
713 |
* Prepares the return value for get() (apply_filters, etc).
|
714 |
*
|
715 |
* @access protected
|
716 |
-
* @since
|
717 |
*
|
718 |
* @param mixed $value Value fetched
|
719 |
* @param string $key Key for $data.
|
@@ -728,7 +728,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
728 |
* Prepares the return value for get_data() (apply_filters, etc).
|
729 |
*
|
730 |
* @access protected
|
731 |
-
* @since
|
732 |
*
|
733 |
* @return mixed
|
734 |
*/
|
@@ -740,7 +740,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
740 |
* Prepares the return value for get_meta() (apply_filters, etc).
|
741 |
*
|
742 |
* @access protected
|
743 |
-
* @since
|
744 |
*
|
745 |
* @return mixed
|
746 |
*/
|
@@ -749,7 +749,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
749 |
}
|
750 |
|
751 |
public function get_cart_contents() {
|
752 |
-
_wpsc_doing_it_wrong( __FUNCTION__, __( 'This function has been deprecated in favor of the get_items() method.', 'wp-e-commerce' ), '
|
753 |
return $this->get_items();
|
754 |
}
|
755 |
|
@@ -810,7 +810,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
810 |
$item = $this->get_item( $item_id );
|
811 |
|
812 |
if ( $item ) {
|
813 |
-
do_action( 'wpsc_purchase_log_before_update_item', $item_id );
|
814 |
|
815 |
$data = wp_unslash( $data );
|
816 |
$result = $wpdb->update( WPSC_TABLE_CART_CONTENTS, $data, array( 'id' => $item_id ) );
|
@@ -820,7 +820,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
820 |
$this->log_items = array();
|
821 |
$this->get_item( $item_id );
|
822 |
|
823 |
-
do_action( 'wpsc_purchase_log_update_item', $item_id );
|
824 |
}
|
825 |
|
826 |
return $result;
|
@@ -836,7 +836,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
836 |
$item = $this->get_item( $item_id );
|
837 |
|
838 |
if ( $item ) {
|
839 |
-
do_action( 'wpsc_purchase_log_before_remove_item', $item_id );
|
840 |
|
841 |
$result = $wpdb->delete( WPSC_TABLE_CART_CONTENTS, array( 'id' => $item_id ) );
|
842 |
|
@@ -845,7 +845,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
845 |
unset( $this->log_items[ $this->log_item_ids[ $item_id ] ] );
|
846 |
unset( $this->log_item_ids[ $item_id ] );
|
847 |
|
848 |
-
do_action( 'wpsc_purchase_log_remove_item', $item_id );
|
849 |
}
|
850 |
|
851 |
return $result;
|
@@ -1053,7 +1053,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
1053 |
* Save meta data for purchase log, if any was set via set().
|
1054 |
*
|
1055 |
* @access public
|
1056 |
-
* @since
|
1057 |
*
|
1058 |
* @return WPSC_Purchase_Log The current object (for method chaining)
|
1059 |
*/
|
@@ -1063,6 +1063,12 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
1063 |
$meta = $this->get_meta();
|
1064 |
|
1065 |
foreach ( $meta as $key => $value ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
1066 |
$is_multiple_meta = isset( self::$multiple_meta[ $key ] );
|
1067 |
|
1068 |
if ( $is_multiple_meta ) {
|
@@ -1112,7 +1118,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
1112 |
/**
|
1113 |
* Adds ability to retrieve a purchase log by a meta key or value.
|
1114 |
*
|
1115 |
-
* @since
|
1116 |
*
|
1117 |
* @param string $key Meta key. Optional.
|
1118 |
* @param string $value Meta value. Optional.
|
@@ -1189,7 +1195,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
1189 |
* If you want to allow editing completed orders via this fitler, you will
|
1190 |
* be responsible for ensuring that the item stock is adjusted accordingly.
|
1191 |
*
|
1192 |
-
* @since
|
1193 |
*
|
1194 |
* @var bool $can_edit Whether this order can be edited
|
1195 |
* @var WPSC_Purchase_Log $log This log object
|
@@ -1242,7 +1248,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
1242 |
/**
|
1243 |
* Init the purchase log items for this purchase log.
|
1244 |
*
|
1245 |
-
* @since
|
1246 |
*
|
1247 |
* @return wpsc_purchaselogs_items|false The purhchase log item object or false.
|
1248 |
*/
|
@@ -1463,7 +1469,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
1463 |
/**
|
1464 |
* Returns base shipping should make a function to calculate items shipping as well
|
1465 |
*
|
1466 |
-
* @since
|
1467 |
*
|
1468 |
* @param boolean $numeric Return numeric value.
|
1469 |
*
|
@@ -1481,7 +1487,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
1481 |
/**
|
1482 |
* Returns base shipping should make a function to calculate items shipping as well
|
1483 |
*
|
1484 |
-
* @since
|
1485 |
*
|
1486 |
* @param boolean $numeric Return numeric value.
|
1487 |
* @param boolean $include_items Whether to calculate per-item-shipping.
|
@@ -1505,7 +1511,7 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
1505 |
/**
|
1506 |
* Returns taxes total.
|
1507 |
*
|
1508 |
-
* @since
|
1509 |
*
|
1510 |
* @param boolean $numeric Return numeric value.
|
1511 |
*
|
@@ -1521,11 +1527,38 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
1521 |
return $taxes;
|
1522 |
}
|
1523 |
|
1524 |
-
public function
|
1525 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1526 |
|
1527 |
-
|
1528 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1529 |
}
|
1530 |
|
1531 |
public function get_total_refunded() {
|
@@ -1538,4 +1571,49 @@ class WPSC_Purchase_Log extends WPSC_Query_Base {
|
|
1538 |
return $this->get( 'totalprice' ) - $this->get_total_refunded();
|
1539 |
}
|
1540 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1541 |
}
|
70 |
* into the database
|
71 |
*
|
72 |
* @static
|
73 |
+
* @since 3.11.5
|
74 |
* @var array
|
75 |
*/
|
76 |
private static $float_cols = array(
|
85 |
* Array of metadata
|
86 |
*
|
87 |
* @static
|
88 |
+
* @since 3.11.5
|
89 |
* @var array
|
90 |
*/
|
91 |
private static $metadata = array(
|
393 |
*
|
394 |
* @access public
|
395 |
* @static
|
396 |
+
* @since 3.11.5
|
397 |
*
|
398 |
* @return void
|
399 |
*/
|
435 |
*
|
436 |
* @access public
|
437 |
* @static
|
438 |
+
* @since 3.11.5
|
439 |
*
|
440 |
* @param string|null $value Optional (left for back-compatibility). The value which was queried.
|
441 |
* @param string|null $col Optional (left for back-compatibility). The column used as the identifier.
|
493 |
|
494 |
if ( $log_id > 0 ) {
|
495 |
|
496 |
+
do_action( 'wpsc_purchase_log_before_delete', $log_id, $this );
|
497 |
|
498 |
$this->delete_caches();
|
499 |
|
514 |
$wpdb->query( $wpdb->prepare( "DELETE FROM `" . WPSC_TABLE_PURCHASE_META . "` WHERE `wpsc_purchase_id` = %d", $log_id ) );
|
515 |
$wpdb->query( $wpdb->prepare( "DELETE FROM `" . WPSC_TABLE_DOWNLOAD_STATUS . "` WHERE `purchid` = %d ", $log_id ) );
|
516 |
|
517 |
+
do_action( 'wpsc_purchase_log_delete', $log_id, $this );
|
518 |
|
519 |
return true;
|
520 |
|
696 |
* Returns the value of the specified property of the $data array if it exists.
|
697 |
*
|
698 |
* @access public
|
699 |
+
* @since 3.11.5
|
700 |
*
|
701 |
* @param string $key Name of the property (column)
|
702 |
* @return mixed
|
703 |
*/
|
704 |
public function get( $key ) {
|
705 |
if ( 'notes' === $key ) {
|
706 |
+
_wpsc_doing_it_wrong( __FUNCTION__, __( 'Getting notes from the Log object has been deprecated in favor of the wpsc_get_order_notes() function.', 'wp-e-commerce' ), '3.11.5' );
|
707 |
}
|
708 |
|
709 |
return parent::get( $key );
|
713 |
* Prepares the return value for get() (apply_filters, etc).
|
714 |
*
|
715 |
* @access protected
|
716 |
+
* @since 3.11.5
|
717 |
*
|
718 |
* @param mixed $value Value fetched
|
719 |
* @param string $key Key for $data.
|
728 |
* Prepares the return value for get_data() (apply_filters, etc).
|
729 |
*
|
730 |
* @access protected
|
731 |
+
* @since 3.11.5
|
732 |
*
|
733 |
* @return mixed
|
734 |
*/
|
740 |
* Prepares the return value for get_meta() (apply_filters, etc).
|
741 |
*
|
742 |
* @access protected
|
743 |
+
* @since 3.11.5
|
744 |
*
|
745 |
* @return mixed
|
746 |
*/
|
749 |
}
|
750 |
|
751 |
public function get_cart_contents() {
|
752 |
+
_wpsc_doing_it_wrong( __FUNCTION__, __( 'This function has been deprecated in favor of the get_items() method.', 'wp-e-commerce' ), '3.11.5' );
|
753 |
return $this->get_items();
|
754 |
}
|
755 |
|
810 |
$item = $this->get_item( $item_id );
|
811 |
|
812 |
if ( $item ) {
|
813 |
+
do_action( 'wpsc_purchase_log_before_update_item', $item_id, $this );
|
814 |
|
815 |
$data = wp_unslash( $data );
|
816 |
$result = $wpdb->update( WPSC_TABLE_CART_CONTENTS, $data, array( 'id' => $item_id ) );
|
820 |
$this->log_items = array();
|
821 |
$this->get_item( $item_id );
|
822 |
|
823 |
+
do_action( 'wpsc_purchase_log_update_item', $item_id, $this );
|
824 |
}
|
825 |
|
826 |
return $result;
|
836 |
$item = $this->get_item( $item_id );
|
837 |
|
838 |
if ( $item ) {
|
839 |
+
do_action( 'wpsc_purchase_log_before_remove_item', $item_id, $this );
|
840 |
|
841 |
$result = $wpdb->delete( WPSC_TABLE_CART_CONTENTS, array( 'id' => $item_id ) );
|
842 |
|
845 |
unset( $this->log_items[ $this->log_item_ids[ $item_id ] ] );
|
846 |
unset( $this->log_item_ids[ $item_id ] );
|
847 |
|
848 |
+
do_action( 'wpsc_purchase_log_remove_item', $item_id, $this );
|
849 |
}
|
850 |
|
851 |
return $result;
|
1053 |
* Save meta data for purchase log, if any was set via set().
|
1054 |
*
|
1055 |
* @access public
|
1056 |
+
* @since 3.11.5
|
1057 |
*
|
1058 |
* @return WPSC_Purchase_Log The current object (for method chaining)
|
1059 |
*/
|
1063 |
$meta = $this->get_meta();
|
1064 |
|
1065 |
foreach ( $meta as $key => $value ) {
|
1066 |
+
|
1067 |
+
if ( 'notes' === $key ) {
|
1068 |
+
wpsc_get_order_notes( $this )->save();
|
1069 |
+
continue;
|
1070 |
+
}
|
1071 |
+
|
1072 |
$is_multiple_meta = isset( self::$multiple_meta[ $key ] );
|
1073 |
|
1074 |
if ( $is_multiple_meta ) {
|
1118 |
/**
|
1119 |
* Adds ability to retrieve a purchase log by a meta key or value.
|
1120 |
*
|
1121 |
+
* @since 3.11.5
|
1122 |
*
|
1123 |
* @param string $key Meta key. Optional.
|
1124 |
* @param string $value Meta value. Optional.
|
1195 |
* If you want to allow editing completed orders via this fitler, you will
|
1196 |
* be responsible for ensuring that the item stock is adjusted accordingly.
|
1197 |
*
|
1198 |
+
* @since 3.11.5
|
1199 |
*
|
1200 |
* @var bool $can_edit Whether this order can be edited
|
1201 |
* @var WPSC_Purchase_Log $log This log object
|
1248 |
/**
|
1249 |
* Init the purchase log items for this purchase log.
|
1250 |
*
|
1251 |
+
* @since 3.11.5
|
1252 |
*
|
1253 |
* @return wpsc_purchaselogs_items|false The purhchase log item object or false.
|
1254 |
*/
|
1469 |
/**
|
1470 |
* Returns base shipping should make a function to calculate items shipping as well
|
1471 |
*
|
1472 |
+
* @since 3.11.5
|
1473 |
*
|
1474 |
* @param boolean $numeric Return numeric value.
|
1475 |
*
|
1487 |
/**
|
1488 |
* Returns base shipping should make a function to calculate items shipping as well
|
1489 |
*
|
1490 |
+
* @since 3.11.5
|
1491 |
*
|
1492 |
* @param boolean $numeric Return numeric value.
|
1493 |
* @param boolean $include_items Whether to calculate per-item-shipping.
|
1511 |
/**
|
1512 |
* Returns taxes total.
|
1513 |
*
|
1514 |
+
* @since 3.11.5
|
1515 |
*
|
1516 |
* @param boolean $numeric Return numeric value.
|
1517 |
*
|
1527 |
return $taxes;
|
1528 |
}
|
1529 |
|
1530 |
+
public function get_subtotal() {
|
1531 |
+
$subtotal = 0;
|
1532 |
+
|
1533 |
+
foreach ( $this->get_items() as $item ) {
|
1534 |
+
$subtotal += ( $item->price * $item->quantity );
|
1535 |
+
$subtotal += ( $item->pnp );
|
1536 |
+
}
|
1537 |
+
|
1538 |
+
return $subtotal;
|
1539 |
+
}
|
1540 |
+
|
1541 |
+
/**
|
1542 |
+
* Get total price.
|
1543 |
+
*
|
1544 |
+
* @since 3.11.7
|
1545 |
+
*
|
1546 |
+
* @return float Price.
|
1547 |
+
*/
|
1548 |
+
public function get_total() {
|
1549 |
+
return $this->get_subtotal() - $this->discount( true ) + $this->shipping( true ) + $this->taxes( true );
|
1550 |
+
}
|
1551 |
|
1552 |
+
/**
|
1553 |
+
* Get total price display.
|
1554 |
+
*
|
1555 |
+
* @param array $args Args for wpsc_currency_display().
|
1556 |
+
*
|
1557 |
+
* @return mixed Price.
|
1558 |
+
*/
|
1559 |
+
public function total_price( $args = array() ) {
|
1560 |
+
$args = wp_parse_args( $args, array( 'display_as_html' => false ) );
|
1561 |
+
return wpsc_currency_display( $this->get_total(), $args );
|
1562 |
}
|
1563 |
|
1564 |
public function get_total_refunded() {
|
1571 |
return $this->get( 'totalprice' ) - $this->get_total_refunded();
|
1572 |
}
|
1573 |
|
1574 |
+
/**
|
1575 |
+
* Add a purchase log note.
|
1576 |
+
*
|
1577 |
+
* @since 3.12.0
|
1578 |
+
*
|
1579 |
+
* @param mixed $note_text String to add note. Optionally Accepts an array to specify note attributes: {
|
1580 |
+
* @type string $type The note type. Defaults to 'default', but can be 'error'.
|
1581 |
+
* @type string $status The note status. Defaults to 'public'.
|
1582 |
+
* @type int $time The note timestamp. Defaults to time().
|
1583 |
+
* @type string $content The note text.
|
1584 |
+
* }
|
1585 |
+
*
|
1586 |
+
* @return WPSC_Purchase_Log The current object (for method chaining)
|
1587 |
+
*/
|
1588 |
+
public function add_note( $note_text ) {
|
1589 |
+
static $notes = null;
|
1590 |
+
|
1591 |
+
if ( ! ( $notes instanceof WPSC_Purchase_Log_Notes ) ) {
|
1592 |
+
$notes = wpsc_get_order_notes( $this );
|
1593 |
+
}
|
1594 |
+
|
1595 |
+
$notes->add( $note_text )->save();
|
1596 |
+
|
1597 |
+
return $this;
|
1598 |
+
}
|
1599 |
+
|
1600 |
+
/**
|
1601 |
+
* Add a purchase log refund note.
|
1602 |
+
*
|
1603 |
+
* @since 3.12.0
|
1604 |
+
*
|
1605 |
+
* @param mixed $note_text String to add refund note.
|
1606 |
+
* @param string $reason_for_refund Optional reason for refund. Will display on a new line from default text.
|
1607 |
+
*
|
1608 |
+
* @return WPSC_Purchase_Log The current object (for method chaining)
|
1609 |
+
*/
|
1610 |
+
public function add_refund_note( $note_text, $reason_for_refund = '' ) {
|
1611 |
+
|
1612 |
+
if ( ! empty( $reason_for_refund ) ) {
|
1613 |
+
$note_text .= sprintf( __( "\nReason: %s", 'wp-e-commerce' ), $reason_for_refund );
|
1614 |
+
}
|
1615 |
+
|
1616 |
+
return $this->add_note( $note_text );
|
1617 |
+
}
|
1618 |
+
|
1619 |
}
|
wpsc-includes/purchase-log.helpers.php
CHANGED
@@ -1,4 +1,45 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
function wpsc_get_plaintext_table( $headings, $rows ) {
|
3 |
$colwidths = array();
|
4 |
$output = array();
|
@@ -46,33 +87,34 @@ function wpsc_get_plaintext_table( $headings, $rows ) {
|
|
46 |
return implode( "\r\n", $output ) . "\r\n";
|
47 |
}
|
48 |
|
49 |
-
function wpsc_update_purchase_log_status( $
|
50 |
-
|
51 |
|
52 |
-
$
|
|
|
53 |
|
54 |
-
|
55 |
-
$purchase_log->set( 'processed', $new_status );
|
56 |
-
return $purchase_log->save();
|
57 |
}
|
58 |
|
59 |
-
function wpsc_update_purchase_log_details( $
|
|
|
|
|
60 |
|
61 |
-
$
|
62 |
-
$purchase_log->set( $details );
|
63 |
-
return $purchase_log->save();
|
64 |
}
|
65 |
|
66 |
function wpsc_get_downloadable_links( $purchase_log ) {
|
67 |
-
if ( ! $purchase_log->is_transaction_completed() )
|
68 |
return array();
|
|
|
69 |
|
70 |
$cart_contents = $purchase_log->get_items();
|
71 |
$links = array();
|
72 |
foreach ( $cart_contents as $item ) {
|
73 |
$item_links = _wpsc_get_cart_item_downloadable_links( $item, $purchase_log );
|
74 |
-
if ( empty( $item_links ) )
|
75 |
continue;
|
|
|
76 |
$links[$item->name] = $item_links;
|
77 |
}
|
78 |
|
@@ -152,7 +194,7 @@ function _wpsc_process_transaction_coupon( $purchase_log ) {
|
|
152 |
global $wpdb;
|
153 |
|
154 |
if ( ! is_object( $purchase_log ) )
|
155 |
-
$purchase_log =
|
156 |
|
157 |
$discount_data = $purchase_log->get( 'discount_data' );
|
158 |
if ( ! empty( $discount_data ) ) {
|
@@ -170,7 +212,7 @@ function _wpsc_process_transaction_coupon( $purchase_log ) {
|
|
170 |
* Currently, only used to send customer and admin emails upon successful purchase.
|
171 |
*
|
172 |
* @since 3.8.9
|
173 |
-
* @since
|
174 |
* of those functions when desiring to override.
|
175 |
*
|
176 |
* @param int $id Purchase Log ID.
|
@@ -192,7 +234,7 @@ add_action( 'wpsc_update_purchase_log_status', '_wpsc_action_update_purchase_log
|
|
192 |
/**
|
193 |
* Routine that runs when updating a purchase log's status, used to update status of coupon's used.
|
194 |
*
|
195 |
-
* @since
|
196 |
*
|
197 |
* @param int $id Purchase Log ID.
|
198 |
* @param int $status Current status.
|
@@ -228,7 +270,7 @@ add_action( 'wpsc_update_purchase_log_status', '_wpsc_update_purchase_log_coupon
|
|
228 |
/**
|
229 |
* Routine that runs when updating a purchase log's status, used to update status of inventory.
|
230 |
*
|
231 |
-
* @since
|
232 |
*
|
233 |
* @param int $id Purchase Log ID.
|
234 |
* @param int $status Current status.
|
@@ -264,7 +306,7 @@ add_action( 'wpsc_update_purchase_log_status', '_wpsc_update_purchase_log_stock_
|
|
264 |
|
265 |
function wpsc_send_customer_email( $purchase_log ) {
|
266 |
if ( ! is_object( $purchase_log ) ) {
|
267 |
-
$purchase_log =
|
268 |
}
|
269 |
|
270 |
if ( ! $purchase_log->is_transaction_completed() && ! $purchase_log->is_order_received() ) {
|
@@ -281,7 +323,7 @@ function wpsc_send_customer_email( $purchase_log ) {
|
|
281 |
function wpsc_send_admin_email( $purchase_log, $force = false ) {
|
282 |
|
283 |
if ( ! is_object( $purchase_log ) ) {
|
284 |
-
$purchase_log =
|
285 |
}
|
286 |
|
287 |
if ( $purchase_log->get( 'email_sent' ) && ! $force ) {
|
@@ -303,7 +345,7 @@ function wpsc_send_admin_email( $purchase_log, $force = false ) {
|
|
303 |
function wpsc_get_transaction_html_output( $purchase_log ) {
|
304 |
|
305 |
if ( ! is_object( $purchase_log ) ) {
|
306 |
-
$purchase_log =
|
307 |
}
|
308 |
|
309 |
$notification = new WPSC_Purchase_Log_Customer_HTML_Notification( $purchase_log );
|
@@ -322,22 +364,24 @@ function wpsc_get_transaction_html_output( $purchase_log ) {
|
|
322 |
return $output;
|
323 |
}
|
324 |
|
325 |
-
|
326 |
-
|
327 |
-
*
|
328 |
-
* @param int $order_id Order ID.
|
329 |
-
* @since 4.0
|
330 |
-
*/
|
331 |
-
function wpsc_get_order( $order_id ) {
|
332 |
-
return new WPSC_Purchase_Log( $order_id );
|
333 |
}
|
|
|
334 |
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
|
|
|
|
|
|
|
|
|
|
343 |
}
|
|
|
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Returns a purchase log.
|
5 |
+
*
|
6 |
+
* @since 3.11.5
|
7 |
+
*
|
8 |
+
* @param int $order_id Order ID.
|
9 |
+
*
|
10 |
+
* @return WPSC_Purchase_Log
|
11 |
+
*/
|
12 |
+
function wpsc_get_order( $order_id, $by = 'id' ) {
|
13 |
+
$order = wpsc_is_order( $order_id );
|
14 |
+
return $order ? $order : new WPSC_Purchase_Log( $order_id, $by );
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Determines if object is a an order (WPSC_Purchase_Log).
|
19 |
+
*
|
20 |
+
* @since 3.12.0
|
21 |
+
*
|
22 |
+
* @param mixed $order Object to check
|
23 |
+
*
|
24 |
+
* @return WPSC_Purchase_Log|bool
|
25 |
+
*/
|
26 |
+
function wpsc_is_order( $order ) {
|
27 |
+
return $order instanceof WPSC_Purchase_Log ? $order : false;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Returns a purchase log's notes object.
|
32 |
+
*
|
33 |
+
* @since 3.11.5
|
34 |
+
*
|
35 |
+
* @param int $order_id Order ID or WPSC_Purchase_Log object.
|
36 |
+
*
|
37 |
+
* @return WPSC_Purchase_Log
|
38 |
+
*/
|
39 |
+
function wpsc_get_order_notes( $order_id ) {
|
40 |
+
return new WPSC_Purchase_Log_Notes( $order_id );
|
41 |
+
}
|
42 |
+
|
43 |
function wpsc_get_plaintext_table( $headings, $rows ) {
|
44 |
$colwidths = array();
|
45 |
$output = array();
|
87 |
return implode( "\r\n", $output ) . "\r\n";
|
88 |
}
|
89 |
|
90 |
+
function wpsc_update_purchase_log_status( $log_id, $new_status, $by = 'id' ) {
|
91 |
+
$log = wpsc_get_order( $log_id, $by );
|
92 |
|
93 |
+
$old_status = $log->get( 'processed' );
|
94 |
+
$log->set( 'processed', $new_status );
|
95 |
|
96 |
+
return $log->save();
|
|
|
|
|
97 |
}
|
98 |
|
99 |
+
function wpsc_update_purchase_log_details( $log_id, $details, $by = 'id' ) {
|
100 |
+
$log = wpsc_get_order( $log_id, $by );
|
101 |
+
$log->set( $details );
|
102 |
|
103 |
+
return $log->save();
|
|
|
|
|
104 |
}
|
105 |
|
106 |
function wpsc_get_downloadable_links( $purchase_log ) {
|
107 |
+
if ( ! $purchase_log->is_transaction_completed() ) {
|
108 |
return array();
|
109 |
+
}
|
110 |
|
111 |
$cart_contents = $purchase_log->get_items();
|
112 |
$links = array();
|
113 |
foreach ( $cart_contents as $item ) {
|
114 |
$item_links = _wpsc_get_cart_item_downloadable_links( $item, $purchase_log );
|
115 |
+
if ( empty( $item_links ) ) {
|
116 |
continue;
|
117 |
+
}
|
118 |
$links[$item->name] = $item_links;
|
119 |
}
|
120 |
|
194 |
global $wpdb;
|
195 |
|
196 |
if ( ! is_object( $purchase_log ) )
|
197 |
+
$purchase_log = wpsc_get_order( $purchase_log );
|
198 |
|
199 |
$discount_data = $purchase_log->get( 'discount_data' );
|
200 |
if ( ! empty( $discount_data ) ) {
|
212 |
* Currently, only used to send customer and admin emails upon successful purchase.
|
213 |
*
|
214 |
* @since 3.8.9
|
215 |
+
* @since 3.11.5 Removed coupons and stocks from email sending. Much easier now to remove_action() on either
|
216 |
* of those functions when desiring to override.
|
217 |
*
|
218 |
* @param int $id Purchase Log ID.
|
234 |
/**
|
235 |
* Routine that runs when updating a purchase log's status, used to update status of coupon's used.
|
236 |
*
|
237 |
+
* @since 3.11.5
|
238 |
*
|
239 |
* @param int $id Purchase Log ID.
|
240 |
* @param int $status Current status.
|
270 |
/**
|
271 |
* Routine that runs when updating a purchase log's status, used to update status of inventory.
|
272 |
*
|
273 |
+
* @since 3.11.5
|
274 |
*
|
275 |
* @param int $id Purchase Log ID.
|
276 |
* @param int $status Current status.
|
306 |
|
307 |
function wpsc_send_customer_email( $purchase_log ) {
|
308 |
if ( ! is_object( $purchase_log ) ) {
|
309 |
+
$purchase_log = wpsc_get_order( $purchase_log );
|
310 |
}
|
311 |
|
312 |
if ( ! $purchase_log->is_transaction_completed() && ! $purchase_log->is_order_received() ) {
|
323 |
function wpsc_send_admin_email( $purchase_log, $force = false ) {
|
324 |
|
325 |
if ( ! is_object( $purchase_log ) ) {
|
326 |
+
$purchase_log = wpsc_get_order( $purchase_log );
|
327 |
}
|
328 |
|
329 |
if ( $purchase_log->get( 'email_sent' ) && ! $force ) {
|
345 |
function wpsc_get_transaction_html_output( $purchase_log ) {
|
346 |
|
347 |
if ( ! is_object( $purchase_log ) ) {
|
348 |
+
$purchase_log = wpsc_get_order( $purchase_log );
|
349 |
}
|
350 |
|
351 |
$notification = new WPSC_Purchase_Log_Customer_HTML_Notification( $purchase_log );
|
364 |
return $output;
|
365 |
}
|
366 |
|
367 |
+
function _wpsc_update_log_total_with_item_update( $item_id, $purchase_log ) {
|
368 |
+
$purchase_log->set( 'totalprice', $purchase_log->get_total() )->save();
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
}
|
370 |
+
add_action( 'wpsc_purchase_log_update_item', '_wpsc_update_log_total_with_item_update', 10, 2 );
|
371 |
|
372 |
+
|
373 |
+
function wpsc_update_order_status_partially_refunded( $log ) {
|
374 |
+
if ( WPSC_Purchase_Log::PARTIALLY_REFUNDED !== $log->get( 'processed' ) ) {
|
375 |
+
wpsc_update_purchase_log_status( $log, WPSC_Purchase_Log::PARTIALLY_REFUNDED );
|
376 |
+
}
|
377 |
+
}
|
378 |
+
|
379 |
+
add_action( 'wpsc_order_partially_refunded', 'wpsc_update_order_status_partially_refunded' );
|
380 |
+
|
381 |
+
function wpsc_update_order_status_fully_refunded( $log ) {
|
382 |
+
if ( WPSC_Purchase_Log::REFUNDED !== $log->get( 'processed' ) ) {
|
383 |
+
wpsc_update_purchase_log_status( $log, WPSC_Purchase_Log::REFUNDED );
|
384 |
+
}
|
385 |
}
|
386 |
+
|
387 |
+
add_action( 'wpsc_order_fully_refunded', 'wpsc_update_order_status_fully_refunded' );
|
wpsc-includes/purchaselogs.functions.php
CHANGED
@@ -456,7 +456,7 @@ function wpsc_display_purchlog_buyers_email() {
|
|
456 |
|
457 |
function wpsc_display_purchlog_buyers_address() {
|
458 |
global $purchlogitem;
|
459 |
-
return
|
460 |
}
|
461 |
|
462 |
function wpsc_display_purchlog_buyers_state_and_postcode() {
|
@@ -481,7 +481,7 @@ function wpsc_display_purchlog_shipping_name() {
|
|
481 |
|
482 |
function wpsc_display_purchlog_shipping_address() {
|
483 |
global $purchlogitem;
|
484 |
-
return
|
485 |
}
|
486 |
|
487 |
function wpsc_display_purchlog_shipping_city() {
|
456 |
|
457 |
function wpsc_display_purchlog_buyers_address() {
|
458 |
global $purchlogitem;
|
459 |
+
return wp_kses_post( $purchlogitem->log()->buyers_address() );
|
460 |
}
|
461 |
|
462 |
function wpsc_display_purchlog_buyers_state_and_postcode() {
|
481 |
|
482 |
function wpsc_display_purchlog_shipping_address() {
|
483 |
global $purchlogitem;
|
484 |
+
return wp_kses_post( $purchlogitem->log()->shipping_address() );
|
485 |
}
|
486 |
|
487 |
function wpsc_display_purchlog_shipping_city() {
|
wpsc-includes/query-base.class.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* The WP eCommerce Base Query Class
|
4 |
*
|
5 |
* @package wp-e-commerce
|
6 |
-
* @since
|
7 |
*/
|
8 |
|
9 |
abstract class WPSC_Query_Base {
|
@@ -41,7 +41,7 @@ abstract class WPSC_Query_Base {
|
|
41 |
* Contains the values fetched from the DB
|
42 |
*
|
43 |
* @access protected
|
44 |
-
* @since
|
45 |
*
|
46 |
* @var array
|
47 |
*/
|
@@ -51,7 +51,7 @@ abstract class WPSC_Query_Base {
|
|
51 |
* Data that is not directly stored inside the DB but is inferred. Optional.
|
52 |
*
|
53 |
* @access protected
|
54 |
-
* @since
|
55 |
*/
|
56 |
protected $meta_data = array();
|
57 |
|
@@ -59,7 +59,7 @@ abstract class WPSC_Query_Base {
|
|
59 |
* True if the DB row is fetched into the $data array.
|
60 |
*
|
61 |
* @access protected
|
62 |
-
* @since
|
63 |
*
|
64 |
* @var boolean
|
65 |
*/
|
@@ -69,7 +69,7 @@ abstract class WPSC_Query_Base {
|
|
69 |
* True if the row exists in DB
|
70 |
*
|
71 |
* @access protected
|
72 |
-
* @since
|
73 |
*
|
74 |
* @var boolean
|
75 |
*/
|
@@ -81,7 +81,7 @@ abstract class WPSC_Query_Base {
|
|
81 |
* Should return $this;
|
82 |
*
|
83 |
* @access protected
|
84 |
-
* @since
|
85 |
*
|
86 |
* @return WPSC_Query_Base
|
87 |
*/
|
@@ -91,7 +91,7 @@ abstract class WPSC_Query_Base {
|
|
91 |
* Whether the DB row for this purchase log exists
|
92 |
*
|
93 |
* @access public
|
94 |
-
* @since
|
95 |
*
|
96 |
* @return bool True if it exists. Otherwise false.
|
97 |
*/
|
@@ -103,7 +103,7 @@ abstract class WPSC_Query_Base {
|
|
103 |
/**
|
104 |
* Resets properties so any subsequent requests will be refreshed.
|
105 |
*
|
106 |
-
* @since
|
107 |
*
|
108 |
* @return void
|
109 |
*/
|
@@ -117,7 +117,7 @@ abstract class WPSC_Query_Base {
|
|
117 |
* Returns the value of the specified property of the $data array if it exists.
|
118 |
*
|
119 |
* @access public
|
120 |
-
* @since
|
121 |
*
|
122 |
* @param string $key Name of the property (column)
|
123 |
* @return mixed
|
@@ -144,7 +144,7 @@ abstract class WPSC_Query_Base {
|
|
144 |
* Prepares the return value for get() (apply_filters, etc).
|
145 |
*
|
146 |
* @access protected
|
147 |
-
* @since
|
148 |
*
|
149 |
* @param mixed $value Value fetched
|
150 |
* @param string $key Key for $data.
|
@@ -157,7 +157,7 @@ abstract class WPSC_Query_Base {
|
|
157 |
* Returns the entire $data array.
|
158 |
*
|
159 |
* @access public
|
160 |
-
* @since
|
161 |
*
|
162 |
* @return array
|
163 |
*/
|
@@ -173,7 +173,7 @@ abstract class WPSC_Query_Base {
|
|
173 |
* Prepares the return value for get_data() (apply_filters, etc).
|
174 |
*
|
175 |
* @access protected
|
176 |
-
* @since
|
177 |
*
|
178 |
* @return mixed
|
179 |
*/
|
@@ -183,7 +183,7 @@ abstract class WPSC_Query_Base {
|
|
183 |
* Returns the entire $meta_data array.
|
184 |
*
|
185 |
* @access public
|
186 |
-
* @since
|
187 |
*
|
188 |
* @return array
|
189 |
*/
|
@@ -201,7 +201,7 @@ abstract class WPSC_Query_Base {
|
|
201 |
* Prepares the return value for get_meta() (apply_filters, etc).
|
202 |
*
|
203 |
* @access protected
|
204 |
-
* @since
|
205 |
*
|
206 |
* @return mixed
|
207 |
*/
|
@@ -214,7 +214,7 @@ abstract class WPSC_Query_Base {
|
|
214 |
* as arguments, or an associative array containing key value pairs.
|
215 |
*
|
216 |
* @access public
|
217 |
-
* @since
|
218 |
*
|
219 |
* @param mixed $key Name of the property (column), or an array containing
|
220 |
* key value pairs
|
@@ -228,7 +228,7 @@ abstract class WPSC_Query_Base {
|
|
228 |
* Saves the object back to the database.
|
229 |
*
|
230 |
* @access public
|
231 |
-
* @since
|
232 |
*
|
233 |
* @return mixed
|
234 |
*/
|
@@ -239,7 +239,7 @@ abstract class WPSC_Query_Base {
|
|
239 |
* and a value as arguments, or an associative array containing key value pairs.
|
240 |
*
|
241 |
* @access public
|
242 |
-
* @since
|
243 |
*
|
244 |
* @param mixed $key Name of the property (column), or an array containing
|
245 |
* key value pairs
|
@@ -269,7 +269,7 @@ abstract class WPSC_Query_Base {
|
|
269 |
* Saves the meta data back to the database.
|
270 |
*
|
271 |
* @access public
|
272 |
-
* @since
|
273 |
*
|
274 |
* @return WPSC_Query_Base The current object (for method chaining)
|
275 |
*/
|
@@ -281,7 +281,7 @@ abstract class WPSC_Query_Base {
|
|
281 |
* Wrapper for wp_cache_get.
|
282 |
*
|
283 |
* @access public
|
284 |
-
* @since
|
285 |
*
|
286 |
* @see wp_cache_get()
|
287 |
*
|
@@ -300,7 +300,7 @@ abstract class WPSC_Query_Base {
|
|
300 |
* Wrapper for wp_cache_set.
|
301 |
*
|
302 |
* @access public
|
303 |
-
* @since
|
304 |
*
|
305 |
* @see wp_cache_set()
|
306 |
*
|
@@ -320,7 +320,7 @@ abstract class WPSC_Query_Base {
|
|
320 |
* Wrapper for wp_cache_delete.
|
321 |
*
|
322 |
* @access public
|
323 |
-
* @since
|
324 |
*
|
325 |
* @see wp_cache_delete()
|
326 |
*
|
@@ -336,7 +336,7 @@ abstract class WPSC_Query_Base {
|
|
336 |
/**
|
337 |
* Get the versioned group id from the $group_ids array.
|
338 |
*
|
339 |
-
* @since
|
340 |
*
|
341 |
* @param string $group_id The key for the group_ids array to compile the group
|
342 |
* from version/key.
|
3 |
* The WP eCommerce Base Query Class
|
4 |
*
|
5 |
* @package wp-e-commerce
|
6 |
+
* @since 3.11.5
|
7 |
*/
|
8 |
|
9 |
abstract class WPSC_Query_Base {
|
41 |
* Contains the values fetched from the DB
|
42 |
*
|
43 |
* @access protected
|
44 |
+
* @since 3.11.5
|
45 |
*
|
46 |
* @var array
|
47 |
*/
|
51 |
* Data that is not directly stored inside the DB but is inferred. Optional.
|
52 |
*
|
53 |
* @access protected
|
54 |
+
* @since 3.11.5
|
55 |
*/
|
56 |
protected $meta_data = array();
|
57 |
|
59 |
* True if the DB row is fetched into the $data array.
|
60 |
*
|
61 |
* @access protected
|
62 |
+
* @since 3.11.5
|
63 |
*
|
64 |
* @var boolean
|
65 |
*/
|
69 |
* True if the row exists in DB
|
70 |
*
|
71 |
* @access protected
|
72 |
+
* @since 3.11.5
|
73 |
*
|
74 |
* @var boolean
|
75 |
*/
|
81 |
* Should return $this;
|
82 |
*
|
83 |
* @access protected
|
84 |
+
* @since 3.11.5
|
85 |
*
|
86 |
* @return WPSC_Query_Base
|
87 |
*/
|
91 |
* Whether the DB row for this purchase log exists
|
92 |
*
|
93 |
* @access public
|
94 |
+
* @since 3.11.5
|
95 |
*
|
96 |
* @return bool True if it exists. Otherwise false.
|
97 |
*/
|
103 |
/**
|
104 |
* Resets properties so any subsequent requests will be refreshed.
|
105 |
*
|
106 |
+
* @since 3.11.5
|
107 |
*
|
108 |
* @return void
|
109 |
*/
|
117 |
* Returns the value of the specified property of the $data array if it exists.
|
118 |
*
|
119 |
* @access public
|
120 |
+
* @since 3.11.5
|
121 |
*
|
122 |
* @param string $key Name of the property (column)
|
123 |
* @return mixed
|
144 |
* Prepares the return value for get() (apply_filters, etc).
|
145 |
*
|
146 |
* @access protected
|
147 |
+
* @since 3.11.5
|
148 |
*
|
149 |
* @param mixed $value Value fetched
|
150 |
* @param string $key Key for $data.
|
157 |
* Returns the entire $data array.
|
158 |
*
|
159 |
* @access public
|
160 |
+
* @since 3.11.5
|
161 |
*
|
162 |
* @return array
|
163 |
*/
|
173 |
* Prepares the return value for get_data() (apply_filters, etc).
|
174 |
*
|
175 |
* @access protected
|
176 |
+
* @since 3.11.5
|
177 |
*
|
178 |
* @return mixed
|
179 |
*/
|
183 |
* Returns the entire $meta_data array.
|
184 |
*
|
185 |
* @access public
|
186 |
+
* @since 3.11.5
|
187 |
*
|
188 |
* @return array
|
189 |
*/
|
201 |
* Prepares the return value for get_meta() (apply_filters, etc).
|
202 |
*
|
203 |
* @access protected
|
204 |
+
* @since 3.11.5
|
205 |
*
|
206 |
* @return mixed
|
207 |
*/
|
214 |
* as arguments, or an associative array containing key value pairs.
|
215 |
*
|
216 |
* @access public
|
217 |
+
* @since 3.11.5
|
218 |
*
|
219 |
* @param mixed $key Name of the property (column), or an array containing
|
220 |
* key value pairs
|
228 |
* Saves the object back to the database.
|
229 |
*
|
230 |
* @access public
|
231 |
+
* @since 3.11.5
|
232 |
*
|
233 |
* @return mixed
|
234 |
*/
|
239 |
* and a value as arguments, or an associative array containing key value pairs.
|
240 |
*
|
241 |
* @access public
|
242 |
+
* @since 3.11.5
|
243 |
*
|
244 |
* @param mixed $key Name of the property (column), or an array containing
|
245 |
* key value pairs
|
269 |
* Saves the meta data back to the database.
|
270 |
*
|
271 |
* @access public
|
272 |
+
* @since 3.11.5
|
273 |
*
|
274 |
* @return WPSC_Query_Base The current object (for method chaining)
|
275 |
*/
|
281 |
* Wrapper for wp_cache_get.
|
282 |
*
|
283 |
* @access public
|
284 |
+
* @since 3.11.5
|
285 |
*
|
286 |
* @see wp_cache_get()
|
287 |
*
|
300 |
* Wrapper for wp_cache_set.
|
301 |
*
|
302 |
* @access public
|
303 |
+
* @since 3.11.5
|
304 |
*
|
305 |
* @see wp_cache_set()
|
306 |
*
|
320 |
* Wrapper for wp_cache_delete.
|
321 |
*
|
322 |
* @access public
|
323 |
+
* @since 3.11.5
|
324 |
*
|
325 |
* @see wp_cache_delete()
|
326 |
*
|
336 |
/**
|
337 |
* Get the versioned group id from the $group_ids array.
|
338 |
*
|
339 |
+
* @since 3.11.5
|
340 |
*
|
341 |
* @param string $group_id The key for the group_ids array to compile the group
|
342 |
* from version/key.
|
wpsc-includes/shopping_cart_functions.php
CHANGED
@@ -320,7 +320,7 @@ function wpsc_checkout_billing_state_and_region( $wpsc_checkout = null ) {
|
|
320 |
. ' placeholder="'. esc_attr( $placeholder ) . '" '
|
321 |
. ' value="' . esc_attr( $billing_state ) . '" '
|
322 |
. $style
|
323 |
-
. '
|
324 |
|
325 |
// setup the drop down field, aka 'billingregion'
|
326 |
// move the checkout item pointer to the billing country, so we
|
320 |
. ' placeholder="'. esc_attr( $placeholder ) . '" '
|
321 |
. ' value="' . esc_attr( $billing_state ) . '" '
|
322 |
. $style
|
323 |
+
. ' />';
|
324 |
|
325 |
// setup the drop down field, aka 'billingregion'
|
326 |
// move the checkout item pointer to the billing country, so we
|
wpsc-includes/variations.class.php
CHANGED
@@ -314,7 +314,7 @@ function wpsc_get_child_object_in_terms_var( $parent_id, $terms, $taxonomies, $a
|
|
314 |
* Here the keys are captured when someone clicks the 'add to cart' button and correspond with ... whatever. They don't really matter for our function.
|
315 |
* Really you could pass an array of 2 term_ids here and a $product_id that has variations to match those terms and you'd get back the expected array.
|
316 |
*
|
317 |
-
* @since
|
318 |
*
|
319 |
* @param array $variations required The array of variation selections
|
320 |
* @param int $product_id required The default product_id
|
@@ -357,7 +357,7 @@ function wpsc_get_product_data_from_variations( $variations, $product_id ) {
|
|
357 |
*
|
358 |
* See wpsc_get_product_data_from_variations for a full description on what needs to be passed in the $variations params
|
359 |
*
|
360 |
-
* @since
|
361 |
*
|
362 |
* @uses wpsc_get_product_data_from_variations() Returns array of data pertaining to product variations
|
363 |
* @return int $product_id The product_id corresponding to the selected variation
|
@@ -369,7 +369,7 @@ function wpsc_get_product_id_from_variations( $variations, $product_id ){
|
|
369 |
/**
|
370 |
* Allows users to filter the product_id based on the variation selections
|
371 |
*
|
372 |
-
* @since
|
373 |
*
|
374 |
* @param int $$values['product_id'] The variation product_id
|
375 |
* @param array $variations The variation selections passed to the core function
|
@@ -390,7 +390,7 @@ function wpsc_get_product_id_from_variations( $variations, $product_id ){
|
|
390 |
*
|
391 |
* See wpsc_get_product_data_from_variations for a full description on what needs to be passed in the $variations params
|
392 |
*
|
393 |
-
* @since
|
394 |
*
|
395 |
* @uses wpsc_get_product_data_from_variations() Returns array of data pertaining to product variations
|
396 |
* @return array $variation_values The variation values for the selected variation terms, so the term_ids as the array $values
|
@@ -402,7 +402,7 @@ function wpsc_get_variation_values_from_variations( $variations, $product_id ){
|
|
402 |
/**
|
403 |
* Allows users to filter the variation values based on the variation selections
|
404 |
*
|
405 |
-
* @since
|
406 |
*
|
407 |
* @param array $variations The variation selections passed to the core function
|
408 |
* @param int $product_id The default passed product_id
|
314 |
* Here the keys are captured when someone clicks the 'add to cart' button and correspond with ... whatever. They don't really matter for our function.
|
315 |
* Really you could pass an array of 2 term_ids here and a $product_id that has variations to match those terms and you'd get back the expected array.
|
316 |
*
|
317 |
+
* @since 3.11.0
|
318 |
*
|
319 |
* @param array $variations required The array of variation selections
|
320 |
* @param int $product_id required The default product_id
|
357 |
*
|
358 |
* See wpsc_get_product_data_from_variations for a full description on what needs to be passed in the $variations params
|
359 |
*
|
360 |
+
* @since 3.11.0
|
361 |
*
|
362 |
* @uses wpsc_get_product_data_from_variations() Returns array of data pertaining to product variations
|
363 |
* @return int $product_id The product_id corresponding to the selected variation
|
369 |
/**
|
370 |
* Allows users to filter the product_id based on the variation selections
|
371 |
*
|
372 |
+
* @since 3.11.0
|
373 |
*
|
374 |
* @param int $$values['product_id'] The variation product_id
|
375 |
* @param array $variations The variation selections passed to the core function
|
390 |
*
|
391 |
* See wpsc_get_product_data_from_variations for a full description on what needs to be passed in the $variations params
|
392 |
*
|
393 |
+
* @since 3.11.0
|
394 |
*
|
395 |
* @uses wpsc_get_product_data_from_variations() Returns array of data pertaining to product variations
|
396 |
* @return array $variation_values The variation values for the selected variation terms, so the term_ids as the array $values
|
402 |
/**
|
403 |
* Allows users to filter the variation values based on the variation selections
|
404 |
*
|
405 |
+
* @since 3.11.0
|
406 |
*
|
407 |
* @param array $variations The variation selections passed to the core function
|
408 |
* @param int $product_id The default passed product_id
|
wpsc-includes/wp-cli/wpsc-wp-cli-category.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* Commands for working with WP e-Commerce product categories.
|
5 |
*
|
6 |
-
* @since
|
7 |
*
|
8 |
* @todo This is fairly generic, and doesn't support WP e-Commerce specific category values such as:
|
9 |
* * Category images
|
3 |
/**
|
4 |
* Commands for working with WP e-Commerce product categories.
|
5 |
*
|
6 |
+
* @since 3.11.5
|
7 |
*
|
8 |
* @todo This is fairly generic, and doesn't support WP e-Commerce specific category values such as:
|
9 |
* * Category images
|
wpsc-includes/wp-cli/wpsc-wp-cli-product-tag.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* Commands for working with WP e-Commerce product tags.
|
5 |
*
|
6 |
-
* @since
|
7 |
*
|
8 |
* @todo This is fairly generic, and doesn't support WP e-Commerce specific category values such as:
|
9 |
* * Category images
|
3 |
/**
|
4 |
* Commands for working with WP e-Commerce product tags.
|
5 |
*
|
6 |
+
* @since 3.11.5
|
7 |
*
|
8 |
* @todo This is fairly generic, and doesn't support WP e-Commerce specific category values such as:
|
9 |
* * Category images
|
wpsc-includes/wpsc-customizer-thumbnail-control.class.php
CHANGED
@@ -11,14 +11,14 @@ if ( ! class_exists( 'WP_Customize_Control' ) ) {
|
|
11 |
*
|
12 |
* @package WP eCommerce
|
13 |
* @subpackage Customizer
|
14 |
-
* @since
|
15 |
*/
|
16 |
|
17 |
/**
|
18 |
* Thumbnail setting control for WxH settings in Customizer.
|
19 |
*
|
20 |
* @todo Move to its own file.
|
21 |
-
* @since
|
22 |
*/
|
23 |
class WPSC_Customizer_Thumbnail_Control extends WP_Customize_Control {
|
24 |
|
11 |
*
|
12 |
* @package WP eCommerce
|
13 |
* @subpackage Customizer
|
14 |
+
* @since 3.11.5
|
15 |
*/
|
16 |
|
17 |
/**
|
18 |
* Thumbnail setting control for WxH settings in Customizer.
|
19 |
*
|
20 |
* @todo Move to its own file.
|
21 |
+
* @since 3.11.5
|
22 |
*/
|
23 |
class WPSC_Customizer_Thumbnail_Control extends WP_Customize_Control {
|
24 |
|
wpsc-includes/wpsc-customizer.class.php
CHANGED
@@ -5,13 +5,13 @@
|
|
5 |
*
|
6 |
* @package WP eCommerce
|
7 |
* @subpackage Customizer
|
8 |
-
* @since
|
9 |
*/
|
10 |
|
11 |
/**
|
12 |
* Class used to implement Customizer ( specifically Selective Refresh ) functionality.
|
13 |
*
|
14 |
-
* @since
|
15 |
*/
|
16 |
|
17 |
/** WPSC_Customizer_Thumbnail_Control class */
|
5 |
*
|
6 |
* @package WP eCommerce
|
7 |
* @subpackage Customizer
|
8 |
+
* @since 3.11.5
|
9 |
*/
|
10 |
|
11 |
/**
|
12 |
* Class used to implement Customizer ( specifically Selective Refresh ) functionality.
|
13 |
*
|
14 |
+
* @since 3.11.5
|
15 |
*/
|
16 |
|
17 |
/** WPSC_Customizer_Thumbnail_Control class */
|
wpsc-includes/wpsc-logging.class.php
CHANGED
@@ -441,7 +441,7 @@ class WPSC_Logging {
|
|
441 |
* @param array $args Arguments passed to the taxonomy and post type hooks.
|
442 |
* @return array $args Arguments passed to the taxonomy and post type hooks.
|
443 |
*
|
444 |
-
* @since
|
445 |
*/
|
446 |
public static function force_ui( $args ) {
|
447 |
$args['show_ui'] = true;
|
@@ -450,4 +450,4 @@ class WPSC_Logging {
|
|
450 |
|
451 |
}
|
452 |
|
453 |
-
$GLOBALS['wpsc_logs'] = new WPSC_Logging();
|
441 |
* @param array $args Arguments passed to the taxonomy and post type hooks.
|
442 |
* @return array $args Arguments passed to the taxonomy and post type hooks.
|
443 |
*
|
444 |
+
* @since 3.11.0
|
445 |
*/
|
446 |
public static function force_ui( $args ) {
|
447 |
$args['show_ui'] = true;
|
450 |
|
451 |
}
|
452 |
|
453 |
+
$GLOBALS['wpsc_logs'] = new WPSC_Logging();
|
wpsc-includes/wpsc-meta-visitor.php
CHANGED
@@ -556,7 +556,7 @@ function wpsc_get_visitor_list( $include_expired_visitors ) {
|
|
556 |
*/
|
557 |
function wpsc_get_visitor_cart( $visitor_id ) {
|
558 |
|
559 |
-
$wpsc_cart = new
|
560 |
|
561 |
if ( _wpsc_visitor_database_ready() ) {
|
562 |
|
556 |
*/
|
557 |
function wpsc_get_visitor_cart( $visitor_id ) {
|
558 |
|
559 |
+
$wpsc_cart = new WPSC_Cart();
|
560 |
|
561 |
if ( _wpsc_visitor_database_ready() ) {
|
562 |
|
wpsc-includes/wpsc-tracking.php
CHANGED
@@ -45,7 +45,7 @@ class WPSC_Tracking {
|
|
45 |
* @access public
|
46 |
*/
|
47 |
public function __construct() {
|
48 |
-
add_action( '
|
49 |
add_action( 'wpsc_opt_into_tracking' , array( $this, 'check_for_optin' ) );
|
50 |
add_action( 'wpsc_opt_out_of_tracking' , array( $this, 'check_for_optout' ) );
|
51 |
add_action( 'wpsc_settings_page_save_options', array( $this, 'check_for_settings_optin' ), 10, 2 );
|
@@ -59,7 +59,7 @@ class WPSC_Tracking {
|
|
59 |
* @access public
|
60 |
* @return void
|
61 |
*/
|
62 |
-
public function
|
63 |
|
64 |
if ( isset( $_REQUEST['wpsc_tracking_action'] ) && ( $_REQUEST['wpsc_tracking_action'] == 'opt_into_tracking' ) ) {
|
65 |
do_action( 'wpsc_opt_into_tracking' );
|
@@ -68,9 +68,6 @@ class WPSC_Tracking {
|
|
68 |
if ( isset( $_REQUEST['wpsc_tracking_action'] ) && ( $_REQUEST['wpsc_tracking_action'] == 'opt_out_of_tracking' ) ) {
|
69 |
do_action( 'wpsc_opt_out_of_tracking' );
|
70 |
}
|
71 |
-
|
72 |
-
// We send once a week (while tracking is allowed) to check in, which can be used to determine active sites
|
73 |
-
add_action( 'wpsc_weekly_cron_task', array( $this, 'send_data' ) );
|
74 |
}
|
75 |
|
76 |
/**
|
@@ -245,6 +242,8 @@ class WPSC_Tracking {
|
|
245 |
// General site info
|
246 |
$data['url'] = home_url();
|
247 |
$data['email'] = get_option( 'admin_email' );
|
|
|
|
|
248 |
|
249 |
// Theme info
|
250 |
$data['theme'] = self::get_theme_info();
|
@@ -420,9 +419,12 @@ class WPSC_Tracking {
|
|
420 |
private static function get_wpec_info() {
|
421 |
$wpec_data = array();
|
422 |
|
423 |
-
$
|
424 |
-
|
425 |
-
$wpec_data['
|
|
|
|
|
|
|
426 |
|
427 |
return $wpec_data;
|
428 |
}
|
45 |
* @access public
|
46 |
*/
|
47 |
public function __construct() {
|
48 |
+
add_action( 'admin_init' , array( $this, 'capture_tracking_settings' ) );
|
49 |
add_action( 'wpsc_opt_into_tracking' , array( $this, 'check_for_optin' ) );
|
50 |
add_action( 'wpsc_opt_out_of_tracking' , array( $this, 'check_for_optout' ) );
|
51 |
add_action( 'wpsc_settings_page_save_options', array( $this, 'check_for_settings_optin' ), 10, 2 );
|
59 |
* @access public
|
60 |
* @return void
|
61 |
*/
|
62 |
+
public function capture_tracking_settings() {
|
63 |
|
64 |
if ( isset( $_REQUEST['wpsc_tracking_action'] ) && ( $_REQUEST['wpsc_tracking_action'] == 'opt_into_tracking' ) ) {
|
65 |
do_action( 'wpsc_opt_into_tracking' );
|
68 |
if ( isset( $_REQUEST['wpsc_tracking_action'] ) && ( $_REQUEST['wpsc_tracking_action'] == 'opt_out_of_tracking' ) ) {
|
69 |
do_action( 'wpsc_opt_out_of_tracking' );
|
70 |
}
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
/**
|
242 |
// General site info
|
243 |
$data['url'] = home_url();
|
244 |
$data['email'] = get_option( 'admin_email' );
|
245 |
+
$data['first_name'] = wp_get_current_user()->first_name;
|
246 |
+
$data['last_name'] = wp_get_current_user()->last_name;
|
247 |
|
248 |
// Theme info
|
249 |
$data['theme'] = self::get_theme_info();
|
419 |
private static function get_wpec_info() {
|
420 |
$wpec_data = array();
|
421 |
|
422 |
+
$base_country = new WPSC_Country( wpsc_get_base_country() );
|
423 |
+
|
424 |
+
$wpec_data['version'] = WPSC_VERSION;
|
425 |
+
$wpec_data['url'] = WPSC_URL;
|
426 |
+
$wpec_data['base_country'] = $base_country->get_name();
|
427 |
+
$wpec_data['debug'] = WPSC_DEBUG;
|
428 |
|
429 |
return $wpec_data;
|
430 |
}
|