Jump to content
Latest News: (loading..)
scottyb

Newsletter products, HTML email

Recommended Posts

Not to be outdone by milerwan, the official Version 2.0 (that I have promised long ago) is released.

 

B.K. & Kristian (don't know his username) got a sneak peak last week - I'm hoping no news is good news.

 

This release fixes the obvious issues stated here, adds specials, adds multipart-text/html email version to help lower spam scoring. Overall, this release is more in-tune with the osCommerce standard of coding.

 

Enjoy

 

 

I get this error when i save the newsletter:

 

1054 - Unknown column 'newsletters_id' in 'field list'

insert into newsletters_to_products (newsletters_id, products_id) values (1, 53)

 

 

I thought it would be an error in the sql for creating the table?

 

So i changed it to this: (newsletter_id => newsletters_id)

ALTER TABLE newsletters ADD template varchar(64) AFTER locked;
CREATE TABLE `newsletters_to_products` (
`newsletters_id` INT( 11 ) DEFAULT '0' NOT NULL ,
`products_id` INT( 11 ) DEFAULT '0' NOT NULL ,
PRIMARY KEY ( `newsletter_id` , `products_id` )
);

 

 

But then i get an error when previewing a saved newsletter:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and pd.language_id=1' at line 1

select p.products_id, pd.products_name, p.products_image2, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in() and pd.language_id=1

 

 

 

EDIT: also the readme is missing instructions for editing database_tables.php

 

ADD:

  //newsletter products
 define('TABLE_NEWSLETTERS_TO_PRODUCTS', 'newsletters_to_products');
 //end newsletter products

Edited by ShadowMoses

Share this post


Link to post
Share on other sites
I get this error when i save the newsletter:

 

1054 - Unknown column 'newsletters_id' in 'field list'

insert into newsletters_to_products (newsletters_id, products_id) values (1, 53)

 

So i changed it to this: (newsletter_id => newsletters_id)

ALTER TABLE newsletters ADD template varchar(64) AFTER locked;
CREATE TABLE `newsletters_to_products` (
`newsletters_id` INT( 11 ) DEFAULT '0' NOT NULL ,
`products_id` INT( 11 ) DEFAULT '0' NOT NULL ,
PRIMARY KEY ( `newsletter_id` , `products_id` )
);

 

ADD:

  //newsletter products
 define('TABLE_NEWSLETTERS_TO_PRODUCTS', 'newsletters_to_products');
 //end newsletter products

 

Thanks for pointing out the error in the sql file. I think that the preview error is a result of the initial error.

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and pd.language_id=1' at line 1

select p.products_id, pd.products_name, p.products_image2, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in() and pd.language_id=1

 

Notice that your "in()" statement in the sql is empty. Delete the newsletter or manually put the (1, 53) values into your newsletters_to_products and it should work.

Share this post


Link to post
Share on other sites

any idea on error

 

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', 'NONSSL')

 

in newsletter.php?

Share this post


Link to post
Share on other sites
any idea on error

 

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', 'NONSSL')

 

in newsletter.php?

 

I have the same error. Any idea?

Share this post


Link to post
Share on other sites
Notice that your "in()" statement in the sql is empty. Delete the newsletter or manually put the (1, 53) values into your newsletters_to_products and it should work.

 

Almost! i get a new error now:

 

1054 - Unknown column 'p.products_image2' in 'field list'

select p.products_id, pd.products_name, p.products_image2, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(53) and pd.language_id=1

 

Does it take into account some multi image contribution?

 

 

any idea on error

 

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', 'NONSSL')

 

in newsletter.php?

 

Did you modify newsletter.php or overwrite with the one in the package?

At first i modified it but i got an error (i forget what it was now) so, seeing as i hadn't changed anything in it before, i just overwrote it and it worked.

Share this post


Link to post
Share on other sites

Hi and sorry for my late answer.

 

- I had the same problems described above. indeed, a ligne is missing in the database file that define the newsletters_to_products file.

 

- Also care of p.products_image2 (normally p.products_image) !

 

- rename newsletter_id by newsletters_id in the newsletters_to_products database.

 

I still haven't manage to join the content of my newsletter with my template in the preview step, I've got only the product. I'm woking on it.

 

Special prices are present, it's great.

 

See you

Share this post


Link to post
Share on other sites
- Also care of p.products_image2 (normally p.products_image) !

 

Cool, i changed that... and now get another error :)

 

1054 - Unknown column 'p.products_id' in 'on clause'

