Jump to content

Shareasale Integration With Cubecart


Guest RAWRoutLOWD

Recommended Posts

Guest RAWRoutLOWD

I need help with setting up my shareasale account but I've never used it before so I'm pretty confused. Is anyone familiar with shareasale?

Basically, what I need to do is place a bit of code onto the confirmation page of cubecart. I've already figured out the confirmation page is "confirmed.tpl" within the "content" folder of "styletemplates". But what I'm confused with is the code that I have to place.

The following is an example of the code that is placed on the confirmation page:

"https://shareasale.com/sale.cfm?amount=14.95&tracking=475&transtype=sale&merchantID=31"

I'm not sure what variable I'm supposed to assign to 14.95, which is the price, and 475, which is the tracking code. If anyone can give me some advice I would certainly appreciate it. Thanks a lot.

-Ray

Link to comment
Share on other sites

  • 3 months later...

  • 2 months later...
Guest mtmpro

The problem is, the code share a sale gives is slightly problematic AND - more importantly, PAYPAL DOESN'T SEND THE CART INFO BACK!!!

So here's what you need to do - (there's one extra part of code, if someone wants to edit it, cool - but I pulled an all-nighter culling info from different forums to figure out the problem, I just don't care enough to tighten up that one loose screw.)

In the confirmed.inc.php file, not only must you add share a sale's code, (found on their site - http://www.shareasale.com/m-setup-step4-new.cfm)

There are two pages where you need to make changes.

In the page: confirmed.inc.php, just below the line:

$confirmation->assign("LANG_ORDER_SUCCESSFUL",$lang['confirmed']['order_success']);

add the following code:

$sasmerchantID = "XXXX";

$sastranstype = "sale";

$sasafforder = $basket['cart_order_id'];

$sasaffamount = $basket['subTotal'];

$confirmation->assign("VAL_SAS_ID",$sasmerchantID);

$confirmation->assign("VAL_SAS_TYPE",$sastranstype);

$confirmation->assign("VAL_SAS_ORDER",$sasafforder);

$confirmation->assign("VAL_SAS_AMOUNT",$sasaffamount);

Where you replace XXXX with your merchantID value.

In the page: confirmed.tpl, just below the line, <p>{LANG_ORDER_SUCCESSFUL}</p> add the following code:

<div id="sasdiv"> <img src="https://shareasale.com/sale.cfm?amount={VAL_SAS_AMOUNT}&amp;tracking={VAL_SAS_ORDER}&amp;transtype={VAL_SAS_TYPE}&amp;merchantID={VAL_SAS_ID}" width="1" height="1"></div>

But for us, we also had to take into consideration the fact that paypal wasn't sending the cart information back to the confirmation page

We got around that with a post from Alan T on these forums that brings the cart info back on the confirmation page

http://forums.cubecart.com/index.php?showtopic=28917

// 2. Include function which returns ture or false

$success = success();

if($basket['gateway'] == "PayPal"){

$result = $db->select("SELECT cart_order_id, prod_total, subtotal FROM ".$glob['dbprefix']."CubeCart_order_sum WHERE sec_order_id = ".$db->mySQLSafe($_GET['tx']) );

$basket['cart_order_id'] = $result[0]['cart_order_id'];

$order[0]['prod_total'] = $result[0]['prod_total'];

$basket['subTotal'] = $result[0]['subtotal'];

}

$confirmation = new XTemplate ("skins/".$config['skinDir']."/styleTemplates/content/confirmed.tpl");

Once you're getting the info back from paypal, it should work.

The only other oddity I found, for some reason, was that to get the code to workk, I had to remove the code in confirmation.tpl from inside it's div tag, AND place it at the end of the doc, not inside any other div, right before the last line of the file.

Don't know why that's so.

But that helped me. Hope this info helps y'all.

/\/\

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...