Contact form 7 with affiliates plugin

Hi,

Been racking my brains to find easiest solution to my problem ...

My customers will pay to access a form on my site (using pay-per-view plugin), which is working great.

This form uses the Contact Form 7 plugin (which works great of course) ... but I want a part of that form to update the site that one of the companies signed up for my site has sold an item.

You see, users pay £25 to fill in this form, the form will ask them for a ref number or some way to identify which shop recommended them. Like an affiliate scheme.

I can see a plugin: http://www.itthinx.com/plugins/affiliates-pro/

which works with a Contact Form 7 plugin: https://wordpress.org/plugins/affiliates-contact-form-7/

I really don't want to go else where for plugins now I have yearly gold membership - is there an equivalent for this site. So something to track a user the signs up for the site (using your membership plugin - which works great so far), then they can see how many sales they have. The sales are tracked by the ref number in the contact form to confirm a sale to the various users?

Hope this all makes sense?

Thanks

  • Brian
    • Design Lord, Child of Thor

    OK I have installed the affiliates plugin ... pretty sure it is along the right lines like you said.

    I just need a little guidance installing for my needs:

    I have membership plugin for my affiliates to sign up with ... I have a form built with contact form 7 ...

    Every time someone presses send on this form, I want the affiliate to get £5. This can be via the user entering a ref number of the affiliate or the plugin detecting from the URL used which affiliate it is.

    Any guidance greatly appreciated?

    Thanks

  • Ash
    • WordPress Hacker

    Hello @Brian

    I hope you are well today.

    I dont think this is possible out of the box. You need to write some custom code.

    I am tagging an available developer from second level support line in this thread for his valuable opinio, if there is any easy workaround. Please note that, developer response might be slower than usual staff response, so we appreciate your patience on this.

    Cheers
    Ash

  • Brian
    • Design Lord, Child of Thor

    Ah I see, thanks Ash.

    Hopefully there's a quick and easy plugin to solve this problem.

    I have the affiliate / members / contact form 7 / pay per view plugins installed. Maybe thinking don't need the affiliate plugin.

    I can add a field in the contact form that shows the ref number of affiliate etc. Just need that to update their members account somehow whenever a form is submitted?

    Many thanks
    Brian

  • Jude
    • DEV MAN

    Hey Brian,

    Hope you are doing great. I am just trying to zero in on the solution. Please correct me if I'm wrong. You are happy with the combination of plugins that you are currently using except that you'd need a custom solution which does the following

    Whenever a form is submitted, find the affiliate mentioned in the form using a unique ref number and add 5p to their account balance ?

    Is this correct ?

    Also I don't have access to the third party plugins you have installed which I'll need to test my code. It would be great if you can share temporary support access to the site you want this done on.

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    This link has instructions on how to do it.

    Cheers
    Jude

  • Brian
    • Design Lord, Child of Thor

    Hi Jude,

    Thanks for your reply. I have granted you access until 20th Dec ....

    The pay-per-view plugin is still in use to grant access to a page with a contact form on it ... I went with a free plugin to track affiliates now (https://wordpress.org/plugins/affiliates-manager/).

    It's great for what I need, however I don't think this plugin knows when one of the those Pay-Per-Views has been sold ... in fact i'm not sure how it tracks sales but looks great so I was sold lol

    Many thanks for your help

  • Jude
    • DEV MAN

    Hi Greg

    I was looking at the Affiliates Manager plugin, it looks like it does track affiliates using entries in the database. I am going to need some more details from you before I can provide a solution to this ticket

    Can you please send in:

    - Mark to my attention - ATTN: Jude Rosario
    - Your site has another layer of security, it needs a password just to view. I'll need that as well
    - Link back to this thread
    - Include admin/network access
    - Include cPanel/WHM (I will need to look at the DB so need PHPMyAdmin or similar)
    - Include FTP
    - Include MySQL root username and password
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    Thanks!!.

  • Jude
    • DEV MAN

    Hi Brian

    Im sorry this is taking longer than usual. Im just trying to understand the exact workflow in your site. A user signs up and fills out a form and pays 25 pounds. If this transaction is succesful you payout to an affiliate. I hope this is right.

    What I am not able to understand is how you capture the affiliates' details ? Where do you track which affiliate made the referral.

    Can you put paypal on sandbox mode and create a temp admin account on WordPress which you can delete once this ticket is closed. Please use the same username / password as your main site which you earlier sent in.

    I will be working on this ticket over the weekend and have it resolved as soon as possible

    Regards
    Jude

  • Brian
    • Design Lord, Child of Thor

    Thanks for your reply Jude,

    I'm afraid I don't have a SandBox account for PayPal ...

    The affiliate plugin gives the person a URL to follow ... so they have http://www.mychemistdoctor.co.uk/?wpam_refkey=2 as an example

    If you click here http://www.mychemistdoctor.co.uk/affiliate-home/affiliate-login/

    You can log in as:

    oban3brian@gmx.co.uk
    test

    This is a test account. Click affiliate links and it provides you with unique URL to use. I presume this creates a cookie on the persons computer, not sure what happens with that cookie when you buy the form, hoping it adds one sale to the relevant affiliate?

    Many thanks

  • Jude
    • DEV MAN

    Hi Brian,

    Thanks for your patience, I have created a custom plug-in for your site that glues together all the plugins as we discussed in this thread.

    This is the updated workflow

    When someone signs up for a consultation using Pay per View, they are directed to Paypal. Their information is captured as a unique trackingKey which is stored in the wp_wpam_tracking_tokens table.

    So when this user finishes payment, fills out the contact form (Contact Form 7) and successfully schedules an appointment the affiliate is credited with the 5 pounds.

    Just two lines of code you should be aware of

    If you want to replace Contact Form 7, make the change here

    private function add_hooks () {
    		// Modify here if changing contact form
    		add_action('wpcf7_mail_sent',array($this,'integrate_affiliate_code',));
    	}

    And if you want to replace Affiliate Manager with our plugin or increase payouts make the change here.

    // Use a jsonHandler to manually add 5 Pounds to the affiliate
    			$jsonHandler = new WPAM_Util_JsonHandler;
    			// Modify here if you want to increase payouts or switch affiliate plugins
    			$jsonHandler->addTransaction($affiliate, 'credit',5, "Consultation Referral");

    Also at any point you can deactivate my code from the main plugin screen by clicking on deactivate as shown in screenshot.

    I have cleaned up the tables and other temp settings I created on your site, you still need to delete the admin user mudev and the test affiliates you created. Also consider changing all passwords including cPanel, FTP and MySQL at the earliest.

    Cheers
    Jude

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.