select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(53) and pd.language_id=1

Share this post


Link to post
Share on other sites

Hi there, i have an error that no one has mentioned and need a little help. Error is as follows:

 

1146 - Table 'techinfoline_com_cre.TABLE_NEWSLETTERS_TO_PRODUCTS' doesn't exist

 

select products_id from TABLE_NEWSLETTERS_TO_PRODUCTS where newsletters_id = '2'

 

[TEP STOP]

 

I have run the sql commands twice and inserted what i thought to be the correct id values into the new tables trying to get rid of the error with no luck :)

 

I can create a new newsletter, Lock and unlock them, but cannot edit it? Any idea folks, thanks.

 

 

I think it may be a missing database_tables.php entry, trying now

Edited by ggbig

-------------------------------------------------

Best Regards,

 

ggbig (maestro)

Share this post


Link to post
Share on other sites
Hi there, i have an error that no one has mentioned and need a little help. Error is as follows:

 

1146 - Table 'techinfoline_com_cre.TABLE_NEWSLETTERS_TO_PRODUCTS' doesn't exist

 

select products_id from TABLE_NEWSLETTERS_TO_PRODUCTS where newsletters_id = '2'

 

[TEP STOP]

 

I have run the sql commands twice and inserted what i thought to be the correct id values into the new tables trying to get rid of the error with no luck :)

 

I can create a new newsletter, Lock and unlock them, but cannot edit it? Any idea folks, thanks.

I think it may be a missing database_tables.php entry, trying now

 

 

Got rid of the first error with database_table define, now seeing another:

 

1054 - Unknown column 'newsletters_id' in 'where clause'

 

select products_id from newsletters_to_products where newsletters_id = '2'

 

[TEP STOP]

 

thanks for any help :)


-------------------------------------------------

Best Regards,

 

ggbig (maestro)

Share this post


Link to post
Share on other sites
Got rid of the first error with database_table define, now seeing another:

 

1054 - Unknown column 'newsletters_id' in 'where clause'

 

select products_id from newsletters_to_products where newsletters_id = '2'

 

[TEP STOP]

 

thanks for any help :)

 

 

Found the fix for that one and now another one :) That i think has been mentioned, will continue to read :)

 

error is:

 

1054 - Unknown column 'p.products_image2' in 'field list'

 

select p.products_id, pd.products_name, p.products_image2, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(1) and pd.language_id=1

 

[TEP STOP]


-------------------------------------------------

Best Regards,

 

ggbig (maestro)

Share this post


Link to post
Share on other sites

HOUSTON, I need help!!!

 

any idea of this error?:

 

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', 'NONSSL')

 

in newsletter.php?

 

Thanks for every thing...

Share this post


Link to post
Share on other sites
HOUSTON, I need help!!!

 

any idea of this error?:

 

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', 'NONSSL')

 

in newsletter.php?

 

Thanks for every thing...

 

 

 

Yes everyone having this error I found where the problem is. :thumbsup:

 

It's in admin/includes/languages/english/modules/newsletters/newsletter_products.php

 

Comment out "//" or change this line:

 

 

//define('TEXT_UNSUBSCRIBE', "\n\n" . 'You are receiving this notice because you have subscribed to our newsletter. To unsubscribe:' ."\n". HTTP_SERVER . DIR_WS_CATALOG . 'newsletters_unsubscribe.php?action=view&email=');

 

 

error is in the code needs to be fixed.

 

bless

culturebee

Share this post


Link to post
Share on other sites
Got rid of the first error with database_table define, now seeing another:

 

1054 - Unknown column 'newsletters_id' in 'where clause'

 

select products_id from newsletters_to_products where newsletters_id = '2'

 

[TEP STOP]

 

thanks for any help :)

 

and the fix for error

 

1054 - Unknown column 'newsletters_id' in 'field list'

 

insert into newsletters_to_products (newsletters_id, products_id) values (2, 544)

 

[TEP STOP]

 

 

is?

Share this post


Link to post
Share on other sites

OK,

 

You can try

 

define('TEXT_UNSUBSCRIBE', '' ."\n\n" . 'You are receiving this notice because you have subscribed to our newsletter. To unsubscribe:' ."\n". HTTP_SERVER . DIR_WS_CATALOG . 'newsletters_unsubscribe.php?action=view&email=');

 

 

 

 

k

Share this post


Link to post
Share on other sites
and the fix for error

is?

 

 

Im no expert but that looks like a simple request to insert those values in to the newsletters_to_products TABLE in your database. hope that helps :)


