How to get quantity of the order from referral object?

Hi, I have implemented a custom affiliate area. I don’t give commission in USD. Instead, I give commission in the form of free insoles. The referral item in the dashboard/referrals-entry.php does not provide information about the order. How to get product quantity in the order so that I can calculate the insoles credited to the affiliate.
Thanks

Posted in

Comments

3 responses to “How to get quantity of the order from referral object?”

  1. Hey Michael,

    Perhaps the most suitable for you would be a formula-based Rate. Please have a look at https://docs.itthinx.com/document/affiliates-pro/rates/ for a complete description.

    Kind regards,
    George

  2. Hey Michael,

    Welcome back to our support channel.

    The order id can be found in the entry object, via $entry->post_id. This post_id refers to the post where the referral has been recorded, so if you track referrals not only for orders, then don’t forget to check if the post_id is related to an order or not, before getting the order and its items.
    I would recommend you to trace the $entry and check its contents/properties for an overview of what’s inside.

    Kind regards,
    George

    1. MICHAEL BURCH Avatar
      MICHAEL BURCH

      Hi George,
      I have managed to extract the quantity of sold item but that will not help me when I pay commission to the affiliate. I use affiliate pro and affiliate woocommerce integration. For a particular product, can I use “Pairs” as custom currency and amount 0.5 then in the rate section for that product. I use rate in general. This will help me calculate the number of pairs. I give one pair of insoles to affiliate for each two pairs referred.
      Will this help me calculate the insoles earned by the affiliate?
      Thanks

Share