FEATURE REQUEST: option to create an order

Posted by: Adam Breen

22nd May 2018, 5:06 pm

Adam Breen

@marketingninjadigital

22 May 2018
5:06 pm

The Free Download logs feature is nice and all... but from an integrations perspective, it would be nice to still have the option for a WC order to get created for a customer.

Here's the actual flow I'm using for this funnel:

  1. Gravity Forms lead capture
  2. GF User Registration add-on => creates new Customer user (and auto-activates them)
  3. GF Perks "Auto login" plugin logs the user in seamlessly
  4. GF confirmation redirects to a thank you page, with the Free Downloads shortcode on it (which works beautifully).

My problem is that some analytics tools (eg. Metrilo eCommerce CRM — built especially for WooCommerce) expect an order with a product line item in it to provide the best analytics data possible on the customer.

I don't have time right now to check, but if you have any PHP-level action hooks that I could leverage to create the Order anyway, that would be an ok solution at this stage?

Thanks in advance,

Adam

  • Developer
    Richard Webster

    @rwebster

    22 May 2018
    7:06 pm

    Hello mate, this is something I thought of doing but decided against putting in place now because of the number of orders it might create, and the fact that free downloads subvert the order system and I'd need to test how this would function with the user account system in WooCommerce.

    There is an action you can use that get's called just before a successful download file is fetched as follows:

    do_action( 'somdn_count_download', $product_id );

    If you need to access any other data my plugin processes it's all in the $_POST variable, as the download is essentially a php $_POST form request.

    There is also the following action for variation download specifically, although I don't actually hook into it for anything.

    do_action( 'somdn_count_variation_download', $variation_id, $product_id );

    Last modified: 22nd May 2018, 7:08 pm by Richard Webster

  • Adam Breen

    @marketingninjadigital

    22 May 2018
    7:11 pm

    Thanks mate :). I'll give that a whirl.

    I'd need to test how this would function with the user account system in WooCommerce.

    ... can you elaborate on this one for me?

  • Developer
    Richard Webster

    @rwebster

    22 May 2018
    7:15 pm

    Adam Breen said on 22 May 2018, 7:11 pm:

    Thanks mate :). I'll give that a whirl.

    I'd need to test how this would function with the user account system in WooCommerce.

    ... can you elaborate on this one for me?

    Sure. When an order is created it shows up in the user's purchase history. If they download the same product twice, they will have two orders for the same thing. It might also confuse some systems like refund or support requests.

    There is an option in my plugin settings to display the free download history for a user on their account page. No duplications, just all products they have previously downloaded for free and are still eligible to download.

    Last modified: 22nd May 2018, 7:16 pm by Richard Webster

This topic is closed to new replies.