Support » Plugin: WooCommerce Cart Abandonment Recovery » Bug on change of order status

  • scorpiotiger


    When an order status changes to “processing”, the function wcf_ca_update_order_status() which is called by hook, attempts to retrieve an abandoned cart by calling get_captured_data_by_email() (class-cartflows-ca-cart-abandonment.php:197). The called function selects abandoned carts where order_status is WCF_CART_ABANDONED_ORDER or WCF_CART_LOST_ORDER, and does not include when order status = ‘normal’.
    Line 204 later tests for order_status === WCF_CART_NORMAL_ORDER, with a true result causing a delete of the abandoned cart. This however can never evaluate to true as line 199 tests for a retrieved abandoned cart where order_status is WCF_CART_ABANDONED_ORDER or WCF_CART_LOST_ORDER. An abandoned cart with an order_Status of ‘normal’ won’t be retrieved and thus $captured_data will be null, preventing the delete from ever being reached.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter scorpiotiger


    I haven’t investigated further, but I suspect that this is why in some cases, our customers are receiving abandoned cart emails even upon successfully placing an order. Our case is a little more complicated as we’ve forked the plugin to support WPML, translatable emails and multi-currency. After finding the issue in our codebase, I’ve had to refer back to latest source to confirm that the issue exists.

    Plugin Support CartFlows Team


    Hello @scorpiotiger,

    Thank you for reaching out to us.

    If the order status is normal and the user placed the order before converting it into the abandonded status, the captured data will be deleted. Such carts will not be considered as recovered and will be deleted from the list.

    Can you please let us know if the customers who completed the purchases & received the emails are listed in the Recoverable section of the cart abandoned?

    Looking forward to hearing from you.

    Thread Starter scorpiotiger


    How can the captured data be deleted when the code can never be reached?




    When a user enters their email address on checkout pages plugin captures the data and mark it as normal. After cron cut-off time, the plugin checks if the order is placed or not. If placed plugin deletes the captured order.

    This is how it works.

    • This reply was modified 1 month ago by iamganesh.
    • This reply was modified 1 month ago by iamganesh.
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.