-------------------------------------------------

Best Regards,

 

ggbig (maestro)

Share this post


Link to post
Share on other sites

Hi again guys, i know some of this has been touched on before in this topic, but i am still having some issues. They are as follows :)

 

I click on one of my newsletters in the Newsletter Manager and then click the "edit" button and i see these two errors:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home2/techinfo/techinfoline-www/cre/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home2/techinfo/techinfoline-www/cre/admin/includes/classes/object_info.php on line 18

 

 

 

Also when i click on the "send" button i see these two errors:

 

Warning: Missing argument 3 for newsletter_products() in /home2/techinfo/techinfoline-www/cre/admin/includes/modules/newsletters/newsletter_products.php on line 16

 

Warning: Missing argument 4 for newsletter_products() in /home2/techinfo/techinfoline-www/cre/admin/includes/modules/newsletters/newsletter_products.php on line 16

 

Thanks for any help that can be provided me on these issues :) And again Congrats on a very kewl contribution!!!!


-------------------------------------------------

Best Regards,

 

ggbig (maestro)

Share this post


Link to post
Share on other sites
I get the following sql error. Does anyone have a solution? :)

The problem occurs using MySQL 5, version 4 doesn't give any errors.

 1054 - Unknown column 'p.products_id' in 'on clause' 

select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(738,990,938,855,175,353,1059,1043,874,895,884,749,350) and pd.language_id=1

[TEP STOP]

 

 

If you use MYSQL 5 just change the first comma before the the left join into inner join !

 

select p.products_id, pd.products_name, p.products_image2, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p INNER JOIN products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(99, 100, 101, 102) and pd.language_id=2

Edited by Scotty2k

Share this post


Link to post
Share on other sites

Just installed this contribution but getting error mesage:

 

 

Catchable fatal error: Object of class newsletter_products could not be converted to string in catalog\admin\includes\functions\html_output.php on line 281

 

Can someone help?

 

Line 281 in here some where:

// Output a form hidden field
function tep_draw_hidden_field($name, $value = '', $parameters = '') {
$field = '<input type="hidden" name="' . tep_output_string($name) . '"';

if (tep_not_null($value)) {
$field .= ' value="' . tep_output_string($value) . '"';
} elseif (isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) {
$field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';
}

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

$field .= '>';

return $field;
}

////
// Output a form pull down menu
function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
$field = '<select name="' . tep_output_string($name) . '"';

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

$field .= '>';

Share this post


Link to post
Share on other sites

In local the contribution looks work fine.

But when i upload it, get error:

 

Catchable fatal error: Object of class newsletter_products could not be converted to string in catalog\admin\includes\functions\html_output.php on line 282

 

sorry for my english, im from argentina

Share this post


Link to post
Share on other sites

I cant edit my previous post.

 

Line 282 of my html_output.php:

 

if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

 

I already Change the function in admin/includes/modules/newsletters/newsletter_products.php suggested for melhaa in post #100, but nothing happen, everything follows equal.

Share this post


Link to post
Share on other sites

OK... reading about another contribution (Dynamic Sitemap; http://forums.oscommerce.com/index.php?sho...ror&st=480; post #496) i find what "CraXyOW3" say something about the "Catchable..." problem

 

Ok, first time i checked the BUGS section of oscommerce's site and i found my problem ! biggrin.gif now it works nicely so far!

 

change the

if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

 

to

if ( ($default == '' && $GLOBALS[$name] == $values[$i]['id']) || ($default == $values[$i]['id']) );

 

I didit and now i see the pull down menu with product list, but when i select some products with ">>> button", they not show in the right panel. Internet explorer 7, show me an page error (in the left of state bar):

'document.newsletter.elements.products[].length' he is null or it is not an object

 

And if i "save" the newsletter, tellme "Error: Newsletter module required".

Share this post


Link to post
Share on other sites

NOW WORKS FINE:

Solucion to Catchable fatal error:

 

Using the original files of contribution, only do this changes:

 

In html_output.php

 

change the

if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

to

if ( ($default == '' && $GLOBALS[$name] == $values[$i]['id']) || ($default == $values[$i]['id']) );

 

If you obtain "Error: Newsletter module required" when tray to save newsletter; go to admin/newsletters.php,

find

if (empty($module)) {
	  $messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');
	  $newsletter_error = true;
	}

 

and comment it

/* if (empty($module)) {
	  $messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');
	  $newsletter_error = true;
	} */

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×