Skip to content

Commit

Permalink
Merge pull request #1355 from angelleye/PFW-461
Browse files Browse the repository at this point in the history
CartFlows Compatibility : PFW-461
  • Loading branch information
kcppdevelopers committed Sep 2, 2019
2 parents 1006cf8 + dd6915e commit 7242406
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
Expand Up @@ -255,6 +255,7 @@ public function __construct() {
add_action('xoo_wsc_after_footer_btns', array($this, 'angelleye_xoo_cu_wsc_paypal_express'), 10);
}
add_action( 'widget_title', array( $this, 'angelleye_maybe_enqueue_checkout_js' ), 10, 3 );
add_action( 'woocommerce_before_checkout_process', array( $this, 'angelleye_woocommerce_before_checkout_process' ), 10);
}

} catch (Exception $ex) {
Expand Down Expand Up @@ -1397,4 +1398,12 @@ public function angelleye_maybe_enqueue_checkout_js($widget_title, $widget_insta
}
return $widget_title;
}

public function angelleye_woocommerce_before_checkout_process() {
if(isset($_POST['_wcf_checkout_id']) && isset($_POST['_wcf_flow_id'])) {
$_GET['wc-ajax'] = 'checkout';
wc_maybe_define_constant( 'DOING_AJAX', true );
wc_maybe_define_constant( 'WC_DOING_AJAX', true );
}
}
}
3 changes: 3 additions & 0 deletions assets/js/angelleye-in-context-checkout.js
Expand Up @@ -444,6 +444,7 @@ jQuery(function ($) {
disallowed: disallowed_funding_methods_var
},
payment: function () {
$('.woocommerce').block({message: null, overlayCSS: {background: '#fff', opacity: 0.6}});
var data = $( selector ).closest( 'form' )
.add( $( '<input type="hidden" name="request_from" /> ' )
.attr( 'value', 'JSv4' )
Expand Down Expand Up @@ -475,6 +476,7 @@ jQuery(function ($) {
});
},
onCancel: function (data, actions) {
$('.woocommerce').unblock();
window.location.href = angelleye_in_content_param.cancel_page;
},
onClick: function () {
Expand All @@ -489,6 +491,7 @@ jQuery(function ($) {
}
},
onError: function (err, actions) {
$('.woocommerce').unblock();
window.location.href = angelleye_in_content_param.cancel_page;
}
}, selector);
Expand Down

0 comments on commit 7242406

Please sign in to comment.