Post by robster » Mon Feb 28, 2011 7:32 pm

I am trying to integrate the above affiliate system with my 1.4.9.2 installation. My site is very heavily customised so no I won't be updating to 1.5.0 to use the built in affiliate system.

Anyway, JAM does not include integration with OpenCart as standard but do suggest using 'Hidden Image tag' code to stick in the checkout success page. However I am not clever enough to be able to answer the questions their wizard asks to create the necessary code.

The wizard asks for:

Sale Amount Variable

AND

Transaction ID Variable

Neither of which I understand. Can someone help me with this?

Alternatively, they do list a code for Zencart and i wondered if some clever person could suggest an edit to this code to work with OpenCart:

########################################
## START JAM INTEGRATION WITH ZENCART ##
########################################

$JAM = $db->Execute("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '".(int)$orders->fields['orders_id']."' AND class = 'ot_subtotal'");
$TotalAmount = number_format($JAM->fields['value'],2,'.',',');
$TransID = $JAM->fields['orders_id'];
echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"http://www.homeprintstudio.com/affiliat ... "></script>";

######################################
## END JAM INTEGRATION WITH ZENCART ##
######################################

Any suggestions please?

Rob

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by JAY6390 » Mon Feb 28, 2011 7:38 pm

Hey Rob. The sale amount variable will just be the order total. The transaction id will be the order id
You're likely going to need to put this code into your payment method's template, whatever that is, and use the total and order id from those

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by robster » Mon Feb 28, 2011 7:46 pm

Hi Jay, thanks for answering.

I think perhaps I didn't ask the right question..... doh! LOL :)

The wizard is actually asking what code OpenCart uses for these two items:

The default suggestions are:

Sale Amount Variable Code = amount

AND

Transaction ID Variable Code = trans_id

I guess I need to know if 'amount' and 'trans_id' are the correct codes used by OpenCart.

Rob

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by JAY6390 » Mon Feb 28, 2011 8:15 pm

Hey Rob. That will again depend on the payment gateway if I'm reading your question correctly. What payment gateway are you using?

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by robster » Mon Feb 28, 2011 8:21 pm

Err sorry yeah!

I am using PayPal Standard

Rob

Attachments

Screen shot 2011-02-28 at 12.23.21.png

Screen shot 2011-02-28 at 12.23.21.png (40.85 KiB) Viewed 12622 times


I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by robster » Tue Mar 01, 2011 5:45 am

Errr

Any ideas anybody?

Cheers

Rob

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by JAY6390 » Tue Mar 01, 2011 8:45 am

you can use

Code: Select all

$this->session->data['order_id']
for the transaction id
In order to pass the total you will need to edit your controller for the payment

Code: Select all

/catalog/controller/payment/pp_standard.php
Find this line

Code: Select all

$remaining_total = $total - $product_total - $tax_total - $shipping_total + $discount_total;
after it put

Code: Select all

$this->data['transaction_amount'] = $total;
then you can use

Code: Select all

$transaction_amount
for the amount field

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by robster » Tue Mar 01, 2011 2:04 pm

Thanks Jay

I will try this later today when I wake up properly.

Rob

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by robster » Tue Mar 01, 2011 5:52 pm

Hi Jay

OK I did what you suggested and now have the code that I need to integrate into my site:

<img border="0" src="http://www.homeprintstudio.com/affiliat ... ion_amount&
trans_id=$this->session->data['order_id']" width="1" height="1">

