X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Snap.com advertising modification (https://forum.x-cart.com/showthread.php?t=18471)

davidsaldana 12-06-2005 12:28 PM

Snap.com advertising modification
 
Hello,

I am new to x-cart so please bear with me on this one.

I am looking to set up a pay per action and percentage of sale marketing campaign with www.snap.com. In order to do this a block of php code must be entered into our software. The code is as follows:

Code:


<?php

// SNAP.COM VCPA TRACKING CODE v2.0 PHP VERSION
// Instructions:
// Modify this PHP script as indicated below in the comments. When
// you are done, paste it in the confirmation or thank you page of
// your website. This is the page you display when a transaction is
// completed. It generally thanks your customer for the order. An
// assumption is made that this page contains the amount of the
// sale that can be passed to this PHP script.

// Replace CAPITALIZED TEXT below as indicated.

// Replace ADVERTISER_ID below with your snap.com advertiser ID. You
// can find your advertiser ID in your signup email or on any of the main
// pages inside your account. If your advertiser ID is 321, for example,
// the following line would read: $advertiser_id = 321;

$advertiser_id = ADVERTISER_ID;

// Replace PASSKEY below with your snap.com tracking passkey you
// entered in the get tracking code wizard. If you change the passkey
// in the wizard, you must also change it here. The passkey in this
// tracking code must match the passkey stored in your account.

$passkey = 'PASSKEY';

// Replace ITEMCOST below with the variable from your system that contains
// the actual dollar amount of the sale. For example, if the variable
// your system uses is called $totalsale, then you would change the
// following line to say: $sale_amount = $totalsale;

$sale_amount = ITEMCOST;

// Do not modify the following lines

$signature = md5($advertiser_id . $sale_amount . $passkey);

$query_string = "aid=$advertiser_id&amt=$sale_amount&sig=$signature";

$pixel_url = "https://adsys.snap.com/count/?$query_string";

// The <img ...> tag below must be embedded between the HTML <BODY></BODY>
// tags in this page.

?>
[img]<?php echo $pixel_url; ?>[/img]




I am not sure where the best place to put this code would be. I do have some general ideas, but havent come to a certain conclusion. I would like to minimize the risk that someone makes a purchase, but doesnt follow through with the payment, and I still get charged by snap.com. I dont think I can avoid this risk, seeing as our site takes payment in the form of credit cards, gift certificates, and paypal, of which the credit cards and paypal payments are done via a third party website.

Please let me know if you can help me with this problem, because I would really like to use this less risky version of marketing our site.

cotc2001 12-06-2005 02:28 PM

it needs to go into order_message.tpl

remove the
<?php

enclose the whole thing in
{php}


{/php}

You'd need to find out what variable goes into the ITEMCOST though

could be {$order_total}

davidsaldana 12-06-2005 03:15 PM

Thanks Cotc.

I took a look at order_message, and am still a little confused.
Does it matter where I put the code (inside or outside of the loop)?
Also, can I just call reference {orders_total} without doing any preliminary modifications?

I have included the order_message.tpl code below:

Code:

{* $Id: order_message.tpl,v 1.32.2.1 2004/09/14 06:02:27 max Exp $ *}
{if $this_is_printable_version eq ""}
{capture name=dialog}
<FONT class="ProductDetails">{$lng.txt_order_placed}</FONT>



<FONT class="ProductDetails">{$lng.txt_order_placed_msg}</FONT>


{/capture}
{include file="dialog.tpl" title=$lng.lbl_confirmation content=$smarty.capture.dialog extra="width=100%"}
{/if}


{capture name=dialog}
{section name=oi loop=$orders}
{include file="mail/html/order_invoice.tpl" is_nomail='Y' products=$orders[oi].products giftcerts=$orders[oi].giftcerts userinfo=$orders[oi].userinfo order=$orders[oi].order}





{if $active_modules.Interneka ne ""}
{ include file="modules/Interneka/interneka_tags.tpl" }
{/if}
{/section}
{if $this_is_printable_version eq ""}
<TABLE border="0" width="100%">
<TR>
<TD align="left">{include file="buttons/button.tpl" button_title=$lng.lbl_print_invoice href="order.php?mode=invoice&orderid=`$orderids`" target="preview_invoice"}</TD>
<TD align="right">{include file="buttons/button.tpl" button_title=$lng.lbl_continue_shopping style="button" href="home.php"}</TD>
</TR>
</TABLE>
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_invoice content=$smarty.capture.dialog extra="width=100%"}


Thanks,
David

davidsaldana 12-24-2005 08:15 PM

Anybody????????????????????????

kitestailstoys 01-09-2006 08:02 AM

Snap.com Response
 
I have gotten setup on Snap.com. Here are some comments, and my own questions:

Question:

In the directions, snap tells you to put

[img]<?php echo $pixel_url; ?>[/img]

between the Html <body> </body> tags. There are no such body tags. In the main part of the order_message.tpl code I put it (my insertion is in bold)







[img]<?php echo $pixel_url; ?>[/img]

{if $active_modules.Interneka ne ""}

Is this right? Does anybody know for sure?


Comments:

1. I put the Snap Code at the end of the order_message.tpl code. I even completely surrounded it with

{* SNAP.COM* } {* /SNAP.COM*}

so I can reference it easier, later.

2. I am not sure if it is right, but for the ITEMCOST variable, I used

$cart.subtotal

I initially used the

$order_total

but since I used the % method of being charged on Snap, I was concerned it would use the total with shipping costs to charge my account. I hope subtotal is the cart totals, less the shipping costs.

3. It does appear I have been successul getting setup, although my keywords have not seen that much action or sales.

davidsaldana 01-09-2006 09:21 AM

kitestailstoys, could you please post your entire order_message.tpl

Thanks,
David


All times are GMT -8. The time now is 11:15 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.