iDEV Forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

IDEVSPOT COMMUNITY FORUMS. -----( ( ( NOT FOR OFFICIAL TECH SUPPORT ) ) )-----

Author Topic: VirtueMart Integration?  (Read 2971 times)

0 Members and 1 Guest are viewing this topic.

angeljs

  • Newbie
  • *
  • Posts: 5
    • View Profile
VirtueMart Integration?
« on: January 16, 2008, 11:41:54 AM »
Hi, I've just purchased this script and so far love what I see.  ;D

Would it be possible to integrate this with VirtueMart for Joomla, as an affiliate program is the only thing missing from it?
Logged

arron

  • iDevSpot
  • Administrator
  • Hero Member
  • *****
  • Gender: Male
  • Posts: 1202
    • View Profile
    • WWW
Re: VirtueMart Integration?
« Reply #1 on: January 16, 2008, 08:18:57 PM »
Thanks very much.
I can't advise with accuracy because I have not used the application your mentioned, but as long as you can modify the  Paypal purchase code (AND possibly) the IPN script, you should be able to integrate NixieAffilaite using the general instructions for integration with other IPN scripts. Found in Nixie admin,

-Arron
Logged

Join our Facebook Fan Page to receive special offers & update information : http://www.facebook.com/pages/iDevSpot/157097554841

angeljs

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: VirtueMart Integration?
« Reply #2 on: January 17, 2008, 10:11:31 AM »
Hmm...ok, I'll give it a try and let you know how it goes. Thanks for the fast reply.
 ;D
Logged

angeljs

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: VirtueMart Integration?
« Reply #3 on: January 18, 2008, 07:05:03 AM »
Hi, I've managed to find where to add the integration code, but the piece I'm having problems with is this:

?custom="$_SERVER[REMOTE_ADDR]";

My Paypal payment button looks like this:

<?php
$url = "https://www.paypal.com/cgi-bin/webscr";
$tax_total = $db->f("order_tax") + $db->f("order_shipping_tax");
$discount_total = $db->f("coupon_discount") + $db->f("order_discount");
$post_variables = Array(
"cmd" => "_xclick",
"business" => PAYPAL_EMAIL,
"receiver_email" => PAYPAL_EMAIL,
"item_name" => $VM_LANG->_PHPSHOP_ORDER_PRINT_PO_NUMBER.": ". $db->f("order_id"),
"order_id" => $db->f("order_id"),
"invoice" => $db->f("order_number"),
"amount" => round( $db->f("order_subtotal")+$tax_total-$discount_total, 2),
"shipping" => sprintf("%.2f", $db->f("order_shipping")),
"currency_code" => $_SESSION['vendor_currency'],"first_name" => $dbbt->f('first_name'),
"last_name" => $dbbt->f('last_name'),
"address_street" => $dbbt->f('address_1'),
"address_zip" => $dbbt->f('zip'),
"address_city" => $dbbt->f('city'),
"address_state" => $dbbt->f('state'),
"address_country" => $dbbt->f('country'),
"image_url" => $vendor_image_url,
"return" => SECUREURL ."index.php?option=com_virtuemart&page=checkout.result&order_id=".$db->f("order_id"),
"notify_url" => SECUREURL ."administrator/components/com_virtuemart/notify.php",
"cancel_return" => SECUREURL ."index.php",
"undefined_quantity" => "0",
"test_ipn" => PAYPAL_DEBUG,
"pal" => "NRUBJXESJTY24",
"no_shipping" => "1",
"no_note" => "1"
);
if( $page == "checkout.thankyou" ) {
$query_string = "?";
foreach( $post_variables as $name => $value ) {
$query_string .= $name. "=" . urlencode($value) ."&";
}
mosRedirect( $url . $query_string );
} else {

echo '<form action="'.$url.'" method="post" target="_blank">';
echo '<input type="image" name="submit" src="http://images.paypal.com/images/x-click-but6.gif" border="0" alt="Make payments with PayPal, it is fast, free, and secure!" />';

foreach( $post_variables as $name => $value ) {
echo '<input type="hidden" name="'.$name.'" value="'.$value.'" />';
}

echo '</form>';

}
?>

Not being a programmer, I'm just not sure how to add the code from your script to the end of the nofify url to register the sale. Any advice would be very much appreciated.

Thanks
Angela


Edit: I've added ?custom=$_SERVER[REMOTE_ADDR]
at the end of the notify_url...is this right?
« Last Edit: January 19, 2008, 03:58:15 AM by angeljs »
Logged

angeljs

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: VirtueMart Integration?
« Reply #4 on: January 25, 2008, 11:39:36 AM »
Ok, I think I got that sorted, but I'm receiving a strange message when I try to access the site:

Notice: Use of undefined constant REMOTE_ADDR - assumed 'REMOTE_ADDR' in /home/******/public_html/bargain/templates/ef_live2/index.php on line 60

Notice: Undefined index: affid in /home/******/public_html/nixie/nixie.php on line 2

Notice: Undefined variable: upone in /home/******/public_html/nixie/nixie.php on line 17

Notice: Undefined variable: click in /home/******/public_html/nixie/nixie.php on line 23

Have I missed something I should have done to create this message?

I added the following code to the index page:


<?php include "/home/******/public_html/nixie-agent/sqlinf.php";
$aip = $_SERVER[REMOTE_ADDR];
include "/home/*******/public_html/nixie/nixie.php";
?>
« Last Edit: January 25, 2008, 11:41:31 AM by angeljs »
Logged