Jump to content

Naraneko

Members
  • Content count

    1
  • Joined

  • Last visited

Profile Information

  • Real Name
    Francisco Carvalho
  1. Naraneko

    Newsletter products, HTML email

    Hi, i try to add this contribution but i have a little problem, the price is calculate wrong, it seams to round the price to whole number (8.35€ appears as 8.00€) This is my newsletter_products.php ///create HTML string containing links & pics define('COLS', 1); $width = intval(25/COLS); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $html_content = '<table border="0" width="100%" height="100%" cellpadding="2" cellspacing="3"><tr><td colspan="2" align="left" class="content">' . $this->content . '</td></tr><tr><td colspan="2">' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td></tr><tr>'; $col = 0; if ($this->products != ''){ $images_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_price, p.products_tax_class_id, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and p.products_id in(" . $this->products . ")"); } while($images = tep_db_fetch_array($images_query)){ if($col > COLS-1){ $html_content .= '</tr><tr><td class="content" align="center" width="' . $width . '%"><a href="' . tep_catalog_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $images['products_id']) . '" class="content">' . tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $images['products_image'], $images['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $images['products_name'] . '</a></td> <td valign="top"><font size="3" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><b>' . $images['products_name'] . '</b></font><br><font size="3" color="#663366" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><b>' . $images['products_description'] . '</b></font><font size="3" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><b><br>' . $currencies->display_price($images['products_price'], tep_get_tax_rate($images['products_tax_class_id'])) . '</br></b></font></td>'; $col = 0; }else{ $html_content .= '<td class="content" align="center" width="' . $width . '%"><a href="' . tep_catalog_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $images['products_id']) . '" class="content">' . tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $images['products_image'], $images['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $images['products_name'] . '</a></td> <td valign="top"><font size="3" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><b>' . $images['products_name'] . '</b></font><br><font size="3" color="#663366" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><b>' . $images['products_description'] . '</b></font><font size="3" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><b><br>' . $currencies->display_price($images['products_price'], tep_get_tax_rate($images['products_tax_class_id'])) . '</br></b></font></td>'; } $col++; } $html_content .= '</tr></table>'; if(tep_not_null($this->template)){ I try to do everything as the first post say, but the only step i can do is insert require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); into newsletters.php because i get this error: Warning: main(DIR_WS_CLASSEScurrencies.php) [function.main]: failed to open stream: No such file or directory in /web/htdocs/www.edicoesmangaline.com/home/loja/admin/newsletters.php on line 13 Fatal error: main() [function.require]: Failed opening required 'DIR_WS_CLASSEScurrencies.php' (include_path='.:/php/lib/php/') in /web/htdocs/www.edicoesmangaline.com/home/loja/admin/newsletters.php on line 13 Please some help me, i been 48h in this without results. Sorry for my bad english.
×