Now the problem I have is that they suggest I put this code into the payment success page. However I am not sure where is best. Sure there is a checkout/success page (which if I am correct is situated in /catalog/view/theme/MYTEMPLATE/common/success.tpl. Is that correct?

The problem I see is that .tpl file is also used when logging out from the site - and maybe other places too, just with different text depending on what's occuring! So where would you suggest I put this code (polite answers please) to ensure that it is just invoked after a successful sale.

Thanks so much for your hlp.

Rob

By the way, these are the instructions from JROX:

To integrate JAM into your website / application using a Hidden Image Tag, use the following directions:

1. Click on Settings>System Integration, select Image Tag on the Integration Type drop down list.
2. Enter the variable name set by your payment processor for amount as the Sale Amount variable to use.
3. Enter the variable name set by your payment processor for transaction or order ID as the Transaction ID variable to use.
4. Enable and enter any more custom variables you want to record as specified by your payment processor. These may include product ID, customer ID, etc. You can name up to 5 different custom variables of your choice.
5. Click Save Integration Settings.
6. Open up your php landing or thank you page, and copy and paste the PHP Code into your web page. Make sure that all variables are correct.

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by SXGuy » Tue Mar 01, 2011 9:10 pm

catalog/language/english/checkout/sucess.php

Find

Code: Select all

$_['text_message']  = '<p>Your order has been successfully processed!</p><p>You can view your order history by going to the <a href="%s">My Account</a> page and by clicking on <a href="%s">History</a>.</p><p>Please direct any questions you have to the <a href="%s">store owner</a>.</p><p>Thanks for shopping with us online!</p>';
Replace with

Code: Select all

$_['text_message']  = '<img border="0" src="http://www.homeprintstudio.com/affiliates/sale.php?amount=$transaction_amount&
trans_id=$this->session->data['order_id']" width="1" height="1"><p>Your order has been successfully processed!</p><p>You can view your order history by going to the <a href="%s">My Account</a> page and by clicking on <a href="%s">History</a>.</p><p>Please direct any questions you have to the <a href="%s">store owner</a>.</p><p>Thanks for shopping with us online!</p>';
That should work, it passes html so no reason why it cant grab php?

Do the same for every language file you use.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by JAY6390 » Tue Mar 01, 2011 9:22 pm

That won't work. At that point, the order id has been removed from the session...even if it did, the php in the string wouldn't be executed. There's no simple way around this I'm afraid Rob. Didn't realise you needed to put it on the success page, I thought you just needed to associate an order id with an affiliate

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by robster » Tue Mar 01, 2011 9:23 pm

Yes I tried this SXGuy but I get:

Parse error: syntax error, unexpected T_STRING in /home/homeprin/public_html/store/catalog/language/english/checkout/success.php on line 7

on checkout/success page!

Thanks anyway for helping. Damn there must be a solution!

Rob

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by robster » Tue Mar 01, 2011 9:28 pm

Jay

I need to be able (according to JROX) to associate a sales value to pay % commission to affiliate. Quite frankly all I want to do is pay the affiliate for having the banner on their site and for someone to click it to make them money... how hard can it be?

I think you are correct. I could always put it in the checkout/confirm page could I not? At least if a customer has got that far he is likely to go through with the sale.

OR, how about this. How about a custom success page? Not sure how to create it or how to make paypal come back to it but seem like a possibilty do you think?

Rob

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by robster » Wed Mar 02, 2011 1:12 am

Well chaps, i contacted JROX to ask if they planned to support OpenCart and they told me that they had no immediate plans to. I told them that OpenCart was a fast upcoming force to be reckoned with, yadda yadda and they told me that they would 'have a go' at integrating with OpenCart for me..... for a mere $99.

Taxi !!!!!

Rob

Actually I am checking out Vaffiliate and although it doesn't look as good and was written with no real grasp of the english language it seems quite easily to edit css, txt etc. and has an opencart integration as standard.

Watch this space.

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by SXGuy » Wed Mar 02, 2011 1:17 am

ok...

your right, the data does get unset before it reaches that page, however, you could pass the two types of data you need to the sucess page before the controller file unsets the data.

Why not post the two peices of data to the sucess page before it is unset in the sucess.php controller file.
Then the sucess view file grabs that data if posted and creates the banner?

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by ecomensions » Mon Mar 21, 2011 11:49 am

Like what SXguy said. Do the following

Add to catalog/controller/checkout/success.php at line 5 (must be before $this->cart->clear();)

Code: Select all

$this->data['jam_total'] = $this->cart->getTotal;
$this->data['jam_order_id'] = $this->session->data['order_id'];
Then in checkout/success.tpl add this:

Code: Select all

<img border="0" src="http://www.homeprintstudio.com/affiliates/sale.php?amount=<php echo $jam_total; ?>&
trans_id=<php echo $jam_order_id; ?>" width="1" height="1">
I haven't tried it personally, but it should work.

Ecommerce Extensions - Need custom development work? Feel free to send us a PM at anytime to discuss things further.


Newbie

Posts

Joined
Thu Mar 17, 2011 10:19 pm


Post by robster » Mon Mar 21, 2011 5:22 pm

Thanks for your kind replies - I will go and try this today.

robster

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by robster » Tue Mar 22, 2011 5:52 pm

Ho

So.....

for 'Sale Amount Variable' do I enter: $this->cart->getTotal
and
for 'Transaction ID Variable' do I enter: $this->session->data['order_id']

Thanks

robster

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by ogoo80 » Tue Apr 10, 2012 12:57 am

Hi,

Wondering if you got a solution to this finally.

Am running OC 1.5.3 and am trying to integrate JAM Affiliate program with my OC installation. Please I want to know how you got through with yours.

Please any kind suggestion will be appreciated.


Thanks

Newbie

Posts

Joined
Tue Apr 10, 2012 12:39 am

Post by robster » Tue Apr 10, 2012 1:35 am

I gave up in the end. Sorry :(

Rob

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK
Who is online

Users browsing this forum: No registered users and 8 guests