The problem with WooCommerce stripe gateway plugin not being compatible with WooCommerce Deposits is because Stripe gateway plugin gets cart total directly from cart->total property which does not go through woocommerce filters, that makes WooCommerce Deposits unable of correcting the amount and overriding deposit amount instead of total amount.
A fix can be implemented by doing the following :
we need to modify stripe gateway plugin in order to get the data via a filter-enabled function. to do that, open file
~/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php
find function payment_fields()
and add the following code snippet below the line “$total = WC()->cart->total;
”
1 2 3 4 5 |
if(isset(WC()->cart->cart_session_data[ 'deposit_enabled' ]) && WC()->cart->cart_session_data[ 'deposit_enabled' ]){ $total = WC()->cart->cart_session_data[ 'deposit_amount' ]; } |