Jump to content

scottyb

Members
  • Content count

    56
  • Joined

  • Last visited

1 Follower

Profile Information

  1. scottyb

    Newsletter products, HTML email

    After seeing a few of these issues brought to my attention, it has become clear that there was an entry missing from the installation instructions. The reason for this error is because the product selection box is not popping up when newsletter_products is selected as the module. So, find the line: <?php echo tep_draw_pull_down_menu('module', $modules_array, $nInfo->module); ?> And replace it with: <?php echo tep_draw_pull_down_menu('module', $modules_array, $nInfo->module, 'onchange="showProducts()"'); ?> And this should alleviate the problem.
  2. scottyb

    Newsletter products, HTML email

    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.
  3. scottyb

    Newsletter products, HTML email

    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
  4. scottyb

    Newsletter products, HTML email

    Failed opening required 'DIR_WS_CLASSEScurrencies.php' Your page is either not calling the config.php file that defines DIR_WS_CLASSES or that definition has been removed. Look to make sure that these are included.
  5. scottyb

    Newsletter products, HTML email

    You declared "new newsletter_products" twice in your code. You can only do so once.
  6. scottyb

    Newsletter products, HTML email

    douxbb, I rarely if ever use <hr> in my html, so I doubt that I put in in the code for this. If I'm not mistaken, it would have to come from your template.
  7. scottyb

    Newsletter products, HTML email

    add $mimemessage->add_html($this->html_content()); after $mimemessage->add_text($text->content); $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer')); $mimemessage->add_text($this->content); $mimemessage->build_message()
  8. scottyb

    Newsletter products, HTML email

    The easiest way to do this would be just to add a second query to send() function. That's where the recipients are selected. Either add the result to the $mail_query result, or just make another loop specifically for the maillist.
  9. scottyb

    Newsletter products, HTML email

    The "products" field in the DB is either missing or mispelled.
  10. scottyb

    Newsletter products, HTML email

    Gecko, Since each individual customer message is not stored, you're going to have to figure out a way to add it during the sending process which is the send() function at the end of the modules/newsletters/newsletter_products.php file. This could be tricky depending upon your html_content(); You could try passing $mail_query['customers_firstname'] & $mail_query['customers_lastname'] inside the $this->html_content() function. Around line 216 in the newsletters.php file youll seee the pull down menu function, and around 364 you'll see the image.
  11. scottyb

    Newsletter products, HTML email

    First, you need to make sure that the absolute path is set by the defined variables (HTTP_CATALOG_SERVER and DIR_WS_CATALOG_IMAGES). Check your admin/includes/config.php file to see if they are properly defined. Next try to see what you are getting from your images query. Put var_dump($images) after while($images = tep_db_fetch_array($images_query)){ That will show you what you are retrieving from the sql query.
  12. scottyb

    Newsletter products, HTML email

    Two images are coming up because more than one language is in use. I have never used more than one, so I don't have a definite solution to this. Others have talked about that in this thread. If you only want to send out the email in one language, just hack it and set $language_id = 1 (or whatever language_id). Make sure that you're using this code: tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $images['products_image'], $images['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) Images need to have the absolute reference to your site. i.e. it should look something like <img src="http://www.yoursite.com/images/product.jpg" alt="Product Name" width="xx" height="xx">
  13. scottyb

    Newsletter products, HTML email

    Oops, that was me trying to mix and match 2 versions again (for some reason I don't have the option to edit my posts today). Anyways, change every $this->productsInfo[$i] to $images in the code I provided in post #77 I also noticed that I left a style="' . $cssLink . '" in there too. You're going to want to take that out as well. Sorry for the sloppy post
  14. scottyb

    Newsletter products, HTML email

    Your sql is failing because $lanugage_id is not present. The two global declarations do go AFTER the function statment. Once you get those working the sql should take care of itself. It should look something like this: function html_content() { global $currencies, $languages_id;
  15. scottyb

    Newsletter products, HTML email

    Alright Jon, let's see if we can get this for you. $images_query: $images_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(" . $this->products . ") and pd.language_id=" . $languages_id); Then for your $html_content (watch your table cells): $html_content .= '<td align="center" width="' . $width . '%"><a href="' . tep_catalog_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $this->productsInfo[$i]['products_id']) . '" style="' . $cssLink . '">' . tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $this->productsInfo[$i]['products_image'], $this->productsInfo[$i]['products_name']) . '<br>' . $this->productsInfo[$i]['products_name'] . '</a><br>'; $price = ($this->productsInfo[$i]['specials_price']) ? '<s>' . $currencies->display_price($this->productsInfo[$i]['products_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</s> ' . $currencies->display_price($this->productsInfo[$i]['specials_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) : $currencies->display_price($this->productsInfo[$i]['products_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])); $html_content .= $price . '</td>'; To make this work correctly, you need to have the currencies class established before this code is called Put this in /admin/newsletters.php after require('includes/application_top.php); //newsletter products //currenices class required for price display in newsletter require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); //newsletter products Then after the function html_content(){ in admin/includes/modules/newsletters/newsletter_products.php add: global $currencies, $languages_id; That's about as specific as I can get. Good Luck
×