WordPress.org

Ready to get started?Download WordPress

Forums

eShop
Tracking or Reporting on Shopping Cart "Clicks" ? (4 posts)

  1. neodiver
    Member
    Posted 3 years ago #

    Hi Rich!

    Anyway we can track when a visitor clicks on an item and adds it to their cart, but does not place an order and/or empties their cart?

    Is the cart strictly user-cookie based before an order is actually placed?

    The reason I ask is that we would like to see / track when a visitor adds an item to the cart, even if they never order.

    Thanks!

  2. elfin
    Moderator
    Plugin Author

    Posted 3 years ago #

    it's session based. Ther cart is updated via the eshop_cart_process function within cart-functions.php

    If you can figure out where to add actions/filters to help you achieve what you want within that, I can add them into a future release for you.

  3. neodiver
    Member
    Posted 3 years ago #

    Thanks for the pointer, Rich!

    Not perfect, but OK for now, I added this:

    [Code moderated as per the Forum Rules. Please use the pastebin]

  4. elfin
    Moderator
    Plugin Author

    Posted 3 years ago #

    Ok i've added to actions:
    look for the line:
    if(isset($_SESSION['eshopcart'.$blog_id][$identifier])){

    both are within this if statement.
    The first, just before the } else { is:
    do_action('eshop_product_updated_cart',$_SESSION['eshopcart'.$blog_id][$identifier]);
    the second just before the closing } is
    do_action('eshop_product_added_to_cart',$_SESSION['eshopcart'.$blog_id][$identifier]);

    Both are sent an array, and you should be able to do whatever with those by using add_action.

    (the code will be in the next release)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags