$base_amount, $parameters, Referrals by Product

Hey there,

(Affiliates Enterprise and most of your extensions if this helps especially for 3.)

1. please can you give me a short introduction for your variable: $base_amount ??

it’s used as parameter for your function public static function calculate( $order_id, $base_amount ) inside your helper-script: Klick me.
I understand how your script works, and I can see what’s your input into this variable as parameter from “func product_amount”, but I can’t see where this variable will be used inside the function ?

2. Where exactly (at which point in the execution) will your variable $parameters been created ? Just for a better understanding how it works for debugging some of your API-Events..

3. Please, please, please… Is there any way to get the referrals of an affiliate for every product (perhaps with the product-id) ? Example –> Product a = 25 purchases, Product b = 67 purchases, Product c = 12 purchases for a specific affiliate ? I need it for our planed custom method, but in your API-Docs is just “affiliates_get_affiliate_referrals” present for all referrals with affiliate-id as parameter..

Thank you, best regards
Bruno

9 Responses to $base_amount, $parameters, Referrals by Product

  1. Bruno April 7, 2015 at 7:27 am #

    Hello Kento,

    #1 I try to reach him, thanks..

    #2 Thank you for this nice tip with var_export ! : )

    Best regards
    Bruno

  2. kento April 6, 2015 at 9:41 am #

    Hi Bruno,

    #1 I think you should ask @eggemplo there as it’s his code. The second parameter $base_amount isn’t used in the function itself.

    #2 If you just want to see a trace that you can place in the code to help you refine your own code, why not use error_log( var_export( $parameters, true ) ); ? And for a more refined way of debugging your code you should consider using Xdebug.

    Cheers

  3. Bruno April 3, 2015 at 7:56 pm #

    Thanks for your help George : )

    But is it possible that someone can look at this topic who can give me an answer to my questions, please ?

    #1 why do use $base_amount inside “http://www.itthinx.com/topic/base_amount-parameters-referrals-by-product/#comments” -> here

    #2 How can I var_dump your variable: $parameters ?

    Thank you very much, best regards
    Bruno

  4. Bruno April 2, 2015 at 3:43 pm #

    Hi George,

    I agree with you $base_amount isn’t used in this concept.

    but it it’s used. Can me somebody please explain what this means for the functionality of this method ?

    Thank you

  5. George April 2, 2015 at 3:39 pm #

    Hi Bruno,

    I agree with you $base_amount isn’t used in this concept.
    Since $parameters is created after the referral has been recorded for an order i would dump it or log it etc after checking that the order has been placed.

    Thanks

  6. Bruno April 2, 2015 at 2:41 pm #

    Hello George,

    thanks for reply. I haven’t a problem to understand what base amount means. In the script that I linked in #1 you don’t use $base_amount inside the function. I just can’t see what you do with this parameter there..

    What’s the best way to dump $parameters ? Where can I set a breakpoint ?

    Thank you

  7. George April 2, 2015 at 2:36 pm #

    Hi Bruno,

    You can check this link to understand how $base_amount works.
    As for the second point, $parameters is created when a referral is recorded for an order.

    Hope you find these helpful
    Thank you

  8. Bruno April 2, 2015 at 5:26 am #

    Hi George,
    thanks for your reply. Your reference to Affiliate WooCommerce was really helpful. Now it was possible for me to extract the referrals per product for an affiliate.

    But question 1 & 2 are also really needed to finish my custom amount : )

    So I hope someone can help me out as fast as possible…

    Thank you, best regards
    Bruno

  9. George April 1, 2015 at 7:56 am #

    Hi Bruno,

    I will start in reverse order.

    As for the 3. point, there is an extension called Affiliate WooCommerce Views found here which gives you the ability to show which product has granted a commission to the respective affiliate.

    As for the rest of your points i will forward your message to someone more suitable to answer, or you can simply ask your question in the github dedicated page of the plugin which is a more suitable place

    Kind regards,
    George

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account

Share