Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHPList integration to OsCommerce


higgalls

Recommended Posts

got it working .. works great, but i have two questions;

 

- deleting customer in customers.php is still not deleting email from phplist. Any fix for this?

- is it possible to set somewhere that every registered customer is automatically added to newsletter. Of course he is able to unsubsrcibe later .. In this case checkbox would be hidden

 

thanx for answers!

Edited by gregy
Link to comment
Share on other sites

  • Replies 116
  • Created
  • Last Reply

Top Posters In This Topic

got it working .. works great, but i have two questions;

 

- deleting customer in customers.php is still not deleting email from phplist. Any fix for this?

- is it possible to set somewhere that every registered customer is automatically added to newsletter. Of course he is able to unsubsrcibe later .. In this case checkbox would be hidden

 

thanx for answers!

 

- If i remember, there isnt any code in the contrib for deleting customers email from phplist when you delete a customer. Should be easy to implement using the forgeinkey.

 

- YOu could change the checkbox field in create_account.php to a hidden field with the same values of the checked when is checked or deleting the checkbox field from the form and set the $newsletter variable to true deleting the surrounding if statment.

Link to comment
Share on other sites

thanx for the answer .. since i'm no programer or coder i wonder how these lines should look like?

 

		<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
			<td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>

 

thanks for support .. if someone can add lines for deleting emails in customers.php then this contrib. would be awesome!

Link to comment
Share on other sites

Try deleting this:

 

	  <tr>
	<td class="main"><b><?php echo CATEGORY_OPTIONS; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
			<td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>

 

Search for:

 

	if (isset($HTTP_POST_VARS['newsletter'])) {
  $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
} else {
  $newsletter = false;
}

 

Change it to:

 

	  $newsletter = true;

 

 

That should do what you want, later..

Link to comment
Share on other sites

great! .. works like a charm! Thank you a lot.

 

Now, i was thinking, what if user try to create an account with already entered email in phplist database, cause he was already signed up for newsletter? .. would script ignore email? Oscommerce will register customer, cause mail is not in osc database .. what will phplist say?

 

Should i test this case?

Link to comment
Share on other sites

great! .. works like a charm! Thank you a lot.

 

Now, i was thinking, what if user try to create an account with already entered email in phplist database, cause he was already signed up for newsletter? .. would script ignore email? Oscommerce will register customer, cause mail is not in osc database .. what will phplist say?

 

Should i test this case?

 

The customer will be registered to oscommerce as normal, if the user tick the checkbox he will be suscribed to the newsletter, set to confirmed and get a forgein key (customer id). If the user doesn't tick the box and he is already in phplist, he will be only be deleted from the newsletter assigned list.

Link to comment
Share on other sites

  • 2 weeks later...

How can I update my existing users who have chosen to receive the newsletter?

 

Is it a matter of copying the email address to the PHPList database and setting the foreign key to their customer ID?

 

Do any changes have to be made to the customer entries in the OSC database?

 

Thanks

Read the forum rules...

Link to comment
Share on other sites

I've spotted an error.

In admin/customers.php the newsletter field still reads from the old database.

Add this line below

 

Below:

