Jump to content

Peak Displays

Members
  • Content count

    16
  • Joined

  • Last visited

Profile Information

  • Real Name
    Paul Clements
  1. Peak Displays

    OSC-Affiliate

    Hi Frank, Don't worry about it. I figure out how to do it, although it's a bit messy it works a treat. I changed the following in includes/affliate_checout_process.php: // if ($HTTP_SESSION_VARS['affiliate_ref']) { To: //BOF Customer Affiliate $customers_aff_raw = "select customers_affiliate as count from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'"; $customers_aff_query=tep_db_query($customers_aff_raw); $customers_aff_count = tep_db_fetch_array($customers_aff_query); $affiliate_ref = $customers_aff_count['count']; if ($affiliate_ref > 0) { // EOF Customer Affiliate I know the whole count thing is unecessary but it kept printing up array and my php is so bad I couldn't figure it out. Anyway using the above pulls the customers_affiliate from the customers table and when the checkout process proceeds it records the affiliate for that number on the database. I then modified create_account.php so that it will pull the affiliate code from sessions and write it to the customers_affiliate on the customers table and it now works exactly how I want it too. I need to check that it's still fine on cookies etc but I don't see why it won't be. Cheers Paul
  2. Peak Displays

    OSC-Affiliate

    Hmm what version are you using, the same bit of code in my affiliate_application_top.php doesn't look like that, it looks like this: if (($HTTP_GET_VARS['ref'] || $HTTP_POST_VARS['ref'])) { if ($HTTP_GET_VARS['ref']) $affiliate_ref = $HTTP_GET_VARS['ref']; if ($HTTP_POST_VARS['ref']) $affiliate_ref = $HTTP_POST_VARS['ref']; if ($HTTP_GET_VARS['products_id']) $affiliate_products_id = $HTTP_GET_VARS['products_id']; if ($HTTP_POST_VARS['products_id']) $affiliate_products_id = $HTTP_POST_VARS['products_id']; if ($HTTP_GET_VARS['affiliate_banner_id']) $affiliate_banner_id = $HTTP_GET_VARS['affiliate_banner_id']; if ($HTTP_POST_VARS['affiliate_banner_id']) $affiliate_banner_id = $HTTP_POST_VARS['affiliate_banner_id']; I'm having problems calling the customer_id into the scripts too, in order to make it work. Frankly I haven't got a clue and there is no indication on how to do it in the script as you suggest I'm afraid. Cheers Paul
  3. Peak Displays

    OSC-Affiliate

    I thought maybe something like this. Change: if ($HTTP_SESSION_VARS['affiliate_ref']) { To: $sql_data_array = array('customers_affiliate' => $customers_affiliate); if ($customers_affiliate > 0) { $customers_affiliate = $affiliate_ref; But that doesn't work. Anyone know what I'm doing wrong? Cheers Paul N.B the field was customers_affiliate not customer_affiliate as I put in the other post.
  4. Peak Displays

    OSC-Affiliate

    Yeah I kinda agree, So I made a field in the Customer table called customer_affiliate. I now need to change the call function to pull the ref from customer_affiliate rather than looking for affiliate_ref in the cookie or sessions. I'm not too good with things like this. I've put in an affiliate code on my test account in the customer_affiliate. So once I get includes/affiliate_checkout_process.php to pull that affiliate code I will then go back to create_account.php and worry about making that script update customer_affiliate with the affiliate_ref. I presume I need to change the following in includes/affiliate_checkout_process.php: if ($HTTP_SESSION_VARS['affiliate_ref']) to be an 'if' statement that pulls the ref from customer_affiliate, any one have any ideas what I ought to change it too? Thanks Paul
  5. Peak Displays

    OSC-Affiliate

    Hi all, Just wondering if you can help me perform a modification to the affiliate contribution. Basically what I want to do is record the affiliate number to customer accounts when they create an account. I figure this could be added in create_account.php, I'd also need to modify checkout_process.php or affiliate_checkout_process.php (Includes) in order to call the recorded affiliate number from the customers account on the database. I want to do this so that the affiliate who promotes the website to the customer gets a percentage of everything that customer buys in the future. Anyone got any ideas how I go about doing this please? I'll give it a go myself but it might take some time and if others have more of a clue of how to do this quickly it'd be a huge help. Cheers
×