Credit For Sale - Thank You Page?

I got a question on an affiliate program I am setting up. This is the first one I have setup. Bare with me for the novice question. Basically, we are going to have an affiliate program for two products for credit repair services. Will have an individual plan and couples plan. I am going to be using dowcommerce.net and setting up the payment structure. Is there a way to put a key on the "Thank You" page where people get credit for a sale? Trying to figure out how I am going to make this plugin work.

  • Vaughan

    Hiu @Garen Arnold,

    This might be a bit tricky using an external gateway. Affilaites would need to be registered members of the site, as such thgey would have an affiliate ID assigned to them.

    If you look at the marketpress addon in /affiliate/affiliateincludes/addons/marketpress.php

    You can see how it's achieved there, so you can create an addon for your particular system, but you might need a custom plugin to achieve this.

    you can see it uses the following action.

    if(!empty($aff_id)) {
    		$percentage = aff_get_option('affiliate_mp_percentage', 0);
    		// We have a referrer - get the total
    		$total_amount = get_post_meta($order->ID, 'mp_order_total', true);
    		// calculate the amount to give the referrer - hardcoded for testing to 30%
    		$amount = ($total_amount / 100) * $percentage;
    		// run the standard affiliate action to do the recording and assigning
    		do_action('affiliate_purchase', $aff_id, $amount, 'marketpress', $order->ID, 'Affiliate payment for MarketPress order.');
    		// record the amount paid / assigned in the meta for the order
    		add_post_meta($order->ID, 'affiliate_marketpress_order_paid', $amount, true);
    	}

    Let me just ask the developer for more feedback on this for you.

    Hope this helps

  • Paul

    @Garen Arnold, (Thanks @Vaughan)

    As you are using an external system (dowcommerce.net) you would need to submit the affiliate payment transaction in order to get it properly recorded. As @Vaughan mentioned you can use as a starting point the MarketPress add-on
    /affiliate/affiliateincludes/addons/marketpress.php

    In the file locate the line as I'm showing below. This is the line of the add-on which submits the transaction to the affiliate plugin. And this is pretty much all you need. You just need to provide the details. I've provided a field by field instructions below.

    do_action('affiliate_purchase', $affiliate_user_id, $amount, 'paid:marketpress', $order_number, $note, $meta);

    'affiliate_purchase' - Will always be this value. do not change.
    $affiliate_user_id - This parameter is the WP user id of the affiliate who will get credit.
    $amount - The dollar amount the affiliate user it to received. It is up to you to calculate this.
    'paid:marketpress' - Can be anything. This is your field.
    $order->ID - This is the MarketPress order ID. Ban be your unique order number. Integer only.
    $note - This is the string which will be shown on the affiliate details page. See line 70 of the file for example.
    $meta - This is an array of misc information stored but not displayed as part of the transactions. Refer to line 58-67 where we build the meta array for MarketPress transactions. You may add any of your own custom fields.

    $affiliate
    // run the standard affiliate action to do the recording and assigning
    $note = __('Affiliate payment for MarketPress order.', 'affiliate)');
    do_action('affiliate_purchase', $affiliate_user_id, $amount, 'paid:marketpress', $order->ID, $note, $meta);

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.