Home Forums WoodMart support forum Empty Abandoned carts

Empty Abandoned carts

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #643242

    computermobil
    Participant

    Hi friends.
    The new Abandoned carts function is nice but please prevent outgoing reminders for empty carts.
    Since activated 4 of 5 outgoing reminder emails where for empty carts as you can see in this two screeshots.
    Thank you in advance!

    Attachments:
    You must be logged in to view attached files.
    #643426

    Artem Temos
    Keymaster

    Hello,

    You can fix it by applying patch # 643367. To do this, go to Dashboard -> WoodMart -> Patcher, find the corresponding patch and click on the “Apply” button.
    After this, add the following code snippet to the functions.php file in the child theme, refresh any page and remove it

    add_action(
    	'init',
    	function () {
    		$carts = get_posts(
    			array(
    				'post_type'      => 'wd_abandoned_cart',
    				'posts_per_page' => -1,
    			)
    		);
    
    		foreach ( $carts as $cart ) {
    			$cart_id     = $cart->ID;
    			$stored_cart = maybe_unserialize( get_post_meta( $cart_id, '_cart', true ) );
    
    			if ( 0 === $stored_cart->get_cart_contents_count() ) {
    				wp_delete_post( $cart_id );
    			}
    		}
    	}
    );

    Kind Regards

    #643497

    computermobil
    Participant

    Hi Artem.
    Thank you for looking after me, seems to work now, one issue left, but will open a new ticket.
    Thx a lot.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Empty Abandoned carts’ is closed to new replies.