Stripe with G Pay change price to zero
-
hello every body.
I have a little issue with the new version of the plugin.
my first issue was that anybody try to buy a product with the gpay stripe button, when you select the addres, stripe empty the cart.
this issue is at wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php on line 927
from line 924
// First empty the cart to prevent wrong calculation.
WC()->cart->empty_cart();if ( ‘variable’ === ( WC_Stripe_Helper::is_wc_lt( ‘3.0’ ) ? $product->product_type : $product->get_type() ) && isset( $_POST[‘attributes’] ) ) {
$attributes = array_map( ‘wc_clean’, $_POST[‘attributes’] );if ( WC_Stripe_Helper::is_wc_lt( ‘3.0’ ) ) {
$variation_id = $product->get_matching_variation( $attributes );
} else {
$data_store = WC_Data_Store::load( ‘product’ );
$variation_id = $data_store->find_matching_product_variation( $product, $attributes );
}WC()->cart->add_to_cart( $product->get_id(), $qty, $variation_id, $attributes );
}if ( ‘simple’ === ( WC_Stripe_Helper::is_wc_lt( ‘3.0’ ) ? $product->product_type : $product->get_type() ) ) {
WC()->cart->add_to_cart( $product->get_id(), $qty );
}WC()->cart->calculate_totals();
but if i comment //WC()->cart->empty_cart();
then it works, and i can select the addres and stripe don′t empty the cart. but at the next step, when you push the button pay, then it fails with another issue with the province.
this is the orinal full error log
/home/sensual1/public_html/sensualintim.com/wp-includes/plugin.php( in /home/sensual1/public_html/sensualintim.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php on line 927
[19-Sep-2019 18:13:28 UTC] PHP Warning: preg_match(): Unknown modifier ‘&’ in /home/sensual1/public_html/sensualintim.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php on line 974
[19-Sep-2019 18:13:28 UTC] PHP Warning: preg_match(): Unknown modifier ‘&’ in /home/sensual1/public_html/sensualintim.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php on line 987
[19-Sep-2019 18:17:04 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_type() on boolean in /home/sensual1/public_html/sensualintim.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php:927
Stack trace:
#0 /home/sensual1/public_html/sensualintim.com/wp-includes/class-wp-hook.php(286): WC_Stripe_Payment_Request->ajax_add_to_cart(”)
#1 /home/sensual1/public_html/sensualintim.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
#2 /home/sensual1/public_html/sensualintim.com/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#3 /home/sensual1/public_html/sensualintim.com/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(87): do_action(‘wc_ajax_wc_stri…’)
#4 /home/sensual1/public_html/sensualintim.com/wp-includes/class-wp-hook.php(286): WC_AJAX::do_wc_ajax(”)
#5 /home/sensual1/public_html/sensualintim.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(false, Array)
#6 /home/sensual1/public_html/sensualintim.com/wp-includes/plugin.php( in /home/sensual1/public_html/sensualintim.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php on line 927
[19-Sep-2019 18:17:24 UTC] PHP Warning: preg_match(): Unknown modifier ‘&’ in /home/sensual1/public_html/sensualintim.com/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-payment-request.php on line 974thanks with your help
The page I need help with: [log in to see the link]
- The topic ‘Stripe with G Pay change price to zero’ is closed to new replies.