Version Description
- 2019-03-05 =
- Fix - Use only product attributes when adding to cart
Download this release
Release Info
Developer | woothemes |
Plugin | WooCommerce PayPal Express Checkout Payment Gateway |
Version | 1.6.10 |
Comparing to | |
See all releases |
Code changes from version 1.6.9 to 1.6.10
assets/js/wc-gateway-ppec-generate-cart.js
CHANGED
@@ -72,14 +72,24 @@
|
|
72 |
var generate_cart = function( callback ) {
|
73 |
var data = {
|
74 |
'nonce': wc_ppec_generate_cart_context.generate_cart_nonce,
|
|
|
75 |
};
|
76 |
|
77 |
var field_pairs = form.serializeArray();
|
|
|
78 |
for ( var i = 0; i < field_pairs.length; i++ ) {
|
79 |
// Prevent the default WooCommerce PHP form handler from recognizing this as an "add to cart" call
|
80 |
if ( 'add-to-cart' === field_pairs[ i ].name ) {
|
81 |
field_pairs[ i ].name = 'ppec-add-to-cart';
|
82 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
data[ field_pairs[ i ].name ] = field_pairs[ i ].value;
|
84 |
}
|
85 |
|
72 |
var generate_cart = function( callback ) {
|
73 |
var data = {
|
74 |
'nonce': wc_ppec_generate_cart_context.generate_cart_nonce,
|
75 |
+
'attributes': {},
|
76 |
};
|
77 |
|
78 |
var field_pairs = form.serializeArray();
|
79 |
+
|
80 |
for ( var i = 0; i < field_pairs.length; i++ ) {
|
81 |
// Prevent the default WooCommerce PHP form handler from recognizing this as an "add to cart" call
|
82 |
if ( 'add-to-cart' === field_pairs[ i ].name ) {
|
83 |
field_pairs[ i ].name = 'ppec-add-to-cart';
|
84 |
}
|
85 |
+
|
86 |
+
// Save attributes as a separate prop in `data` object,
|
87 |
+
// so that `attributes` can be used later on when adding a variable product to cart
|
88 |
+
if ( -1 !== field_pairs[ i ].name.indexOf( 'attribute_' ) ) {
|
89 |
+
data.attributes[ field_pairs[ i ].name ] = field_pairs[ i ].value;
|
90 |
+
continue;
|
91 |
+
}
|
92 |
+
|
93 |
data[ field_pairs[ i ].name ] = field_pairs[ i ].value;
|
94 |
}
|
95 |
|
changelog.txt
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
*** Changelog ***
|
2 |
|
|
|
|
|
|
|
3 |
= 1.6.9 - 2019-02-03 =
|
4 |
* Fix - Avoid SPB render error by tweaking 'allowed' funding methods' empty value
|
5 |
|
1 |
*** Changelog ***
|
2 |
|
3 |
+
= 1.6.10 - 2019-03-05 =
|
4 |
+
* Fix - Use only product attributes when adding to cart
|
5 |
+
|
6 |
= 1.6.9 - 2019-02-03 =
|
7 |
* Fix - Avoid SPB render error by tweaking 'allowed' funding methods' empty value
|
8 |
|
includes/class-wc-gateway-ppec-cart-handler.php
CHANGED
@@ -86,7 +86,8 @@ class WC_Gateway_PPEC_Cart_Handler {
|
|
86 |
wc_empty_cart();
|
87 |
|
88 |
if ( $product->is_type( 'variable' ) ) {
|
89 |
-
$attributes = array_map( 'wc_clean', $_POST );
|
|
|
90 |
|
91 |
if ( version_compare( WC_VERSION, '3.0', '<' ) ) {
|
92 |
$variation_id = $product->get_matching_variation( $attributes );
|
86 |
wc_empty_cart();
|
87 |
|
88 |
if ( $product->is_type( 'variable' ) ) {
|
89 |
+
$attributes = array_map( 'wc_clean', $_POST['attributes'] );
|
90 |
+
|
91 |
|
92 |
if ( version_compare( WC_VERSION, '3.0', '<' ) ) {
|
93 |
$variation_id = $product->get_matching_variation( $attributes );
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic, woothemes, akeda, dwainm, royho, allendav, slash1andy,
|
|
3 |
Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 5.0.3
|
6 |
-
Stable tag: 1.6.
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -101,6 +101,9 @@ Please use this to inform us about bugs, or make contributions via PRs.
|
|
101 |
|
102 |
== Changelog ==
|
103 |
|
|
|
|
|
|
|
104 |
= 1.6.9 - 2019-02-03 =
|
105 |
* Fix - Avoid SPB render error by tweaking 'allowed' funding methods' empty value
|
106 |
|
3 |
Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 5.0.3
|
6 |
+
Stable tag: 1.6.10
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
101 |
|
102 |
== Changelog ==
|
103 |
|
104 |
+
= 1.6.10 - 2019-03-05 =
|
105 |
+
* Fix - Use only product attributes when adding to cart
|
106 |
+
|
107 |
= 1.6.9 - 2019-02-03 =
|
108 |
* Fix - Avoid SPB render error by tweaking 'allowed' funding methods' empty value
|
109 |
|
woocommerce-gateway-paypal-express-checkout.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WooCommerce PayPal Checkout Gateway
|
4 |
* Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
|
5 |
* Description: A payment gateway for PayPal Checkout (https://www.paypal.com/us/webapps/mpp/paypal-checkout).
|
6 |
-
* Version: 1.6.
|
7 |
* Author: WooCommerce
|
8 |
* Author URI: https://woocommerce.com
|
9 |
* Copyright: © 2018 WooCommerce / PayPal.
|
@@ -27,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
27 |
exit; // Exit if accessed directly
|
28 |
}
|
29 |
|
30 |
-
define( 'WC_GATEWAY_PPEC_VERSION', '1.6.
|
31 |
|
32 |
/**
|
33 |
* Return instance of WC_Gateway_PPEC_Plugin.
|
3 |
* Plugin Name: WooCommerce PayPal Checkout Gateway
|
4 |
* Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
|
5 |
* Description: A payment gateway for PayPal Checkout (https://www.paypal.com/us/webapps/mpp/paypal-checkout).
|
6 |
+
* Version: 1.6.10
|
7 |
* Author: WooCommerce
|
8 |
* Author URI: https://woocommerce.com
|
9 |
* Copyright: © 2018 WooCommerce / PayPal.
|
27 |
exit; // Exit if accessed directly
|
28 |
}
|
29 |
|
30 |
+
define( 'WC_GATEWAY_PPEC_VERSION', '1.6.10' );
|
31 |
|
32 |
/**
|
33 |
* Return instance of WC_Gateway_PPEC_Plugin.
|