Forums / General Questions / Zen cart and JAM Affiliate

Zen cart and JAM Affiliate

Locked

Started by revenant on 19 Apr 2007, 9:01 PM · Views: 2,168

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
19 Apr 2007, 9:01 PM
#1
revenant avatar

revenant

New Zenner

Join Date:
Sep 2004
Posts:
68
Plugin Contributions:
0

Zen cart and JAM Affiliate

Is there anyone who integrated this witn Zen Cart and manage to find a solution how to add a single product comission.

Like if your having a campaign for 1 product and want to pay affiliates 10% on each sold. If customer that comes from an affiliate refirring link and checks out without this specific product , NO commission will be paid.

If there`s anybody out the who can or have done this, please point me in right direction.

All help would have been appreciated.

P.S. Bought the new JAM 1.6 version and before that Postaffiliate Pro 3, hope I dont have to throw abother affiliate program in garbage because of this function (that is required for me!)

Thanks in advance !

19 Apr 2007, 9:35 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,738
Plugin Contributions:
0

Re: Zen cart and JAM Affiliate

Did you think to ask the affiliate folks the question before buying the programs? :lookaroun

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

19 Apr 2007, 9:49 PM
#3
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Zen cart and JAM Affiliate

you can create an affiliate on a single product,
just use that products URL when you setup the affiliate links

Zen cart PCI compliant Hosting

20 Apr 2007, 11:21 AM
#4
revenant avatar

revenant

New Zenner

Join Date:
Sep 2004
Posts:
68
Plugin Contributions:
0

Re: Zen cart and JAM Affiliate

Kim:

Did you think to ask the affiliate folks the question before buying the programs? :lookaroun

No, stupid enough afterwards

Merlinpa1969:

you can create an affiliate on a single product,
just use that products URL when you setup the affiliate links

Yes, I know but that just takes you to this productpage, it still gives you commision if buying another product.

21 Apr 2007, 5:05 PM
#5
revenant avatar

revenant

New Zenner

Join Date:
Sep 2004
Posts:
68
Plugin Contributions:
0

Re: Zen cart and JAM Affiliate

First, homemade code that seems to be done by a blind man ;) , anyway maybe someone can help me make this affiliate code (marked below) right?

<?php // // +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | <http://www.zen-cart.com/index.php> | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | <http://www.zen-cart.com/license/2_0.txt>. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | [email protected] so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id: header_php.php,v 1.3 2004/01/14 14:19:56 wilt Exp $ // // if the customer is not logged on, redirect them to the shopping cart page if (!$_SESSION['customer_id']) { zen_redirect(zen_href_link(FILENAME_SHOPPING_CART)); } $notify_string=''; if (isset($_GET['action']) && ($_GET['action'] == 'update')) { $notify_string = 'action=notify&'; $notify = $_POST['notify']; if (is_array($notify)) { for ($i=0, $n=sizeof($notify); $i<$n; $i++) { $notify_string .= 'notify[]=' . $notify[$i] . '&'; } if (strlen($notify_string) > 0) $notify_string = substr($notify_string, 0, -1); } if ($notify_string == 'action=notify&') { zen_redirect(zen_href_link(FILENAME_DEFAULT, '', 'SSL')); } else { zen_redirect(zen_href_link(FILENAME_DEFAULT, $notify_string)); } } require(DIR_WS_MODULES . 'require_languages.php'); $breadcrumb->add(NAVBAR_TITLE_1); $breadcrumb->add(NAVBAR_TITLE_2); $global_query = "select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$_SESSION['customer_id'] . "'"; $global = $db->Execute($global_query); if ($global->fields['global_product_notifications'] != '1') { $orders_query = "select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "' order by date_purchased desc limit 1"; $orders = $db->Execute($orders_query); $products_array = array(); $products_query = "select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders->fields['orders_id'] . "' order by products_name"; $products = $db->Execute($products_query); while (!$products->EOF) { $products_array[] = array('id' => $products->fields['products_id'], 'text' => $products->fields['products_name']); $products->MoveNext(); } } /////////////////////////////////////////////////////////// ////////////////// AFFILIATE CODE START /////////// /////////////////////////////////////////////////////////// $jam1 = $db->Execute("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '".(int)$orders->fields['orders_id']."' AND class = 'ot_subtotal'"); $jam_zen_1 = (number_format($jam1->fields['value'],2)); $jam_zen_2 = $jam1->fields['orders_id']; $aff_query = $db->Execute("select products_id from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders->fields['orders_id'] . "' order by products_id"); if ($product_id == 1436) { print "<script language=\"JavaScript\" type=\"text/javascript\" src=\"/affiliates/sale.php?amount=$jam_zen_1&trans_id=$jam_zen_2&program_id=3\"></script>"; } else { print "<script language=\"JavaScript\" type=\"text/javascript\" src=\"/affiliates/sale.php?amount=$jam_zen_1&trans_id=$jam_zen_2&program_id=1\"></script>"; } /////////////////////////////////////////////////////////// ////////////////// AFFILIATE CODE END ////////////// /////////////////////////////////////////////////////////// ?>