Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Snap.com advertising modification

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-06-2005, 12:28 PM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default 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.
__________________
4.4
Code:
Hello World
Reply With Quote
  #2  
Old 12-06-2005, 02:28 PM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

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}
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #3  
Old 12-06-2005, 03:15 PM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default

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
__________________
4.4
Code:
Hello World
Reply With Quote
  #4  
Old 12-24-2005, 08:15 PM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default

Anybody????????????????????????
__________________
4.4
Code:
Hello World
Reply With Quote
  #5  
Old 01-09-2006, 08:02 AM
 
kitestailstoys kitestailstoys is offline
 

Newbie
  
Join Date: Jan 2005
Location: Delaware
Posts: 1
 

Default 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.
__________________
X-Cart Gold 3.4.12 / 4.0.9
Windows
Delaware
Reply With Quote
  #6  
Old 01-09-2006, 09:21 AM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default

kitestailstoys, could you please post your entire order_message.tpl

Thanks,
David
__________________
4.4
Code:
Hello World
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020