Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

baavandus

Members
  • Content count

    14
  • Joined

  • Last visited

Profile Information

  • Real Name
    Neant
  • Location
    tx
  • Website
  1. baavandus

    [contribution] Send_order_html_email

    Here it is: <?php $html_email_order = "<html>"; $html_email_order .= "<head>"; $html_email_order .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"> "; $html_email_order .= "$Varhttp "; $html_email_order .= "$Varstyle "; $html_email_order .= "</head>"; $html_email_order .= "<body>"; $html_email_order .= "<table width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"; $html_email_order .= " <tr>"; $html_email_order .= " <td><table width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"; $html_email_order .= " <tr> "; $html_email_order .= " <td>$Vartable1"; $html_email_order .= " <tr> "; $html_email_order .= " <td><font face=\"verdana, arial\" size=\"-1\">$Varlogo</font></td>"; $html_email_order .= " </tr>"; $html_email_order .= " </table></td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr> "; $html_email_order .= " <td>$Vartable2 "; $html_email_order .= " <tr> "; $html_email_order .= " <td class=\"main\">$Vartext1</td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr height=\"12\" class=\"detail\"> "; $html_email_order .= " <td height=\"12\"> </td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr class=\"detail\"> "; $html_email_order .= " <td class=\"main\">$Vartext2</td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr height=\"12\"> "; $html_email_order .= " <td height=\"12\"> </td>"; $html_email_order .= " </tr>"; $html_email_order .= " </table></td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr>"; $html_email_order .= " <td><table width=\"600\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=white>"; $html_email_order .= " <tr> "; $html_email_order .= " <td class=\"boxmail\" align=\"center\" width=\"80\">Image</td>"; $html_email_order .= " <td class=\"boxmail\" align=\"left\" width=\"260\">$VarArticles</td>"; $html_email_order .= " <td class=\"boxmail\" align=\"left\" width=\"120\">$VarModele</td>"; $html_email_order .= " <td class=\"boxmail\" align=\"center\" width=\"40\">$VarQte</td>"; $html_email_order .= " <td class=\"boxmail\" align=\"right\" width=\"80\">$VarTotal</td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr> "; $html_email_order .= " <td width=\"80\" valign=\"top\" align=\"center\" class=\"boxmailgris\">$products_images</td>"; $html_email_order .= " <td width=\"260\" valign=\"top\" align=\"left\" class=\"boxmailgris\">$products_name</td>"; $html_email_order .= " <td width=\"120\" valign=\"top\" align=\"left\" class=\"boxmailgris\">$products_model</td>"; $html_email_order .= " <td width=\"40\" valign=\"top\" align=\"center\" class=\"boxmailgris\">$products_quantity</td>"; $html_email_order .= " <td width=\"80\" valign=\"top\" align=\"right\" class=\"boxmailgris\">$products_price</td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr height=\"12\"> "; $html_email_order .= " <td height=\"12\" width=\"300\" valign=\"top\" align=\"left\" class=\"tableur\">$Vardetail</td>"; $html_email_order .= " <td colspan=\"4\" width=\"300\" valign=\"top\" align=\"right\" class=\"tableur\">$Vartaxe</td>"; $html_email_order .= " </tr>"; $html_email_order .= " </table></td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr>"; $html_email_order .= " <td><table width=\"600\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=white>"; $html_email_order .= " <tr> "; $html_email_order .= " <td width=\"300\" class=\"boxmail\">$VarAddresship</td>"; $html_email_order .= " <td width=\"300\" class=\"boxmail\">$VarAddressbill</td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr> "; $html_email_order .= " <td width=\"300\" valign=\"top\" align=\"left\" class=\"boxmailgris\">$Varshipaddress</td>"; $html_email_order .= " <td width=\"300\" valign=\"top\" align=\"left\" class=\"boxmailgris\">$Varadpay</td> "; $html_email_order .= " </tr>"; $html_email_order .= " </table></td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr>"; $html_email_order .= " <td><table width=\"600\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=white>"; $html_email_order .= " <tr> "; $html_email_order .= " <td class=\"boxmail\">$Varmetodpaye</td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr> "; $html_email_order .= " <td class=\"boxmailgris\">$Varmodpay</td> "; $html_email_order .= " </tr>"; $html_email_order .= " </table></td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr>"; $html_email_order .= " <td><table width=\"600\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=white>"; $html_email_order .= " <tr height=\"12\"> "; $html_email_order .= " <td height=\"12\"> </td>"; $html_email_order .= " </tr>"; $html_email_order .= " <tr class=\"main\"> "; $html_email_order .= " <td class=\"footer\">$Varmailfooter</td> "; $html_email_order .= " </tr>"; $html_email_order .= " </table></td>"; $html_email_order .= " </tr>"; $html_email_order .= "</table></td>"; $html_email_order .= "</tr>"; $html_email_order .= "</table>"; $html_email_order .= "</body>"; $html_email_order .= "</html>"; ?> Will appriciate any help with this one!!
  2. baavandus

    [contribution] Send_order_html_email

    Here is my catalog/checkout_process.php : <?php /* $Id: checkout_process.php,v 1.128 2003/05/28 18:00:29 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2007 osCommerce Released under the GNU General Public License */ include('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } if (!tep_session_is_registered('sendto')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } // avoid hack attempts during the checkout procedure by checking the internal cartID if (isset($cart->cartID) && tep_session_is_registered('cartID')) { if ($cart->cartID != $cartID) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS); // load selected payment module require(DIR_WS_CLASSES . 'payment.php'); $payment_modules = new payment($payment); // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping($shipping); require(DIR_WS_CLASSES . 'order.php'); $order = new order; require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; $order_totals = $order_total_modules->process(); // load the before_process function from the payment modules $payment_modules->before_process(); $sql_data_array = array('customers_id' => $customer_id, 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], 'customers_company' => $order->customer['company'], 'customers_street_address' => $order->customer['street_address'], 'customers_suburb' => $order->customer['suburb'], 'customers_city' => $order->customer['city'], 'customers_postcode' => $order->customer['postcode'], 'customers_state' => $order->customer['state'], 'customers_country' => $order->customer['country']['title'], 'customers_telephone' => $order->customer['telephone'], 'customers_email_address' => $order->customer['email_address'], 'customers_address_format_id' => $order->customer['format_id'], 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 'delivery_company' => $order->delivery['company'], 'delivery_street_address' => $order->delivery['street_address'], 'delivery_suburb' => $order->delivery['suburb'], 'delivery_city' => $order->delivery['city'], 'delivery_postcode' => $order->delivery['postcode'], 'delivery_state' => $order->delivery['state'], 'delivery_country' => $order->delivery['country']['title'], 'delivery_address_format_id' => $order->delivery['format_id'], 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'billing_company' => $order->billing['company'], 'billing_street_address' => $order->billing['street_address'], 'billing_suburb' => $order->billing['suburb'], 'billing_city' => $order->billing['city'], 'billing_postcode' => $order->billing['postcode'], 'billing_state' => $order->billing['state'], 'billing_country' => $order->billing['country']['title'], 'billing_address_format_id' => $order->billing['format_id'], 'payment_method' => $order->info['payment_method'], 'shipping_module' => $shipping['id'], 'cc_type' => $order->info['cc_type'], 'cc_owner' => $order->info['cc_owner'], 'cc_number' => $order->info['cc_number'], 'cc_expires' => $order->info['cc_expires'], 'date_purchased' => 'now()', 'orders_status' => $order->info['order_status'], 'currency' => $order->info['currency'], 'currency_value' => $order->info['currency_value']); tep_db_perform(TABLE_ORDERS, $sql_data_array); $insert_id = tep_db_insert_id(); for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $sql_data_array = array('orders_id' => $insert_id, 'title' => $order_totals[$i]['title'], 'text' => $order_totals[$i]['text'], 'value' => $order_totals[$i]['value'], 'class' => $order_totals[$i]['code'], 'sort_order' => $order_totals[$i]['sort_order']); tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); } $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0'; $sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => $order->info['order_status'], 'date_added' => 'now()', 'customer_notified' => $customer_notification, 'comments' => $order->info['comments']); tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); //kgt - discount coupons if( tep_session_is_registered( 'coupon' ) && is_object( $order->coupon ) ) { $sql_data_array = array( 'coupons_id' => $order->coupon->coupon['coupons_id'], 'orders_id' => $insert_id ); tep_db_perform( TABLE_DISCOUNT_COUPONS_TO_ORDERS, $sql_data_array ); } //end kgt - discount coupons // initialized for the email confirmation $products_ordered = ''; $subtotal = 0; $total_tax = 0; for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { // Stock Update - Joao Correia if (STOCK_LIMITED == 'true') { if (DOWNLOAD_ENABLED == 'true') { $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id=pa.products_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad ON pa.products_attributes_id=pad.products_attributes_id WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; // Will work with only one option for downloadable products // otherwise, we have to build the query dynamically with a loop $products_attributes = $order->products[$i]['attributes']; if (is_array($products_attributes)) { $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'"; } $stock_query = tep_db_query($stock_query_raw); } else { $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } if (tep_db_num_rows($stock_query) > 0) { $stock_values = tep_db_fetch_array($stock_query); // do not decrement quantities if products_attributes_filename exists if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } } } // Update products_ordered (for bestsellers list) tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); $sql_data_array = array('orders_id' => $insert_id, 'products_id' => tep_get_prid($order->products[$i]['id']), 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty']); tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array); $order_products_id = tep_db_insert_id(); //begin add receipt// tep_session_register('last_order'); $last_order = $insert_id; $oID = $last_order; //end add receipt// //------insert customer choosen option to order-------- $attributes_exist = '0'; $products_ordered_attributes = ''; if (isset($order->products[$i]['attributes'])) { $attributes_exist = '1'; for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { if (DOWNLOAD_ENABLED == 'true') { $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad on pa.products_attributes_id=pad.products_attributes_id where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"; $attributes = tep_db_query($attributes_query); } else { $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); } $attributes_values = tep_db_fetch_array($attributes); $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'products_options' => $attributes_values['products_options_name'], 'products_options_values' => $attributes_values['products_options_values_name'], 'options_values_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']); tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) { $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'orders_products_filename' => $attributes_values['products_attributes_filename'], 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 'download_count' => $attributes_values['products_attributes_maxcount']); tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array); } $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; } } //------insert customer choosen option eof ---- //BEGIN SEND HTML MAIL// $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n"; $products_quantity .= nl2br($order->products[$i]['qty'] . "\n"); $products_name .= nl2br("" . $order->products[$i]['name'] . $products_ordered_attributes ."\n"); if (!tep_not_null($order->products[$i]['model'])) { $products_model .= ''.EMAIL_NO_MODEL.'' ; } else $products_model .= nl2br($order->products[$i]['model'] . "\n"); $products_price .= nl2br($currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty']) . "\n"); } for ($i=0; $i<sizeof($order_totals); $i++) { $Vartaxe .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } if ($order->content_type != 'virtual') { $Varaddress .= tep_address_label($customer_id, $sendto, 0, '', "\n") ; } if (is_object($$payment)) { $Varmodepay .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $Varmodpay .= $payment_class->title . "\n"; if ($payment_class->email_footer) { $Varmodpay .= $payment_class->email_footer . "\n\n"; } } $Varlogo = ''.VARLOGO.'' ; $Vartable1 = ''.VARTABLE1.'' ; $Vartable2 = ''.VARTABLE2.'' ; $Vartext1 = ' <b>' . EMAIL_TEXT_DEAR . ' ' . $order->customer['firstname'] . ' ' . $order->customer['lastname'] .' </b><br>' . EMAIL_MESSAGE_GREETING ; $Vartext2 = ' ' . EMAIL_TEXT_ORDER_NUMBER . ' <STRONG> ' . $insert_id . '</STRONG><br>' . EMAIL_TEXT_DATE_ORDERED . ': <strong>' . strftime(DATE_FORMAT_LONG) . '</strong><br><a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'account_history_info.php?order_id=' . $insert_id .'">' . EMAIL_TEXT_INVOICE_URL . '</a>' ; $Varmailfooter = ''.VARMAILFOOTER.'' ; $VarArticles= ''.EMAIL_TEXT_PRODUCTS_ARTICLES.'' ; $VarModele= ''.EMAIL_TEXT_PRODUCTS_MODELE.'' ; $VarQte= ''.EMAIL_TEXT_PRODUCTS_QTY .'' ; $VarTotal= ''.EMAIL_TEXT_TOTAL.'' ; $VarAddresship = ''.EMAIL_TEXT_DELIVERY_ADDRESS.'' ; $VarAddressbill = ''.EMAIL_TEXT_BILLING_ADDRESS.'' ; $Varmetodpaye = ''.EMAIL_TEXT_PAYMENT_METHOD.'' ; $Vardetail = ''.DETAIL .'' ; $Varhttp = ''.VARHTTP.''; $Varstyle = ''.VARSTYLE.''; $Varshipaddress =''.tep_address_label($customer_id, $sendto).''; $Varadpay = ''.tep_address_label($customer_id, $billto).''; require(DIR_WS_MODULES . 'email/html_checkout_process.php'); $email_order = $html_email_order ; // lets start with the email confirmation if (EMAIL_USE_HTML == 'true') { $email_order; } else { $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; if ($order->info['comments']) { + $email_order .= tep_db_output($order->info['comments']) . "\n\n"; } $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n"; for ($i=0; $i<sizeof($order_totals); $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } if ($order->content_type != 'virtual') { $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; } $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_order .= $payment_class->title . "\n\n\n\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } $email_order .= "\n" . EMAIL_TEXT_FOOTER . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n" . EMAIL_TEXT_FOOTERR . "\n" ; } tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ''); $email_order=ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\">\</a>", $email_order); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { $email_order = $html_email_order ; if (EMAIL_USE_HTML == 'true') { $email_order; } else { $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; if ($order->info['comments']) { + $email_order .= tep_db_output($order->info['comments']) . "\n\n"; } $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n"; for ($i=0; $i<sizeof($order_totals); $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } if ($order->content_type != 'virtual') { $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; } $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_order .= $payment_class->title . "\n\n\n\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } $email_order .= "\n" . EMAIL_TEXT_FOOTER . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n" . EMAIL_TEXT_FOOTERR . "\n" ; } tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ''); $email_order=ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\">\</a>", $email_order); } //END SEND HTML MAIL// // load the after_process function from the payment modules $payment_modules->after_process(); $cart->reset(true); // unregister session variables used during checkout tep_session_unregister('sendto'); tep_session_unregister('billto'); tep_session_unregister('shipping'); tep_session_unregister('payment'); tep_session_unregister('comments'); //kgt - discount coupons tep_session_unregister('coupon'); //end kgt - discount coupons tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  3. baavandus

    [contribution] Send_order_html_email

    Hi - thx for a great contrib - having some trouble with it though: There are no products listed in the confirmation mail???!!! (testing mode.... ) : Can anyone PLEEEEEASE help - I'm going nuts trying to solve it!!! Gav
  4. baavandus

    Need help! How to?

    Found It.... fixed
  5. baavandus

    Howto change font on printable catalog?

    ANOTHER problem in the printable catalog: Can't sort in any colums? Where do I look? My page is here.... or here Please remember NOT to make any test order... live (almost done) shop....: Thank you PS. Still can't get the buttom navigation (prev - and next) font changed?!* Can anyone help?
  6. baavandus

    Need help! How to?

    Ooook? Can you be more specific?
  7. baavandus

    Howto change font on printable catalog?

    THANK YOU!! Don't know why I didn't see this!!
  8. baavandus

    NEW! Complete Order Editing Tool!

    I have installed mod: order_editor_5_0_6 (works great!!!! thank you!!!) to be able to use the manual order (from admin) mod: V1.4.2. BUT For some reason I get an http 500 error when trying to access create_order.php through customer or order in admin???? Basicly this mod do not work for me....... The edit function still works. I'm fairly new to php and sql - have checked all relevant files - but can't find any reason to why it's not working???? I would love to be able to use this mod so I hope you can help!!! Thank you!
  9. I have installed printablecatalogmyslq 5 but for some reason I can NOT change font on the results??? Have tried everything from adjusting directly in includes/catalog_products_with_images.php and stylesheet.css - but NO lUCK..... Can anyone help? The link to my problem is: here THANK you!!! PS. This is a live shop in working progress - so please so not perform tests!
  10. baavandus

    Need help! How to?

    I finally managed to install additional images, and get lightbox effect to work :rolleyes: BUT - the lightbox is NOT centered on page? Could it be because I used CSS to center shop? Also - is it possible to change lightbox "background" color (the gray overlay effect.........)? Thank you in advance :thumbsup: My problem page..... (PLEASE NOTE!! This is a LIVE shop - work in progress - so DO NOT TEST ORDERS etc.) AND - the picture title in lightbox is NOT updated (visible) untill second pic has been chosen (back and forward) - how do I solve that? AND - is there a way so the 'prev' and 'next' buttons are visible at all times (if additional pics!)? PLEASE - I'm a novice in PHP (and English is not my native language) so have patience..... :blink:
  11. baavandus

    Full 5.19 CCGV package?

    Would like to install CCGV (again) - but can't seem to find a full (working) updated package.. had some trouple installing it AFTER OT discount coupons contrib - which worked great!!! But need gift voucher too...so i'm trying this one again :rolleyes: Would also like a downloadable version of gift card, but the one in contrib lib dosn't work - Online Giftcard -..... :huh: Can anyone direct me in the correct direction to which files are the most updated CCGV? Thanks a million
  12. baavandus

    HELP - Online Gift Card v1.0

    After the above problem I have this: I can checkout fine. I can also use the gift card, everything is fine all amount are correct through the order process. (Should add Gift Card as payment option?). UNTILL the order confirmaation is mailed and stored in the system - then the amount of gift card used is equal to the amount that is left (makes sense??). So a calculation is wrong somewhere.... where should I look? :blush:
  13. baavandus

    HELP - Online Gift Card v1.0

    Fixed! so far... I reversed the update of this file... seem to work in admin. BUT now - when I'm testing gift card - I can add the gift card, but gets an error when pushing "add to cart" or just want to see the cart! So I'm guessing that there is a problem with the shpping cart :blink:? My catalog/shopping_cart.php file looks like this: <?php /* $Id: shopping_cart.php,v 1.73 2003/06/09 23:03:56 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require("includes/application_top.php"); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART); * gift card modification */ $error = false; if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'gift_card')) { $gift_card_check = tep_db_query("select * from `".TABLE_GIFT_CARDS."` where gift_cards_code='".$HTTP_POST_VARS['gift_card_code']."' and gift_cards_enabled='1'"); if (tep_db_num_rows($gift_card_check)>0) { // found a record $gift_card_row = tep_db_fetch_array($gift_card_check); $_SESSION['gift_card'] = $gift_card_row['gift_cards_code']; //tep_session_register('gift_card'); $messageStack->add('shopping_cart_success', SUCCESS_GIFT_CARD.'$ '.$gift_card_row['gift_cards_amount_remaining'], 'success'); } else { // error, bad gift card code // spit out error to the user, so they know what is going on $error = true; } } else if (tep_session_is_registered('gift_card')) { $gift_card_check = tep_db_query("select * from `".TABLE_GIFT_CARDS."` where gift_cards_code='".$_SESSION['gift_card']."' and gift_cards_enabled='1'"); if (tep_db_num_rows($gift_card_check)>0) { // found a record $gift_card_row = tep_db_fetch_array($gift_card_check); //tep_session_register('gift_card'); $messageStack->add('shopping_cart_success', SUCCESS_GIFT_CARD.'$ '.$gift_card_row['gift_cards_amount_remaining'], 'success'); } } if ($error) { $messageStack->add('shopping_cart', GIFT_CARD_ERROR); } /* gift card modification */ $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART)); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_cart.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php /* gift card modification */ if ($messageStack->size('shopping_cart') > 0) { ?> <tr> <td><?php echo $messageStack->output('shopping_cart'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if ($messageStack->size('shopping_cart_success') > 0) { ?> <tr> <td><?php echo $messageStack->output('shopping_cart_success'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } /* end of gift card modification */ ?> <?php if ($cart->count_contents() > 0) { ?> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[0][] = array('align' => 'center', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_REMOVE); $info_box_contents[0][] = array('params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_PRODUCTS); $info_box_contents[0][] = array('align' => 'center', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_QUANTITY); $info_box_contents[0][] = array('align' => 'right', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_TOTAL); $any_out_of_stock = 0; $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { // Push all attributes information in an array if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { while (list($option, $value) = each($products[$i]['attributes'])) { echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'"); $attributes_values = tep_db_fetch_array($attributes); $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name']; $products[$i][$option]['options_values_id'] = $value; $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name']; $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price']; $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix']; } } } for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (($i/2) == floor($i/2)) { $info_box_contents[] = array('params' => 'class="productListing-even"'); } else { $info_box_contents[] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($info_box_contents) - 1; $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id'])); $products_name = '<table border="0" cellspacing="2" cellpadding="2">' . ' <tr>' . ' <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . ' <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>'; if (STOCK_CHECK == 'true') { $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']); if (tep_not_null($stock_check)) { $any_out_of_stock = 1; $products_name .= $stock_check; } } if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { reset($products[$i]['attributes']); while (list($option, $value) = each($products[$i]['attributes'])) { $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>'; } } $products_name .= ' </td>' . ' </tr>' . '</table>'; $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"', 'text' => $products_name); $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id'])); $info_box_contents[$cur_row][] = array('align' => 'right', 'params' => 'class="productListing-data" valign="top"', 'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>'); } new productListingBox($info_box_contents); ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td align="right" class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></b></td> </tr> <?php if ($any_out_of_stock == 1) { if (STOCK_ALLOW_CHECKOUT == 'true') { ?> <tr> <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td> </tr> <?php } else { ?> <tr> <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td> </tr> <?php } } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td> <?php $back = sizeof($navigation->path)-2; if (isset($navigation->path[$back])) { ?> <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td> <?php } ?> <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { ?> <tr> <td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } ?> </table></form> <!-- gift card modification //--> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td align="right"><?php echo tep_draw_form('gift_card_form', tep_href_link(FILENAME_SHOPPING_CART, 'action=gift_card', 'SSL'), 'post'); ?>Gift Card Code: <input type="text" name="gift_card_code"><br /><?php echo dyton_draw_submit('Update Price', 'class="page_buttons"'); ?></form><br /><font color="#FF0000">** Gift card discounts will be applied after a payment method has been chosen.</font></td> </tr> </table> <!-- end of gift card modification //--> </td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> AND my catalog/includes/languages/english/shopping_cart.php like this: <?php /* $Id: shopping_cart.php,v 1.13 2002/04/05 20:24:02 project3000 Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License */ define('NAVBAR_TITLE', 'Cart Contents'); define('HEADING_TITLE', 'What\'s In My Cart?'); define('TABLE_HEADING_REMOVE', 'Remove'); define('TABLE_HEADING_QUANTITY', 'Qty.'); define('TABLE_HEADING_MODEL', 'Model'); define('TABLE_HEADING_PRODUCTS', 'Product(s)'); define('TABLE_HEADING_TOTAL', 'Total'); define('TEXT_CART_EMPTY', 'Your Shopping Cart is empty!'); define('SUB_TITLE_SUB_TOTAL', 'Sub-Total:'); define('SUB_TITLE_TOTAL', 'Total:'); define('OUT_OF_STOCK_CANT_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' dont exist in desired quantity in our stock.<br>Please alter the quantity of products marked with (' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '), Thank you'); define('OUT_OF_STOCK_CAN_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' dont exist in desired quantity in our stock.<br>You can buy them anyway and check the quantity we have in stock for immediate deliver in the checkout process.'); /* gift card modification */ define('GIFT_CARD_ERROR', 'The gift card code you entered does not exist or the amount remaining is $0.00.'); define('SUCCESS_GIFT_CARD', 'Gift card amount to be applied at checkout: '); /* end of gift card modification */ ?> Hope someone can help :rolleyes:
  14. Hi, I'm new at php/ sql and oscommerce, so forgive me if my problem is obvious to the expert :blush: Have installed several mods - among these is discount coupons, that works great!!! I do need a Gift Card function too, so I thought I would install Online gift card mod as well....... had to manually update the files because of the other mods.... BUT - After the update, I can no longer see my admin page? Only the links on the left.... no main "frame" is visible??? I'm not exactly sure what to look for, but the files affected in Online gift card mod are (list from install instruction): admin/categories.php admin/includes/filenames.php admin/includes/database_tables.php admin/includes/boxes/catalog.php (Called categories in install instruction text?) admin/includes/languages/english.php admin/includes/languages/english/categories.php checkout_confirmation.php checkout_process.php checkout_shipping.php checkout_success.php account.php shopping_cart.php includes/database_tables.php includes/filenames.php includes/classes/shopping_cart.php includes/classes/order.php includes/functions/general.php includes/languages/english/account.php includes/languages/english/checkout_confirmation.php includes/languages/english/checkout_success.php includes/languages/english/shopping_cart.php Which file would be the troublemaker? And what should I look for? Thanks a million!!!
×