• Resolved jumptech

    (@jumptech)


    Hi
    I’m trying your pro version demo to evalute the plugin purchase.
    I need to export a report where there is a group by with the zipcode.

    I would like to have this output:

    ZIP Code | Quantity | Product

    So, if in a month two users with the same zipcode (example: 47121) buy product X (1 product each), I would like to see, in my output:

    ZIP Code | Quantity | Product
    47121 | 2 | X

    If:
    – user 1 (zipcode 47121) buy 1 product A and 1 product B
    – user 2 (zipcode 47121) buy 1 product B
    – user 3 (zipcode 65311) buy 1 product A

    my output will be

    ZIP Code | Quantity | Product
    47121 | 2 | B
    47121 | 1 | A
    65311 | 1 | A

    Is it possible to do this?
    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author algol.plus

    (@algolplus)

    Hi

    1. please, turn on ” Summary Report By Products”
    2. add field “zipcode” as described in https://docs.algolplus.com/algol_order_export/add-calculated-field-for-product/
    3. add this code to section “Misc Settings”

    add_filter( "woe_summary_products_adjust_key", function($key, $product, $product_item, $order ){
      return $order->get_billing_postcode();
    },10,4);
    add_filter('woe_get_order_product_value_zipcode', function ($value, $order, $item, $product,$item_meta) {
      return $order->get_billing_postcode();
    }, 10, 5);
    Thread Starter jumptech

    (@jumptech)

    hi

    Thank you for the reply.

    Doing as you said produce a wrong output.

    all the quantities are added together and instead of two rows (one for each products) I have only one row with the total quantity of the purchased products, also if the product it’s not the one mentioned in the row.

    Maybe I’ve created zipcode wrong?
    If I select ” Summary Report By Products” I can only create a zipcode field like that https://drive.google.com/file/d/1iobILoTXhPZuyd4hhG5FTmGcG9S7QPQv/view?usp=sharing

    Thread Starter jumptech

    (@jumptech)

    [submit by error]

    • This reply was modified 3 years, 2 months ago by jumptech.
    Plugin Author algol.plus

    (@algolplus)

    Yes, you added new field correctly.

    Could you try this code ?

    add_filter( "woe_summary_products_adjust_key", function($key, $product, $product_item, $order ){
      return $key . $order->get_billing_postcode();
    },10,4);
    add_filter('woe_get_order_product_value_zipcode', function ($value, $order, $item, $product,$item_meta) {
      return $order->get_billing_postcode();
    }, 10, 5);
    • This reply was modified 3 years, 2 months ago by algol.plus.
    Plugin Author algol.plus

    (@algolplus)

    please, use “Add static field” https://imgur.com/4V4JqA9
    and use this code

    add_filter('woe_get_order_product_value_static_field_2', function ($value, $order, $item, $product,$item_meta) {
      return $order->get_billing_postcode();
    }, 10, 5);
    Thread Starter jumptech

    (@jumptech)

    Thank you so much! this works!!

    • This reply was modified 3 years, 2 months ago by jumptech.
    Plugin Author algol.plus

    (@algolplus)

    just replace get_billing_postcode with get_shipping_postcode

    Thread Starter jumptech

    (@jumptech)

    Yes I’ve done this after I’ve asked you ^^”
    I’ll give you 5 stars and I’ll buy your plugin asap.

    Thank you again

    Plugin Author algol.plus

    (@algolplus)

    you’re welcome!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Group by Zip code’ is closed to new replies.