cairo Posted February 2, 2009 Share Posted February 2, 2009 I have a problem. I have 18 options that are required to build an order. So reading/invoice for that order you also get unused attributes, meaning you have the order along with a list of options(attributes). For clarity sake, is there a way to not show the unused attributes/options on the receipt/invoice? I would like to know if I can make some modifications so oscommerce spits out just the options used rather than a whole list of unused ones? Please Help!!!! Quote Link to comment https://forums.phpfreaks.com/topic/143486-oscommerce-help/ Share on other sites More sharing options...
Maq Posted February 3, 2009 Share Posted February 3, 2009 Have you tried the osCommerce forums? It may come with an interface to handle this, but I'm not sure... If not, you would have to find the correct modules and edit them. I've worked with osCommerce a lot but don't know the modules off hand. is there a way to not show the unused attributes/options on the receipt/invoice? If you do find the module you would have to check to see if the attributes are either empty or !isset and not pass them into the invoice. Sorry, that's all I can really say, good luck Quote Link to comment https://forums.phpfreaks.com/topic/143486-oscommerce-help/#findComment-753559 Share on other sites More sharing options...
cairo Posted February 4, 2009 Author Share Posted February 4, 2009 Hey Maq! Man, its been months that no one really bothered with my question. I really appreciate your time. The module you are speaking about is the invoice.php that im running. Well Im not a "guru" but able to understand sum functions. I'll paste the php file here and hopefully you can point me to the right direction. <?php if (SEND_EMAILS == 'true') { if (EMAIL_USE_HTML == 'true') { $ei_admin = DIR_FS_ADMIN; $ei_template_dir = DIR_WS_MODULES . EMAIL_INVOICE_DIR . INVOICE_TEMPLATE_DIR ; $ei_image_dir = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES; $ei_css_path = HTTP_SERVER . DIR_WS_CATALOG . $ei_template_dir; $ei_template_file = $ei_template_dir . EMAIL_TEMPLATE_FILE; $ei_temp_file = DIR_WS_MODULES . EMAIL_INVOICE_DIR . FILENAME_EMAIL_CACHE_FILE; require(DIR_FS_ADMIN . DIR_WS_LANGUAGES . $language . "/" . FILENAME_ORDERS_INVOICE); $currencies = new currencies(); $oID = $insert_id; $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $order = new order($oID); $date = date('M d, Y'); ob_start(); include($ei_template_file); //this can be done in one funciton call in PHP >= 4.3.0 but to keep it compatible, I use 2 $ei_html_email = ob_get_contents(); ob_end_clean(); // Replace relative paths to absolute paths // and space since the email class adds tons of <br> tags if you don't // strip them out first $ei_search = array( "\n" , "\r" ); $ei_html_email = str_replace($ei_search, "", $ei_html_email); $ei_html_email = str_replace('src="images/', "src=\"$ei_image_dir", $ei_html_email); } // Build the standard email using OSC code $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, $n=sizeof($order_totals); $i<$n; $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"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } // Add both versions to the email to accomodate people who see html and those that don't $ei_message = new email(array('X-Mailer: osCommerce Mailer')); // Build the text version $ei_text = strip_tags($email_order); if (!empty($ei_html_email)) { $ei_message->add_html($ei_html_email, $ei_text); } else { $ei_message->add_text($ei_text); } $ei_message->build_message(); $ei_message->send($order->customer['name'], $order->customer['email_address'], STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_SUBJECT); if (SEND_EXTRA_ORDER_EMAILS_TO != '') { $ei_message->send('', SEND_EXTRA_ORDER_EMAILS_TO, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_SUBJECT); } } ?> THANK YOU!!! Quote Link to comment https://forums.phpfreaks.com/topic/143486-oscommerce-help/#findComment-754618 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.