while ($customers = tep_db_fetch_array($customers_query)) {

 

 

Add:

	 // PHPlist PHPlist Newsletter add-on
		require(DIR_WS_INCLUDES . '/phplist_define.php'); //get the phplist specifics


	$existing_email_query = tep_db_query("select id, email, foreignkey from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "user_user where email =  '" . $customers['customers_email_address'] . "'"); //check for existing by email address
	$existing_user_query = tep_db_query("select id, foreignkey, email from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "user_user where foreignkey = " . $customers['customers_id'] . ""); //check for existing by phplist userid in case they subscribed using another method.

	$existing_email = tep_db_fetch_array($existing_email_query);
	$existing_user = tep_db_fetch_array($existing_user_query);

	if (tep_db_num_rows($existing_user_query) > 0) //check for user subscription
	  $newsletter_query = tep_db_query("select userid from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "listuser where listid = " . PHPLIST_LISTNO . " and userid = " . $existing_user['id'] . "");
	else
	  $newsletter_query = tep_db_query("select userid from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "listuser," . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "user_user where listid = " . PHPLIST_LISTNO . " and userid = id and email = '" . $customers['customers_email_address'] . "'");
	$customers['customers_newsletter'] = ((tep_db_num_rows($newsletter_query) < 1) ? '0' : '1');
// End PHPlist Newsletter add-on

Read the forum rules...

Link to comment
Share on other sites

I've spotted an error.

In admin/customers.php the newsletter field still reads from the old database.

Add this line below

 

Below:

while ($customers = tep_db_fetch_array($customers_query)) {

Add:

	 // PHPlist PHPlist Newsletter add-on
		require(DIR_WS_INCLUDES . '/phplist_define.php'); //get the phplist specifics


	$existing_email_query = tep_db_query("select id, email, foreignkey from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "user_user where email =  '" . $customers['customers_email_address'] . "'"); //check for existing by email address
	$existing_user_query = tep_db_query("select id, foreignkey, email from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "user_user where foreignkey = " . $customers['customers_id'] . ""); //check for existing by phplist userid in case they subscribed using another method.

	$existing_email = tep_db_fetch_array($existing_email_query);
	$existing_user = tep_db_fetch_array($existing_user_query);

	if (tep_db_num_rows($existing_user_query) > 0) //check for user subscription
	  $newsletter_query = tep_db_query("select userid from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "listuser where listid = " . PHPLIST_LISTNO . " and userid = " . $existing_user['id'] . "");
	else
	  $newsletter_query = tep_db_query("select userid from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "listuser," . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "user_user where listid = " . PHPLIST_LISTNO . " and userid = id and email = '" . $customers['customers_email_address'] . "'");
	$customers['customers_newsletter'] = ((tep_db_num_rows($newsletter_query) < 1) ? '0' : '1');
// End PHPlist Newsletter add-on

 

Can you explain the error please?

 

Right now, when i delete or add an email to the list in phplist admin, the newsletter select field in admin/customers.php get actualized with the correct info.

Link to comment
Share on other sites

Can you explain the error please?

 

Right now, when i delete or add an email to the list in phplist admin, the newsletter select field in admin/customers.php get actualized with the correct info.

 

 

I found that within the customer list, the "Subscribed" fields on each row were not based on checks performed within the PHPlist database, but rather the Customers table of the OSC database. Specifically, the table's 'Newsletter' field.

 

It seems this bit was not updated (which is the bit I added)

Read the forum rules...

Link to comment
Share on other sites

Great idea, thanks for mentioning PHPlist. I was wondering two things.

1. Some paid services offer the possability of having a queu of newsletters with each new subscriber starting at newsletter no1 and progressing through the newsletters at specified intervals. Do you think that such a functionality could be added to PHP list?

 

2. How reliably integrated is PHPlist to OSC?

 

Thanks

 

phplist doesn't do this but Infinite Responder does. http://infinite.ibasics.biz/

IR is not integrated with osc but the developer of it is very cooperative and economical to work with.

I have moved on from oscommerce to magento and no longer monitoring this site.

Link to comment
Share on other sites

after phplist integration all my new customers are right away submited to phplist, but when i send message out my statistic says

 

Sent: 2007-05-09 23:21:15

Time to send: 34 mins 54 secs

total text html both PDF both

9275 108 0 9171 0 0

 

and when i look at "Users" it says

 

9725 users in total

 

... all users are confirmed, and all are set ot one and only list in phplist ... where are all this users??? I believe this difference is since phplist integration ...

Link to comment
Share on other sites

hmm .. found out something else .. all users that are subscribed via OSC, aren't subscribed to any list. When i hit button (reconcile users) to subsribe all unsubscribed to list it says no users to apply !?

 

in which table is this written?

Link to comment
Share on other sites

Everything is up and working, thank you for the cool contrib.

 

One problem that I am having is when a user signs up for an account they are not recieving the confirmation email that confirms your new oscommerce account. Any ideas?

Link to comment
Share on other sites

hmm .. found out something else .. all users that are subscribed via OSC, aren't subscribed to any list. When i hit button (reconcile users) to subsribe all unsubscribed to list it says no users to apply !?

 

in which table is this written?

 

found this in phplist_listuser table. Problems remain .. where can i put in code to subscribe them all to listID 7. As already mentioned above in a post i have hidden subscription on create_account.php?

 

thank you for your help in advance!

Link to comment
Share on other sites

Any suggestions or recommendations on the best/proper way to migrate the people who were previously registered to the OSC newsletter to be added to PHPList?

Link to comment
Share on other sites

  • 1 month later...

When users check/uncheck the subscribe option in account_newsletters.php I'd like it to insert/delete from the phplist database.

 

How can I achieve this? At the moment, subscribing/unsubscribing on that page doesn't effect the phplist user table.

Read the forum rules...

Link to comment
Share on other sites

  • 5 weeks later...

hi, i install this contribution in oscommerce on local server. when i go to adlmin in oscommerce and select customers i have a error message.

1146 - La table 'catalog.listuser_user' n'existe pas

 

select id, email, foreignkey from listuser_user where email = '[email protected]'

 

u try different configuration in phplist_define.php, but i don't understand why i have this message.

 

can someone help me?

thank and regards.

 

ps: sorry i'm french please can you be clear thank again..

Link to comment
Share on other sites

sorry but i respond to mysefl, may be i'm so stupid but for people who have the same message, in the tree file to make change change all "user_user" by "user"

 

for me it's working and resolve.

 

thank for this contribution.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 2 months later...
Hey,

 

Got this installed and all seems to be working good.

 

I was wondering if any one knows how to edit the check box on create account page so that it is preselected?

 

thanks a bunch

 

Beware, depending on were you leave this might be illigal (it is the case in the EU where opt in is mandatory).

 

Pascal

Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...

Hi There - i've just installed this contributuion and it seems to be working great- thanks

 

However, becasue i've installed it late on, i have many customers in the database who aren't added to phpList. Has anyone worked on a script to import all these users?

 

Cheers

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...