Closed cdhassell closed 7 years ago
I found a solution based on this by inserting this code near the top of woocommerce_civicrm.php:
//action to fire on order status change hook
add_action( 'woocommerce_order_status_changed', 'woocommerce_civicrm_change_order', 99, 3 );
function woocommerce_civicrm_change_order( $order_id, $old_status, $new_status ) {
woocommerce_civicrm_update_order($order_id);
}
Now it is updating the civicontribute record to Completed.
@cdhassell Thanks for the fix
Can you please create a PR with your fix?
@cdhassell Thanks for the PR
Issue is fixed with this PR https://github.com/veda-consulting/woocommerce_civicrm/pull/11
The extension works well, except that the contributions created in CiviCRM are left in a Pending state even after the transaction is completed in woocommerce. Looking at the code, I see that there is a block of 7 order status update add_action() calls which are commented out. It appears that these were written to hook to woocommerce transaction updates. Can you explain why the code is commented out and if this could explain why the Civi transactions never complete? Should these lines be uncommented? Thanks.