Author Topic: Ecommerce Templates plugin  (Read 5470 times)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Ecommerce Templates plugin
« on: June 18, 2007, 01:46:24 am »
This is a plugin for Ecommerce Templates shopping cart software:

Copy the following code into a file named incListMail.php and follow the instructions in the script.
Code: [Select]
<?php// Ecommerce Templates cart plugin by DW// http://listmailpro.com// http://ecommercetemplates.com// to enable:// in vsadmin/inc/incemail.php before this line:// if($doshowhtml)// add this:// include('incListMail.php');// and upload this file to vsadmin/inc// incoming vars:// $custEmail - buyers email// $ordName - buyers name (first and last)// $ordAddInfo - additional info// $ordSessionID// ListMail custom fields// user1 - order 'additional info'// user2 - product id// user3 - product name// only show test output to my IPif($_SERVER['REMOTE_ADDR']=='12.34.56.78') $test=1; else $test='';// get product id via ordSessionID$row=mysql_query("select cartProdID from cart where cartSessionID = '".addslashes($ordSessionID)."';") or print(mysql_error());list($prodid)=@mysql_fetch_row($row);// get product name via product id$row=mysql_query("select pName from products where pID = '$prodid';") or print(mysql_error());list($pname)=@mysql_fetch_row($row);// split up first and last name (yes, I cheated)list($fname,$n1,$n2,$n3)=explode(' ',$ordName);$lname = trim($n1.' '.$n2.' '.$n3);if($test){ echo "verify variables...:<br>$custEmail - buyers email<br>$fname - buyers first name<br>$lname - buyers last name<br>$ordAddInfo - additional info<br>$ordSessionID - session ID<br>$prodid - product id<br>$pname - product name<br>";}// example to change list based on product// if($prodid=='example') $list = '1';// elseif($prodid=='example2') $list = '2';// else $list = '4';// just set list to 4$list = '4';// ListMail database connection// Enter your MySQL Information! (Copy & paste from LM config.php)$sqlhost = 'localhost';$sqluser = 'USERNAME';$sqlpass = 'PASSWORD';$sqldb = 'DATABASE';$link2=mysql_connect($sqlhost,$sqluser,$sqlpass);mysql_select_db($sqldb,$link2);// check if user was previously removed, skip if so, otherwise overwrite_dupes=1$row=mysql_query("select id from lm_users where list = '$list' and email like '".addslashes($custEmail)."' and cnf = '2';") or print(mysql_error());list($removed)=@mysql_fetch_row($row);if($test) echo "removed=$removed<br>";if(!$removed){ // add user to listmail // get listmailpath list($lmp)=@mysql_fetch_row(mysql_query("select listmailpath from lm_config where 1;",$link2)); $url = $lmp."signup.php?list=$list&email=".urlencode($custEmail)."&fname=".urlencode($fname)."&lname=".urlencode($lname)."&overwrite_dupes=1&user1=".urlencode($ordAddInfo)."&user2=".urlencode($prodid)."&user3=".urlencode($pname); if($test) echo "URL=$url<br>";  $fp=fopen($url,'r'); fclose($fp);}mysql_close($link2);?>

Good luck! :D
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

james1

  • Posts: 2
    • View Profile
is plugin good for latest version 5.5.2?
« Reply #1 on: July 09, 2008, 09:45:14 am »
Hi Dean,

Just wanted to check to see if this listmail plugin is valid for the latest version of ecommercetemplates -- 5.5.2.

ListMail Pro is a great piece of software and its invaluable to our business!

Thanks,
James

adele

  • Posts: 22
    • View Profile
    • http://www.fancy-dress.net
Ecommerce Templates plugin
« Reply #2 on: July 11, 2008, 02:09:13 am »
Hi James

I installed it last night on 5.5.3 OK

I thought that it would pick up e-mails from orders placed in ECT but it doesn't at the moment, if that is what it is supposed to do.
Does it have to be configured further, apart from the DB configuration?
I still have my sign up forms on my landing pages, which are still working.
I would like some more information as to what the script does, if any one can explain

Regards

Adele

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Ecommerce Templates plugin
« Reply #3 on: July 14, 2008, 07:13:36 am »
I believe this plugin was indeed made to add buyers to ListMail.  Did you make sure to add the "include('incListMail.php');" line to the ECT file as mentioned in the script?

If that doesn't work there may be some changes in the new version of ECT that prevent this plugin from working.  To test I would start by adding your IP where indicated so additional output is given.

You can find your IP here:
http://www.listmailpro.com/ip.php
or even (no affiliation): http://whatismyip.com

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

adele

  • Posts: 22
    • View Profile
    • http://www.fancy-dress.net
Ecommerce Templates plugin
« Reply #4 on: July 14, 2008, 10:13:08 am »
Hi Dean

Yes the file is in the correct place so is the include

I have put my IP in this if($_SERVER['REMOTE_ADDR']=='12.34.56.78') $test=1; else $test='';

I have tried a test order but not completed to payment
I went into ECT orders and manually authorised payment
What do I do next?

Regards

Adele