• Resolved Ward

    (@yward)


    Hello there and thank you for this great plugin.

    My problem is as follows:
    I’m using a multi-vendor plugin (dokan). To achieve its functionality; when a customer orders products from different vendors, it create a main order that contains a sub/child order for each vendor.

    Example:
    Joe sells chips for 5$
    Toni sells Pepsi 5$

    If a customer buys 1xChips and 1xPepsi, 3 orders will be created as follows:
    -Main order: this is mainly a place holder for the child/sub orders with a total value of 8$
    -Sub-order 1: this is the chips order for 5$
    -Sub-order 2: this is the pepsi order for 3$

    Now here’s the problem, this works flawlessly in everything EXCEPT analytics, in analytics the order value is doubled as it will show the main order AND the suborders, so in analytics this 8$ order will show 3 times, once as a 8$ total order and once as a 5$ chips order and the last time as a 3$ pepsi order. Bringing up the total to 16$ which is double the correct/real value.

    Example:
    https://www.upload.ee/image/11928278/woo2.png

    This is supposed to be one order which is #11112. Orders #11113 and #11114 are sub-orders and are ordered calculated in #11112 but with the current way analytics work they are being counted twice, once collectively as part of main order and once individually doubling the totals.

    Any code snippet to counter this?

    I’m also comfortable editing core files if you can direct me to the files to edit.

Viewing 4 replies - 1 through 4 (of 4 total)
  • AJ a11n

    (@amandasjackson)

    Hi @yward

    I’m using a multi-vendor plugin (dokan)

    I recommend reaching out to the developers of the Dokan plugin that you are using as they should be able to help you with the issues concerning analytics as they relate to their plugin and how it creates orders.

    If the 3PD plugin was not installed on the site, I suspect the issue would not occur, which means that the issue is not with WooCommerce, but with the Dokan plugin.

    Hope this helps to guide you in the right direction for support.

    Thread Starter Ward

    (@yward)

    Hello Amanda,

    Thank you for the prompt response. The issue is /NOT/ specific to a certain plugin, what I mentioned is an example. This occurs with ANY plugin that uses suborders/child orders. For example if you use the “Woocommerce Product Bundles” or any other bundles plugin, the same issue will occur, which means it is specific to Woocommerce not those plugins.

    Let me simplify the question:
    Is there is any way I can edit Woocommerce’s code to prevent it from counting child/sub orders in its analytics?

    I really like the analytics and the woocommerce admin features that were merged into Woocommerce recently and I do not want to depend on third party plugins for analytics if this trival issue can be amended by a snippet or a code change.

    • This reply was modified 4 years, 9 months ago by Ward.
    AJ a11n

    (@amandasjackson)

    Hi @yward

    Is there is any way I can edit Woocommerce’s code to prevent it from counting child/sub orders in its analytics?

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to help you out.

    I can also recommend the following places for more development-oriented questions:

    1. WooCommerce Slack Community: https://woocommerce.com/community-slack/
    2. WooCommerce FB group: https://www.facebook.com/groups/advanced.woocommerce/

    You could also post this directly on GitHub for WooCommerce core to see if one of the developers have some ideas for you.

    Thread Starter Ward

    (@yward)

    Hello there,

    Thank you once more for the response. I’ll try my luck via a github issue, feel free to close this once an adequate time has passed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Analytics – Sub-orders/Child Orders’ is closed to new replies.