Jump to content

fantomen

Members
  • Content count

    201
  • Joined

  • Last visited

Everything posted by fantomen

  1. fantomen

    Marketplace Category/Version Cleanup

    Hi Harald Ponce de Leon, Welcome back to oscommerce. I hope you have understood that your next version of oscommerce must be a responsive version? In the meanwhile please remove the old non-responsive version and upload a responsive demo of oscommerce on this website: https://demo.oscommerce.com My suggestion is that you put up this version on your demo site: "osCommerce Online Merchant v2.3.4.1 CE" Frozen https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip This is the best responsive oscommerce platform that is working and there is also many addons (contributions) made for this version. For every minute your old demo of a NON-responsive oscommerce is showing on https://demo.oscommerce.com/ means that oscommerce is still dead and not updated so my suggestion is that you fix this as soon as possible and this will bring back people from all around the globe to the best open source e-commerce platform ever made. The most fantastic thing is that while you had your vacation from oscommerce, programmers continued to develop oscommerce to keep it alive. Many thanks to all programmers that have kept oscommerce alive during your vacation.
  2. My Installed version FROZEN: osCommerce Online Merchant v2.3.4.1 CE Frozen https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip Server OS: Linux 4.15.0-45-generic HTTP Server: Apache/2.4.29 (Ubuntu) PHP Version: 7.2.10-0ubuntu0.18.04.1 (Zend: 3.2.0) Database: MySQL 5.7.25-0ubuntu0.18.04.2 Test website: http://t1.zmm.se/ My question: How can I make the URL adresses of my website search engine friendly?
  3. Is there a module for automatic updating stock, products and prices? Example one distributor have around 22 000 products and the other distributor have more than 40 000 products. With so many products it is not so easy to update products, prices and how many in stock and product pictures. Perhaps there is some software module or modules to make this job more easy to update all the products? My installed version FROZEN: osCommerce Online Merchant v2.3.4.1 CE Frozen https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip
  4. How to install this version from scatch? https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip Requirements recommended: What software is needed to install? Step by step description? What version of Bootstrap is needed to install for above version?
  5. Hi MrPhil, thank you for your reply. This sounds very very very interesting. Regarding manual decisions, I set a % markup for each category and does not need to set a % markup for each product. On some special products that I would like to have a very competitive price on, then I always set a low % markup for each of these products. Regarding categorizing new products I do this manually because I do not know any other way to do it.
  6. Hi Gyakutsuki, thank you for your reply. This sounds interesting but can you be more specific to tell me what apps I need to be able to update products, prices and number in stock automatically that is compatible with my oscommerce version Frozen https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip Installed Version: osCommerce Online Merchant v2.3.4.1 CE Odoo.com have many apps: https://www.odoo.com/pricing and when I click on the e-commerce app there is 3 apps marked automatically. As I understand from this it seem to be working only with Odoo.com own webshop and not for oscommerce?
  7. Hi Smoky Barnable, thank you for your reply. Regarding your advice to use this module: https://apps.oscommerce.com/YfzFh&alternative-administration-system-v0-3 I have been reading about this module and I think the developer of this module have made an incredible good module with all the these features. Almost too good to be true. If I did not watch the demonstration movie on youtube I would not belive it was true. Alternative Administration System Version: 0.3, Created by John Barounis , www.alternative-administration-system.com I just say amazing work this developer have done when he created this module. But will it function with my oscommerce reponsive version? My installed Version: osCommerce Online Merchant v2.3.4.1 CE Frozen https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip I think this module is more of the kind of module I am looking for to solve my issue to keep the stock and prices updated. The function I miss with this module is that it does not automatically add new products. https://apps.oscommerce.com/EhAln&get-price-quantity-xml-update-feed-v2-1 This is how I work now to add products in short terms: I use FileZilla https://filezilla-project.org/ to download the pricefile in .txt or .csv format from the distributor. Then I open the pricefile in Excel. Then I add a number of columns to be able to calculate prices to end consumers. This takes very long time to do with 22 000 products. A smart software that would help me to mass change prices in procent and in my currency SEK and in a certain category would help a lot. Of course this can be done in Excel but first I have to sort all products in the correct categorys and to do this takes very much time. And next day the distributor have added a couple of hundred new products and no category to be found. Then new headache to start to categorize all new products to the correct category. Some smart software to mass sort products into the correct category would help. Then I make new prices for the end consumer and make sure that the stock values are added and all other information like product descriptions and much more. Then I import the file with Easy Populate into my webshop. The highest wishlist is to have a connection in real time to the distributor to keep products and stock and prices updated but there need to be a step in between so that I can add my prices to the endconsumer. I can also connect to the distributor via api solution and get an .xml file of all the products. Maybe someone on this forum have any solution on how to make all this work in a much more easy and time saving way?
  8. Hi Gyakutsuki, thank you for your reply. I can not find any product from Odoo here https://www.odoo.com/ that will update stock and prices automatically. Perhaps I am looking at the wrong website?
  9. Hi JcMagpie, thank you for your reply. I will have a look at your module link you sent me.
  10. Hi MrPhil, thank you for your reply. I have already installed Easy Populate and many thanks to JcMagpie who have helped me to get Easy Populate to function with my installed version FROZEN: osCommerce Online Merchant v2.3.4.1 CE With Easy Populate I can import many thousand products to my webshop. When having more than 15 000 products in a webshop it is a must to have some form of automatic update of stock quantity, prices and products. And when categorizing all the products in Excel and then when supplier changes prices and add new products it is a must to have a tool to update this automatically. I can get the pricelist from the distributor/supplier in .xls or in .xml format. Is there someone who have buillt a module for automatic updating stock and prices and products from the distributor/supplier? I have found this module that is interesting: https://apps.oscommerce.com/EhAln&get-price-quantity-xml-update-feed-v2-1 Is this module working for my installed version FROZEN: osCommerce Online Merchant v2.3.4.1 CE ?
  11. I would like to receive information on how to configure "smtp" mail to function in my installed version: FROZEN: osCommerce Online Merchant v2.3.4.1 CE.
  12. I asume the first file is for placing here: admin/includes/classes/ And the second file is for placing here: includes/classes/ I have renamed your files to email.php and uploaded the 2 files to above places. Admin panel website is still working. Website store front website goes down and shows a blank white page. I have not filled in my information to these 2 files yet because I would like to see if the website went down or not. So now is 1 step better than before. Any ideas how to solve this?
  13. Please look and see if I have made the changes correct to the 2 files according to your instructions. Because my whole website goes down when I upload these 2 files.
  14. The whole website went down when I uploaded the 2 email.php files.
  15. I have commented out this line now //$pMail->addBCC('email@email.com'); Website is still not working since I uploaded the 2 email.php files.
  16. This is how my files look like after the changes: admin/includes/classes/email.php <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License mail.php - a class to assist in building mime-HTML eMails The original class was made by Richard Heyes <richard@phpguru.org> and can be found here: http://www.phpguru.org Renamed and Modified by Jan Wildeboer for osCommerce */ use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; class email { var $html; var $text; var $output; var $html_text; var $html_images; var $image_types; var $build_params; var $attachments; var $headers; function __construct($headers = '') { if ($headers == '') $headers = array(); $this->html_images = array(); $this->headers = array(); if (EMAIL_LINEFEED == 'CRLF') { $this->lf = "\r\n"; } else { $this->lf = "\n"; } /** * If you want the auto load functionality * to find other mime-image/file types, add the * extension and content type here. */ $this->image_types = array('gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'bmp' => 'image/bmp', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'swf' => 'application/x-shockwave-flash'); $this->build_params['html_encoding'] = 'quoted-printable'; $this->build_params['text_encoding'] = '7bit'; $this->build_params['html_charset'] = constant('CHARSET'); $this->build_params['text_charset'] = constant('CHARSET'); $this->build_params['text_wrap'] = 998; /** * Make sure the MIME version header is first. */ $this->headers[] = 'MIME-Version: 1.0'; foreach($headers as $value) { if (tep_not_null($value)) { $this->headers[] = $value; } } } /** * This function will read a file in * from a supplied filename and return * it. This can then be given as the first * argument of the the functions * add_html_image() or add_attachment(). */ function get_file($filename) { $return = ''; if ($fp = fopen($filename, 'rb')) { while (!feof($fp)) { $return .= fread($fp, 1024); } fclose($fp); return $return; } else { return false; } } /** * Function for extracting images from * html source. This function will look * through the html code supplied by add_html() * and find any file that ends in one of the * extensions defined in $obj->image_types. * If the file exists it will read it in and * embed it, (not an attachment). * * Function contributed by Dan Allen */ function find_html_images($images_dir) { // Build the list of image extensions foreach(array_keys($this->image_types) as $key) { $extensions[] = $key; } preg_match_all('/"([^"]+\.(' . implode('|', $extensions).'))"/Ui', $this->html, $images); for ($i=0; $i<count($images[1]); $i++) { if (file_exists($images_dir . $images[1][$i])) { $html_images[] = $images[1][$i]; $this->html = str_replace($images[1][$i], basename($images[1][$i]), $this->html); } } if (tep_not_null($html_images)) { // If duplicate images are embedded, they may show up as attachments, so remove them. $html_images = array_unique($html_images); sort($html_images); for ($i=0; $i<count($html_images); $i++) { if ($image = $this->get_file($images_dir . $html_images[$i])) { $content_type = $this->image_types[substr($html_images[$i], strrpos($html_images[$i], '.') + 1)]; $this->add_html_image($image, basename($html_images[$i]), $content_type); } } } } /** * Adds plain text. Use this function * when NOT sending html email */ function add_text($text = '') { $this->text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); } /** * Adds a html part to the mail. * Also replaces image names with * content-id's. */ function add_html($html, $text = NULL, $images_dir = NULL) { $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br />', $html); $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); if (isset($images_dir)) $this->find_html_images($images_dir); } /** * Adds an image to the list of embedded * images. */ function add_html_image($file, $name = '', $c_type='application/octet-stream') { $this->html_images[] = array('body' => $file, 'name' => $name, 'c_type' => $c_type, 'cid' => md5(uniqid(time()))); } /** * Adds a file to the list of attachments. */ function add_attachment($file, $name = '', $c_type='application/octet-stream', $encoding = 'base64') { $this->attachments[] = array('body' => $file, 'name' => $name, 'c_type' => $c_type, 'encoding' => $encoding); } /** * Adds a text subpart to a mime_part object */ /* HPDL PHP3 */ // function &add_text_part(&$obj, $text) { function add_text_part(&$obj, $text) { $params['content_type'] = 'text/plain'; $params['encoding'] = $this->build_params['text_encoding']; $params['charset'] = $this->build_params['text_charset']; if (is_object($obj)) { return $obj->addSubpart($text, $params); } else { return new mime($text, $params); } } /** * Adds a html subpart to a mime_part object */ /* HPDL PHP3 */ // function &add_html_part(&$obj) { function add_html_part(&$obj) { $params['content_type'] = 'text/html'; $params['encoding'] = $this->build_params['html_encoding']; $params['charset'] = $this->build_params['html_charset']; if (is_object($obj)) { return $obj->addSubpart($this->html, $params); } else { return new mime($this->html, $params); } } /** * Starts a message with a mixed part */ /* HPDL PHP3 */ // function &add_mixed_part() { function add_mixed_part() { $params['content_type'] = 'multipart/mixed'; return new mime('', $params); } /** * Adds an alternative part to a mime_part object */ /* HPDL PHP3 */ // function &add_alternative_part(&$obj) { function add_alternative_part(&$obj) { $params['content_type'] = 'multipart/alternative'; if (is_object($obj)) { return $obj->addSubpart('', $params); } else { return new mime('', $params); } } /** * Adds a html subpart to a mime_part object */ /* HPDL PHP3 */ // function &add_related_part(&$obj) { function add_related_part(&$obj) { $params['content_type'] = 'multipart/related'; if (is_object($obj)) { return $obj->addSubpart('', $params); } else { return new mime('', $params); } } /** * Adds an html image subpart to a mime_part object */ /* HPDL PHP3 */ // function &add_html_image_part(&$obj, $value) { function add_html_image_part(&$obj, $value) { $params['content_type'] = $value['c_type']; $params['encoding'] = 'base64'; $params['disposition'] = 'inline'; $params['dfilename'] = $value['name']; $params['cid'] = $value['cid']; $obj->addSubpart($value['body'], $params); } /** * Adds an attachment subpart to a mime_part object */ /* HPDL PHP3 */ // function &add_attachment_part(&$obj, $value) { function add_attachment_part(&$obj, $value) { $params['content_type'] = $value['c_type']; $params['encoding'] = $value['encoding']; $params['disposition'] = 'attachment'; $params['dfilename'] = $value['name']; $obj->addSubpart($value['body'], $params); } /** * Builds the multipart message from the * list ($this->_parts). $params is an * array of parameters that shape the building * of the message. Currently supported are: * * $params['html_encoding'] - The type of encoding to use on html. Valid options are * "7bit", "quoted-printable" or "base64" (all without quotes). * 7bit is EXPRESSLY NOT RECOMMENDED. Default is quoted-printable * $params['text_encoding'] - The type of encoding to use on plain text Valid options are * "7bit", "quoted-printable" or "base64" (all without quotes). * Default is 7bit * $params['text_wrap'] - The character count at which to wrap 7bit encoded data. * Default this is 998. * $params['html_charset'] - The character set to use for a html section. * Default is iso-8859-1 * $params['text_charset'] - The character set to use for a text section. * - Default is iso-8859-1 */ /* HPDL PHP3 */ // function build_message($params = array()) { function build_message($params = '') { if ($params == '') $params = array(); if (count($params) > 0) { foreach($params as $key => $value) { $this->build_params[$key] = $value; } } if (tep_not_null($this->html_images)) { foreach($this->html_images as $value) { $this->html = str_replace($value['name'], 'cid:' . $value['cid'], $this->html); } } $null = NULL; $attachments = ((tep_not_null($this->attachments)) ? true : false); $html_images = ((tep_not_null($this->html_images)) ? true : false); $html = ((tep_not_null($this->html)) ? true : false); $text = ((tep_not_null($this->text)) ? true : false); switch (true) { case (($text == true) && ($attachments == false)): /* HPDL PHP3 */ // $message =& $this->add_text_part($null, $this->text); $message = $this->add_text_part($null, $this->text); break; case (($text == false) && ($attachments == true) && ($html == false)): /* HPDL PHP3 */ // $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); for ($i=0; $i<count($this->attachments); $i++) { $this->add_attachment_part($message, $this->attachments[$i]); } break; case (($text == true) && ($attachments == true)): /* HPDL PHP3 */ // $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); $this->add_text_part($message, $this->text); for ($i=0; $i<count($this->attachments); $i++) { $this->add_attachment_part($message, $this->attachments[$i]); } break; case (($html == true) && ($attachments == false) && ($html_images == false)): if (tep_not_null($this->html_text)) { /* HPDL PHP3 */ // $message =& $this->add_alternative_part($null); $message = $this->add_alternative_part($null); $this->add_text_part($message, $this->html_text); $this->add_html_part($message); } else { /* HPDL PHP3 */ // $message =& $this->add_html_part($null); $message = $this->add_html_part($null); } break; case (($html == true) && ($attachments == false) && ($html_images == true)): if (tep_not_null($this->html_text)) { /* HPDL PHP3 */ // $message =& $this->add_alternative_part($null); $message = $this->add_alternative_part($null); $this->add_text_part($message, $this->html_text); /* HPDL PHP3 */ // $related =& $this->add_related_part($message); $related = $this->add_related_part($message); } else { /* HPDL PHP3 */ // $message =& $this->add_related_part($null); // $related =& $message; $message = $this->add_related_part($null); $related = $message; } $this->add_html_part($related); for ($i=0; $i<count($this->html_images); $i++) { $this->add_html_image_part($related, $this->html_images[$i]); } break; case (($html == true) && ($attachments == true) && ($html_images == false)): /* HPDL PHP3 */ // $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); if (tep_not_null($this->html_text)) { /* HPDL PHP3 */ // $alt =& $this->add_alternative_part($message); $alt = $this->add_alternative_part($message); $this->add_text_part($alt, $this->html_text); $this->add_html_part($alt); } else { $this->add_html_part($message); } for ($i=0; $i<count($this->attachments); $i++) { $this->add_attachment_part($message, $this->attachments[$i]); } break; case (($html == true) && ($attachments == true) && ($html_images == true)): /* HPDL PHP3 */ // $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); if (tep_not_null($this->html_text)) { /* HPDL PHP3 */ // $alt =& $this->add_alternative_part($message); $alt = $this->add_alternative_part($message); $this->add_text_part($alt, $this->html_text); /* HPDL PHP3 */ // $rel =& $this->add_related_part($alt); $rel = $this->add_related_part($alt); } else { /* HPDL PHP3 */ // $rel =& $this->add_related_part($message); $rel = $this->add_related_part($message); } $this->add_html_part($rel); for ($i=0; $i<count($this->html_images); $i++) { $this->add_html_image_part($rel, $this->html_images[$i]); } for ($i=0; $i<count($this->attachments); $i++) { $this->add_attachment_part($message, $this->attachments[$i]); } break; } if ( (isset($message)) && (is_object($message)) ) { $output = $message->encode(); $this->output = $output['body']; foreach($output['headers'] as $key => $value) { $headers[] = $key . ': ' . $value; } $this->headers = array_merge($this->headers, $headers); return true; } else { return false; } } /** * Sends the mail. */ function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = '') { if ((strstr($to_name, "\n") != false) || (strstr($to_name, "\r") != false)) { return false; } if ((strstr($to_addr, "\n") != false) || (strstr($to_addr, "\r") != false)) { return false; } if ((strstr($subject, "\n") != false) || (strstr($subject, "\r") != false)) { return false; } if ((strstr($from_name, "\n") != false) || (strstr($from_name, "\r") != false)) { return false; } if ((strstr($from_addr, "\n") != false) || (strstr($from_addr, "\r") != false)) { return false; } $to = (($to_name != '') ? '"' . $to_name . '" <' . $to_addr . '>' : $to_addr); $from = (($from_name != '') ? '"' . $from_name . '" <' . $from_addr . '>' : $from_addr); if (is_string($headers)) { $headers = explode($this->lf, trim($headers)); } for ($i=0; $i<count($headers); $i++) { if (is_array($headers[$i])) { for ($j=0; $j<count($headers[$i]); $j++) { if ($headers[$i][$j] != '') { $xtra_headers[] = $headers[$i][$j]; } } } if ($headers[$i] != '') { $xtra_headers[] = $headers[$i]; } } if (!isset($xtra_headers)) { $xtra_headers = array(); } $headers = array_merge($this->headers, array('From: ' . $from), $headers, $xtra_headers); $additional_parameters = ''; if ((PHP_VERSION > '5.3') || ((bool)ini_get('safe_mode') === false)) { $additional_parameters = '-f' . $from_addr; } //return mail($to, $subject, $this->output, implode($this->lf, $headers), $additional_parameters); require_once 'includes/classes/Exception.php'; // required_once needed to prevent redefining the class require_once 'includes/classes/PHPMailer.php'; require_once 'includes/classes/SMTP.php'; $pMail = new PHPMailer(); $pMail->From = $from_addr; $pMail->FromName = $from_name; $pMail->IsSMTP(); $pMail->Host = "MY INFO IS WRITTEN HERE"; // replace with your smtp server $pMail->Username = "MY INFO IS WRITTEN HERE"; // replace with your smtp username (if SMTPAuth is true) $pMail->Password = "MY INFO IS WRITTEN HERE"; // replace with your smtp password (if SMTPAuth is true) $pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication $pMail->Subject = $subject; $pMail->Body = $this->output; //$pMail->AltBody = 'Alternative text'; $pMail->AddAddress($to_addr, $to_name); //$pMail->addCC('email@email.com'); $pMail->addBCC('email@email.com'); $pMail->IsHTML(false); return $pMail->Send(); $pMail->ClearAddresses(); $pMail->ClearAttachments(); } /** * Use this method to return the email * in message/rfc822 format. Useful for * adding an email to another email as * an attachment. there's a commented * out example in example.php. * * string get_rfc822(string To name, * string To email, * string From name, * string From email, * [string Subject, * string Extra headers]) */ function get_rfc822($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = '') { // Make up the date header as according to RFC822 $date = 'Date: ' . date('D, d M y H:i:s'); $to = (($to_name != '') ? 'To: "' . $to_name . '" <' . $to_addr . '>' : 'To: ' . $to_addr); $from = (($from_name != '') ? 'From: "' . $from_name . '" <' . $from_addr . '>' : 'From: ' . $from_addr); if (is_string($subject)) { $subject = 'Subject: ' . $subject; } if (is_string($headers)) { $headers = explode($this->lf, trim($headers)); } for ($i=0; $i<count($headers); $i++) { if (is_array($headers[$i])) { for ($j=0; $j<count($headers[$i]); $j++) { if ($headers[$i][$j] != '') { $xtra_headers[] = $headers[$i][$j]; } } } if ($headers[$i] != '') { $xtra_headers[] = $headers[$i]; } } if (!isset($xtra_headers)) { $xtra_headers = array(); } $headers = array_merge($this->headers, $xtra_headers); return $date . $this->lf . $from . $this->lf . $to . $this->lf . $subject . $this->lf . implode($this->lf, $headers) . $this->lf . $this->lf . $this->output; } } ?> ______________________________________________________________________________________________________________________ Here is the other file: includes/classes/e-mail.php <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License mail.php - a class to assist in building mime-HTML eMails The original class was made by Richard Heyes <richard@phpguru.org> and can be found here: http://www.phpguru.org Renamed and Modified by Jan Wildeboer for osCommerce */ use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; class email { var $html; var $text; var $output; var $html_text; var $html_images; var $image_types; var $build_params; var $attachments; var $headers; function __construct($headers = '') { if ($headers == '') $headers = array(); $this->html_images = array(); $this->headers = array(); if (EMAIL_LINEFEED == 'CRLF') { $this->lf = "\r\n"; } else { $this->lf = "\n"; } /** * If you want the auto load functionality * to find other mime-image/file types, add the * extension and content type here. */ $this->image_types = array('gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'bmp' => 'image/bmp', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'swf' => 'application/x-shockwave-flash'); $this->build_params['html_encoding'] = 'quoted-printable'; $this->build_params['text_encoding'] = '7bit'; $this->build_params['html_charset'] = constant('CHARSET'); $this->build_params['text_charset'] = constant('CHARSET'); $this->build_params['text_wrap'] = 998; /** * Make sure the MIME version header is first. */ $this->headers[] = 'MIME-Version: 1.0'; foreach($headers as $value) { if (tep_not_null($value)) { $this->headers[] = $value; } } } /** * This function will read a file in * from a supplied filename and return * it. This can then be given as the first * argument of the the functions * add_html_image() or add_attachment(). */ function get_file($filename) { $return = ''; if ($fp = fopen($filename, 'rb')) { while (!feof($fp)) { $return .= fread($fp, 1024); } fclose($fp); return $return; } else { return false; } } /** * Function for extracting images from * html source. This function will look * through the html code supplied by add_html() * and find any file that ends in one of the * extensions defined in $obj->image_types. * If the file exists it will read it in and * embed it, (not an attachment). * * Function contributed by Dan Allen */ function find_html_images($images_dir) { // Build the list of image extensions foreach(array_keys($this->image_types) as $key) { $extensions[] = $key; } preg_match_all('/"([^"]+\.(' . implode('|', $extensions).'))"/Ui', $this->html, $images); for ($i=0; $i<count($images[1]); $i++) { if (file_exists($images_dir . $images[1][$i])) { $html_images[] = $images[1][$i]; $this->html = str_replace($images[1][$i], basename($images[1][$i]), $this->html); } } if (tep_not_null($html_images)) { // If duplicate images are embedded, they may show up as attachments, so remove them. $html_images = array_unique($html_images); sort($html_images); for ($i=0; $i<count($html_images); $i++) { if ($image = $this->get_file($images_dir . $html_images[$i])) { $content_type = $this->image_types[substr($html_images[$i], strrpos($html_images[$i], '.') + 1)]; $this->add_html_image($image, basename($html_images[$i]), $content_type); } } } } /** * Adds plain text. Use this function * when NOT sending html email */ function add_text($text = '') { $this->text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); } /** * Adds a html part to the mail. * Also replaces image names with * content-id's. */ function add_html($html, $text = NULL, $images_dir = NULL) { $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br />', $html); $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); if (isset($images_dir)) $this->find_html_images($images_dir); } /** * Adds an image to the list of embedded * images. */ function add_html_image($file, $name = '', $c_type='application/octet-stream') { $this->html_images[] = array('body' => $file, 'name' => $name, 'c_type' => $c_type, 'cid' => md5(uniqid(time()))); } /** * Adds a file to the list of attachments. */ function add_attachment($file, $name = '', $c_type='application/octet-stream', $encoding = 'base64') { $this->attachments[] = array('body' => $file, 'name' => $name, 'c_type' => $c_type, 'encoding' => $encoding); } /** * Adds a text subpart to a mime_part object */ /* HPDL PHP3 */ // function &add_text_part(&$obj, $text) { function add_text_part(&$obj, $text) { $params['content_type'] = 'text/plain'; $params['encoding'] = $this->build_params['text_encoding']; $params['charset'] = $this->build_params['text_charset']; if (is_object($obj)) { return $obj->addSubpart($text, $params); } else { return new mime($text, $params); } } /** * Adds a html subpart to a mime_part object */ /* HPDL PHP3 */ // function &add_html_part(&$obj) { function add_html_part(&$obj) { $params['content_type'] = 'text/html'; $params['encoding'] = $this->build_params['html_encoding']; $params['charset'] = $this->build_params['html_charset']; if (is_object($obj)) { return $obj->addSubpart($this->html, $params); } else { return new mime($this->html, $params); } } /** * Starts a message with a mixed part */ /* HPDL PHP3 */ // function &add_mixed_part() { function add_mixed_part() { $params['content_type'] = 'multipart/mixed'; return new mime('', $params); } /** * Adds an alternative part to a mime_part object */ /* HPDL PHP3 */ // function &add_alternative_part(&$obj) { function add_alternative_part(&$obj) { $params['content_type'] = 'multipart/alternative'; if (is_object($obj)) { return $obj->addSubpart('', $params); } else { return new mime('', $params); } } /** * Adds a html subpart to a mime_part object */ /* HPDL PHP3 */ // function &add_related_part(&$obj) { function add_related_part(&$obj) { $params['content_type'] = 'multipart/related'; if (is_object($obj)) { return $obj->addSubpart('', $params); } else { return new mime('', $params); } } /** * Adds an html image subpart to a mime_part object */ /* HPDL PHP3 */ // function &add_html_image_part(&$obj, $value) { function add_html_image_part(&$obj, $value) { $params['content_type'] = $value['c_type']; $params['encoding'] = 'base64'; $params['disposition'] = 'inline'; $params['dfilename'] = $value['name']; $params['cid'] = $value['cid']; $obj->addSubpart($value['body'], $params); } /** * Adds an attachment subpart to a mime_part object */ /* HPDL PHP3 */ // function &add_attachment_part(&$obj, $value) { function add_attachment_part(&$obj, $value) { $params['content_type'] = $value['c_type']; $params['encoding'] = $value['encoding']; $params['disposition'] = 'attachment'; $params['dfilename'] = $value['name']; $obj->addSubpart($value['body'], $params); } /** * Builds the multipart message from the * list ($this->_parts). $params is an * array of parameters that shape the building * of the message. Currently supported are: * * $params['html_encoding'] - The type of encoding to use on html. Valid options are * "7bit", "quoted-printable" or "base64" (all without quotes). * 7bit is EXPRESSLY NOT RECOMMENDED. Default is quoted-printable * $params['text_encoding'] - The type of encoding to use on plain text Valid options are * "7bit", "quoted-printable" or "base64" (all without quotes). * Default is 7bit * $params['text_wrap'] - The character count at which to wrap 7bit encoded data. * Default this is 998. * $params['html_charset'] - The character set to use for a html section. * Default is iso-8859-1 * $params['text_charset'] - The character set to use for a text section. * - Default is iso-8859-1 */ /* HPDL PHP3 */ // function build_message($params = array()) { function build_message($params = '') { if ($params == '') $params = array(); if (count($params) > 0) { foreach($params as $key => $value) { $this->build_params[$key] = $value; } } if (tep_not_null($this->html_images)) { foreach($this->html_images as $value) { $this->html = str_replace($value['name'], 'cid:' . $value['cid'], $this->html); } } $null = NULL; $attachments = ((tep_not_null($this->attachments)) ? true : false); $html_images = ((tep_not_null($this->html_images)) ? true : false); $html = ((tep_not_null($this->html)) ? true : false); $text = ((tep_not_null($this->text)) ? true : false); switch (true) { case (($text == true) && ($attachments == false)): /* HPDL PHP3 */ // $message =& $this->add_text_part($null, $this->text); $message = $this->add_text_part($null, $this->text); break; case (($text == false) && ($attachments == true) && ($html == false)): /* HPDL PHP3 */ // $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); for ($i=0; $i<count($this->attachments); $i++) { $this->add_attachment_part($message, $this->attachments[$i]); } break; case (($text == true) && ($attachments == true)): /* HPDL PHP3 */ // $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); $this->add_text_part($message, $this->text); for ($i=0; $i<count($this->attachments); $i++) { $this->add_attachment_part($message, $this->attachments[$i]); } break; case (($html == true) && ($attachments == false) && ($html_images == false)): if (tep_not_null($this->html_text)) { /* HPDL PHP3 */ // $message =& $this->add_alternative_part($null); $message = $this->add_alternative_part($null); $this->add_text_part($message, $this->html_text); $this->add_html_part($message); } else { /* HPDL PHP3 */ // $message =& $this->add_html_part($null); $message = $this->add_html_part($null); } break; case (($html == true) && ($attachments == false) && ($html_images == true)): if (tep_not_null($this->html_text)) { /* HPDL PHP3 */ // $message =& $this->add_alternative_part($null); $message = $this->add_alternative_part($null); $this->add_text_part($message, $this->html_text); /* HPDL PHP3 */ // $related =& $this->add_related_part($message); $related = $this->add_related_part($message); } else { /* HPDL PHP3 */ // $message =& $this->add_related_part($null); // $related =& $message; $message = $this->add_related_part($null); $related = $message; } $this->add_html_part($related); for ($i=0; $i<count($this->html_images); $i++) { $this->add_html_image_part($related, $this->html_images[$i]); } break; case (($html == true) && ($attachments == true) && ($html_images == false)): /* HPDL PHP3 */ // $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); if (tep_not_null($this->html_text)) { /* HPDL PHP3 */ // $alt =& $this->add_alternative_part($message); $alt = $this->add_alternative_part($message); $this->add_text_part($alt, $this->html_text); $this->add_html_part($alt); } else { $this->add_html_part($message); } for ($i=0; $i<count($this->attachments); $i++) { $this->add_attachment_part($message, $this->attachments[$i]); } break; case (($html == true) && ($attachments == true) && ($html_images == true)): /* HPDL PHP3 */ // $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); if (tep_not_null($this->html_text)) { /* HPDL PHP3 */ // $alt =& $this->add_alternative_part($message); $alt = $this->add_alternative_part($message); $this->add_text_part($alt, $this->html_text); /* HPDL PHP3 */ // $rel =& $this->add_related_part($alt); $rel = $this->add_related_part($alt); } else { /* HPDL PHP3 */ // $rel =& $this->add_related_part($message); $rel = $this->add_related_part($message); } $this->add_html_part($rel); for ($i=0; $i<count($this->html_images); $i++) { $this->add_html_image_part($rel, $this->html_images[$i]); } for ($i=0; $i<count($this->attachments); $i++) { $this->add_attachment_part($message, $this->attachments[$i]); } break; } if ( (isset($message)) && (is_object($message)) ) { $output = $message->encode(); $this->output = $output['body']; foreach($output['headers'] as $key => $value) { $headers[] = $key . ': ' . $value; } $this->headers = array_merge($this->headers, $headers); return true; } else { return false; } } /** * Sends the mail. */ function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = '') { if ((strstr($to_name, "\n") != false) || (strstr($to_name, "\r") != false)) { return false; } if ((strstr($to_addr, "\n") != false) || (strstr($to_addr, "\r") != false)) { return false; } if ((strstr($subject, "\n") != false) || (strstr($subject, "\r") != false)) { return false; } if ((strstr($from_name, "\n") != false) || (strstr($from_name, "\r") != false)) { return false; } if ((strstr($from_addr, "\n") != false) || (strstr($from_addr, "\r") != false)) { return false; } $to = (($to_name != '') ? '"' . $to_name . '" <' . $to_addr . '>' : $to_addr); $from = (($from_name != '') ? '"' . $from_name . '" <' . $from_addr . '>' : $from_addr); if (is_string($headers)) { $headers = explode($this->lf, trim($headers)); } for ($i=0; $i<count($headers); $i++) { if (is_array($headers[$i])) { for ($j=0; $j<count($headers[$i]); $j++) { if ($headers[$i][$j] != '') { $xtra_headers[] = $headers[$i][$j]; } } } if ($headers[$i] != '') { $xtra_headers[] = $headers[$i]; } } if (!isset($xtra_headers)) { $xtra_headers = array(); } $headers = array_merge($this->headers, array('From: ' . $from), $headers, $xtra_headers); $additional_parameters = ''; if ((PHP_VERSION > '5.3') || ((bool)ini_get('safe_mode') === false)) { $additional_parameters = '-f' . $from_addr; } //return mail($to, $subject, $this->output, implode($this->lf, $headers), $additional_parameters); require_once 'includes/classes/Exception.php'; // required_once needed to prevent redefining the class require_once 'includes/classes/PHPMailer.php'; require_once 'includes/classes/SMTP.php'; $pMail = new PHPMailer(); $pMail->From = $from_addr; $pMail->FromName = $from_name; $pMail->IsSMTP(); $pMail->Host = "MY INFO IS WRITTEN HERE"; // replace with your smtp server $pMail->Username = "MY INFO IS WRITTEN HERE"; // replace with your smtp username (if SMTPAuth is true) $pMail->Password = "MY INFO IS WRITTEN HERE"; // replace with your smtp password (if SMTPAuth is true) $pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication $pMail->Subject = $subject; $pMail->Body = $this->output; //$pMail->AltBody = 'Alternative text'; $pMail->AddAddress($to_addr, $to_name); //$pMail->addCC('email@email.com'); $pMail->addBCC('email@email.com'); $pMail->IsHTML(false); return $pMail->Send(); $pMail->ClearAddresses(); $pMail->ClearAttachments(); } /** * Use this method to return the email * in message/rfc822 format. Useful for * adding an email to another email as * an attachment. there's a commented * out example in example.php. * * string get_rfc822(string To name, * string To email, * string From name, * string From email, * [string Subject, * string Extra headers]) */ function get_rfc822($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = '') { // Make up the date header as according to RFC822 $date = 'Date: ' . date('D, d M y H:i:s'); $to = (($to_name != '') ? 'To: "' . $to_name . '" <' . $to_addr . '>' : 'To: ' . $to_addr); $from = (($from_name != '') ? 'From: "' . $from_name . '" <' . $from_addr . '>' : 'From: ' . $from_addr); if (is_string($subject)) { $subject = 'Subject: ' . $subject; } if (is_string($headers)) { $headers = explode($this->lf, trim($headers)); } for ($i=0; $i<count($headers); $i++) { if (is_array($headers[$i])) { for ($j=0; $j<count($headers[$i]); $j++) { if ($headers[$i][$j] != '') { $xtra_headers[] = $headers[$i][$j]; } } } if ($headers[$i] != '') { $xtra_headers[] = $headers[$i]; } } if (!isset($xtra_headers)) { $xtra_headers = array(); } $headers = array_merge($this->headers, $xtra_headers); return $date . $this->lf . $from . $this->lf . $to . $this->lf . $subject . $this->lf . implode($this->lf, $headers) . $this->lf . $this->lf . $this->output; } } ?> Is my changes correct?
  17. The whole website goes down when I upload the 2 email.php files. I upload them via FileZilla as I always do.
  18. My website goes down and stop working when I upload the 2 email.php files after the code changes.
  19. Please send me your 2 email.php files and write 0000 on your personal information.
  20. Thank you for your reply. I want to use SMTP instead of Sendmail because I want to be able to send mail to all customers different e-mails. I wonder if I can get some functional instructions on how to install phpmailer because these instructions does not function in my platform Frozen: 1 - copy files to both locations: catalog/includes/classes & admin/includes/classes Exception.php PHPMailer.php SMTP.php 2 - in catalog/includes/classes/email.php 2a - find class email { add before use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; 2b - in function send find: return mail($to, $subject, $this->output, implode($this->lf, $headers),$additional_parameters); require_once('includes/classes/class.phpmailer.php'); //THIS LINE DOES NOT EXIST IN MY FILE. comment out these two lines and add after: require_once 'includes/classes/Exception.php'; // required_once needed to prevent redefining the class require_once 'includes/classes/PHPMailer.php'; require_once 'includes/classes/SMTP.php'; $pMail = new PHPMailer(); $pMail->From = $from_addr; $pMail->FromName = $from_name; $pMail->IsSMTP(); $pMail->Host = "smtp.com"; // replace with your smtp server $pMail->Username = "email@email.com"; // replace with your smtp username (if SMTPAuth is true) $pMail->Password = "email_password"; // replace with your smtp password (if SMTPAuth is true) $pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication $pMail->Subject = $subject; $pMail->Body = $this->output; //$pMail->AltBody = 'Alternative text'; $pMail->AddAddress($to_addr, $to_name); //$pMail->addCC('email@email.com'); $pMail->addBCC('email@email.com'); $pMail->IsHTML(false); return $pMail->Send(); $pMail->ClearAddresses(); $pMail->ClearAttachments(); 3 - repeat change 2 in admin/classes/email.php I have corrected the path to this file: repeat change 2 in admin/includes/classes/email.php 4 - in osC admin email options, set the following: E-Mail Transport Method = smtp E-Mail Linefeeds = LF Use MIME HTML When Sending Emails = false Verify E-Mail Addresses Through DNS = false Send E-Mails = true that's it - done! I can not get above code to function in my installed version of Frozen https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip Is there someone who have managed to get phpmailer to work with the oscommerce platform Frozen?
  21. How to install Paypal to Frozen osCommerce Online Merchant v2.3.4.1 CE
  22. When I click on this button View Update An update is available for this App! View Update Manage API Credentials Enter your PayPal API Credentials and start selling with PayPal. Manage Your API Credentials After I have clicked on View Update then I can see this page: Apply Update v5.000 (11 Nov 2016) Use PayPal API 204. Add Merchant Account ID field to Manage Credentials page. PayPal Express Checkout: Enable In-Context checkout flow by default. PayPal Express Checkout: Add configuration parameters to control Checkout with PayPal button color, shape, and size. Remove country restrictions for API Retrieval service. General improvements and bugfixes. v5.001 (19 Feb 2017) Fix getIdentifier() usage in the PayPal Payments Standard module. v5.010 (1 Mar 2017) Add new general App parameter to test and use the default server configured SSL version when performing API requests to PayPals servers or force TLS v1.2 connections. (TLS v1.2 connections are required from June 30, 2017) Use the customer address suburb value as the street2 parameter value for Payments Standard, Express Checkout, Direct Payment, and Hosted Solution. Payments Standard: If "receiver_email" is not returned back to the store, fallback to "business" to verify the transaction with. Payments Standard: Disable the module if the App API Credentials or module PDT configuration parameters have not been entered. Either is now required to be able to verify the transaction when the customer returns back to the store after payment is made. Payments Standard: Strip extra slashes that were being logged. Payments Standard: Remove deprecated NO_NOTE and PAGE_STYLE parameters. (deprecated Sept. 2016) Express Checkout: Remove deprecated ALLOWNOTE and PAGESTYLE parameters. (deprecated Sept. 2016) Update osCommerce links from http to https. v5.011 (4 Mar 2017) Added compatibility layer for v2.3.4 BS Community Edition. v5.014 (5 Mar 2017) Express Checkout: Update checkout.js javascript to v4. Display EC requirement notice on the DP configuration page if EC is not enabled. Always show the View button on the PayPal App Log page. v5.016 (11 Mar 2017) Express Checkout: Pass the in-store selected shipping rate to the Instant Update Callback request and keep the shipping rate selected when the available shipping rates are displayed. Express Checkout: If a shipping rate has been selected in-store (eg, the customer did not use the "PayPal Check out" button on the shopping cart page but went through the in-store checkout procedure and selected Express Checkout as the payment method), keep the selected shipping rate when returning back to the store checkout confirmation page. The online update packages for v5.011 and v5.014 contained a hardcoded "admin/" path to update the "admin/paypal.php" file - if a custom administration directory name is used, please delete the "admin/" directory, this should only contain one "paypal.php" file which the v5.011 and v5.014 online update packages created. v5.018 (12 Mar 2017) Express Checkout: Allow a custom stylesheet to be loaded to help with the styling and positioning of the checkout buttons shown on the shopping cart page. Express Checkout: Add "id" to the checkout button html tags used on the shopping cart page. When I click on Apply Update button then I see this: Check for Updates Applying Updates Downloading v5.000 … Applying v5.000 … Error: Could not apply v5.000! An error occured during this update. [24-Mar-2019 20:37:34] **** ERROR: Could not update the following files. Please update the file and directory permissions to allow write access. [24-Mar-2019 20:37:34] /web/t1.zmm.se/public_html/includes/modules/payment/paypal_express.php [24-Mar-2019 20:37:34] /web/t1.zmm.se/public_html/includes/modules/payment/paypal_standard.php I have checked the rights on these 2 files and they both have the rights set to: 777 So what to do next?
  23. Thank you for your reply. But your instructions is not functional with my platform. My oscommerce platform is Frozen https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip Version Checker Installed Version: osCommerce Online Merchant v2.3.4.1 CE Please send instructions that is working for my installed version.
  24. I have now succeded to uninstall this module. Now I will try to install your new multilanguage module.
×