Latest News: (loading..)

indicaz

Members
  • Content count

    78
  • Joined

  • Last visited

1 Follower

About indicaz

Profile Information

  1. <?php /* $Id: orderlist.php, v 3.3 2005/2/10 21:08:47 dgw_ Exp $ Made by zlack, www.partshop.nl osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2004 osCommerce Released under the GNU General Public License This is not a real "contribution" but more an addon. Since i order each day (i keep no stock) i found it very much work to open each order to see what someone ordered. This little script does that for me, and shows everything nice in tables, so i can e-mail the output to my distributor :) Questions, comments, thank you's and so on: zlack AT partshop.nl */ // Buffering ob_start(); require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); include(DIR_WS_CLASSES . 'order.php'); $order_status = $select_order_status; $display_order_status = $order_status; if ($order_status == "") { $order_status = 1; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title><?php echo TITLE . ' - ' . OL_TITLE ?></title> <link rel="stylesheet" type="text/css" href="orderlist-styles.css" media="all" > </head> <body> <h1><?php echo OL_HEAD; ?></h1><br> <h2> <?php $query_status = "SELECT * FROM " . TABLE_ORDERS_STATUS . " where `orders_status_id` = $order_status AND language_id = $languages_id"; $status_result = tep_db_query($query_status); while ($row4 = tep_db_fetch_array($status_result)) { echo "("; $orders_status_name = $row4['orders_status_name']; echo $orders_status_name; echo ")"; } // FORM THAT LETS YOU SELECT WHICH ORDER STATUS TO DISPLAY ?> </h2> <form name="orderstatus" method="post" action="<?php echo $PHP_SELF?>"> <?php echo OL_ENTRY_DAYS ?><input name="orderlist_days" type="text" id="orderlist_days" size="5"> <?php $query_status = "SELECT * FROM " . TABLE_ORDERS_STATUS . " WHERE language_id = $languages_id"; $status_result = tep_db_query($query_status); echo OL_SELECT_STATUS . " "; echo "<select name=\"select_order_status\">"; echo "<option value=></option>"; while ($row3 = tep_db_fetch_array($status_result)) { echo "<option value="; echo $row3['orders_status_id']; echo ">"; echo $row3['orders_status_name']; echo "</option><br>"; } echo "</select>"; ?> <input type="submit" name="Submit" value="<?php echo OL_SUBMIT; ?>"> <input type="button" value="<?php echo OL_PRINT; ?>" onClick="window.print()" /> </form> <TABLE width="100%" align=center cellSpacing=1 cellPadding=4 border=1> <TBODY> <TR class="headers"> <TD class="orderNr" align="center"><?php echo OL_ORDERNR; ?></TD> <TD class="date" align="center"><?php echo OL_DATE; ?></TD> <TD class="name"><?php echo OL_NAME; ?></TD> <TD class="details"><?php echo OL_DETAILS; ?></TD> </TR> <?php if (!isset($orderlist_days)) { $orderlist_days=ORDERLIST_DAYS; } $query1 = "SELECT * FROM " . TABLE_ORDERS . " WHERE orders_status = $order_status and TO_DAYS(NOW()) - TO_DAYS(date_purchased) < '" . $orderlist_days . "' ORDER BY orders_id DESC"; $result = tep_db_query($query1); while ($row = tep_db_fetch_array($result)) { $ordernummer = $row['orders_id']; ?> <TR> <TD align="center" valign="top"> <b> <?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $ordernummer . '&action=edit') . '" target="_NEW">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $ordernummer; ?> </b></TD> <TD align="center" valign="top"> <?php echo tep_datetime_short($row['date_purchased']);?></TD> <TD valign="top"> <?php echo OL_CUSTOMERNAME .' '. $row{'delivery_name'}; ?><br> <?php echo OL_ADDRESS .' '. $row{'delivery_street_address'}; ?><br> <?php echo OL_CITY .' '. $row{'delivery_city'}; ?><br> <?php echo OL_ZIP .' '. $row{'delivery_postcode'}; ?><br> <?php echo OL_TEL .' '. $row{'customers_telephone'}; ?><br> <?php echo OL_EMAIL .' '. $row{'customers_email_address'}; ?> </TD> <TD valign="top"> <?php $order = new order($ordernummer); for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { // Manufacturer Listing //Use the products ID# to find the proper Manufacturer of this specific product $v_query = tep_db_query("SELECT manufacturers_id FROM ".TABLE_PRODUCTS." WHERE products_id = '".$order->products[$i]['products_id']."'"); $v = tep_db_fetch_array($v_query); //Select the proper Manufacturers Name via the Manufacturers ID# then display that name for a human readable output $mfg_query = tep_db_query("SELECT manufacturers_name FROM ".TABLE_MANUFACTURERS." WHERE manufacturers_id = '".$v['manufacturers_id']."'"); $mfg = tep_db_fetch_array($mfg_query); // End Manufacturer Listing ?> <b><a href="<?php echo tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $order->products[$i]['products_id'] . '&oID=' . $oID . '&origin=' . FILENAME_ORDERS . '?oID=' . $oID . '&retOID=' . $oID . '&retAction=edit');?>"><?php echo $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name']; ?></a></b> <?php echo OL_MODEL . $order->products[$i]['model']; ?><br><?php echo OL_MANU . $mfg['manufacturers_name']; ?><br> <?php // Modified to use the products_id for the product image instead of products_model since model is non-unique $products_query_raw = "select products_image from products where products_id =" . $order->products[$i]['id']; $products_query = tep_db_query($products_query_raw); $products = tep_db_fetch_array($products_query); // Added 12/2005 Get Image from Data Base CED ?> <?php echo ' <tr class="dataTableRow">' . "\n" . ' <td class="dataTableContent" align="left">' . tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $products['products_image'], $listing_values['products_image'], SMALL_IMAGE_HEIGHT, SMALL_IMAGE_WIDTH) . '</a> </td>' . ' <td class="dataTableContent" valign="top" align="left">' . $order->products[$i]['qty'] . ' </td>' . "\n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['name']; ?> <?php //******************************************* //!!START MOD!!: Display Attribs //******************************************* //echo OL_MANU . ' ' . $mfg['manufacturers_name']."<br>"; //Doesn't work //echo OL_MODEL . ' ' . $order->products[$i]['model']."<br>"; //Doesn't work $j = 0; while ($products_options = $order->products[$i]['attributes'][$j]['option']) { //$products_options = $order->products[$i]['attributes'][$j]['option']; $products_options_values = $order->products[$i]['attributes'][$j]['value']; echo "<b>$products_options</b> = $products_options_values<br>"; $j++; } //******************************************* //!!END MOD!! //******************************************* ?> <?php } ?> <?php echo '--------------------------------------'; ?><br> <?php echo $row{'payment_method'}; ?><br> <?php for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { ?> <?php echo '<br>' . $order->totals[$i]['title'] . ' ' . $order->totals[$i]['text']; ?> <?php } ?> </TD> </TR> <?php } ?> </table> </body> </html> <?php ob_end_flush(); ?> Displays things much nicer now and includes a picture!!!
  2. anyone have any idea how I can print orders list by manufacture? and include the items image in the orderlist printed? thanks erick
  3. Ok i saw this posted here like 50 times.... and being that i spent a good hour or teo going through the posts here looking for an answer most of the answers i found were in pieces and didnt fix the problem Ok so everyone is asking how come the cost isnt being shown in the reports... very simple follow the below instructions... THEY HAVE BEEN CORRECTED as there was an error in them here is the edited and fixed instructions for the latest version of MARGIN REPORTS ################################################################################ ############################ ################################################################################ ############################ ### Margin Report v2.56 ### ### ### ### Official Support Thread http://forums.oscommerce.com/index.php?showtopic=99144 ### ### ### ### If you find this contribution useful and would like to make a donation ### ### so that I can continue to build contributions for the community such as this one and Family Products.### ### Thanks and I hope you find this contribution useful. ### ### ### ### -Chris (a.k.a. blueline) P.S. ### ### ### ### If you find this contribution useful I?fd like to hear about it. ### ### ### ### You can email me at osc@eclyptiq.com and let me know what you think. Thanks again. ### ### ### ### Margin Report v2.56 ### ### ### ### Installation Instructions ### ### ### ### Files included: ### ### ### ### /catalog/admin/margin_report.php ### ### /catalog/admin/margin_report2.php ### ### /catalog/admin/languages/english/margin_report.php ### ### /catalog/admin/languages/english/images/buttons/button_export.gif ### ### /catalog/admin/languages/turkish/margin_report.php ### ### /catalog/admin/languages/turkish/images/buttons/button_export.gif ### ### ### ### Margin Report v2.56.sql ### ### ### ### Files to Edit: ### ### ### ### /catalog/admin/categories.php ### ### /catalog/admin/includes/languages/english/categories.php ### ### /catalog/admin/includes/languages/english.php ### ### /catalog/admin/includes/boxes/reports.php ### ### /catalog/admin/includes/filenames.php ### ### /catalog/includes/classes/order.php ### ### /catalog/includes/classes/shopping_cart.php ### ### /catalog/checkout_process.php ### ### ### ################################################################################ ############################ ################################################################################ ############################ Installation Instructions /catalog/admin/categories.php Find: <tr bgcolor="#ebebff"> <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td> </tr> Replace With: <tr bgcolor="#ebebff"> <td class="main"><?php echo TEXT_PRODUCTS_PRICE_COST; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_input_field('products_cost', $pInfo->products_cost, ''); ?></td> </tr> <tr bgcolor="#ebebff"> <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '?' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td> </tr> Find: if (isset($HTTP_GET_VARS['search'])) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name"); } else { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name"); } Replace With: if (isset($HTTP_GET_VARS['search'])) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_cost, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name"); } else { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_cost, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name"); } Find: 'products_price' => '', Replace With: 'products_price' => '', 'products_cost' => '', Find: $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity); Replace With: $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_COST_INFO . ' ' . $currencies->format($pInfo->products_cost) . '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br><br>' . TEXT_PRODUCTS_PROFIT_INFO . ' ' . $currencies->format($pInfo->products_price-$pInfo->products_cost) . '<br><br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity); Find: 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']), Replace With: 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']), 'products_cost' => tep_db_prepare_input($HTTP_POST_VARS['products_cost']), Find: } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') { $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $product = tep_db_fetch_array($product_query); tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')"); $dup_products_id = tep_db_insert_id(); Replace With: } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') { $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_cost, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $product = tep_db_fetch_array($product_query); tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_cost, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', '" . tep_db_input($product['products_cost']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')"); $dup_products_id = tep_db_insert_id(); Find: if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) { $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_query); Replace With: if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) { $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_cost, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_query); /catalog/admin/includes/languages/english/categories.php Add: define('TEXT_PRODUCTS_COST_INFO', 'Cost: '); define('TEXT_PRODUCTS_PROFIT_INFO', 'Profit:'); define('TEXT_PRODUCTS_PRICE_COST', 'Products Price (Cost):'); Also add these lines to other languages you are using. /catalog/admin/includes/languages/english.php Find: define('BOX_REPORTS_ORDERS_TOTAL', 'Customer Orders-Total'); Replace With: define('BOX_REPORTS_MARGIN_REPORT', 'Margin Report'); define('BOX_REPORTS_ORDERS_TOTAL', 'Customer Orders-Total'); Also replace these lines to other languages you are using. /catalog/admin/includes/boxes/reports.php Find: '<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a>'); Replace With: '<a href="' . tep_href_link(FILENAME_MARGIN_REPORT, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_MARGIN_REPORT . '</a><br>' . '<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a>'); /catalog/admin/includes/filenames.php Add: define('FILENAME_MARGIN_REPORT', 'margin_report.php'); define('FILENAME_MARGIN_REPORT2', 'margin_report2.php'); /catalog/includes/classes/order.php Find: $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'"); while ($orders_products = tep_db_fetch_array($orders_products_query)) { $this->products[$index] = array('qty' => $orders_products['products_quantity'], 'id' => $orders_products['products_id'], 'name' => $orders_products['products_name'], 'model' => $orders_products['products_model'], 'tax' => $orders_products['products_tax'], 'price' => $orders_products['products_price'], 'final_price' => $orders_products['final_price']); Replace With: $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_cost, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'"); while ($orders_products = tep_db_fetch_array($orders_products_query)) { $this->products[$index] = array('qty' => $orders_products['products_quantity'], 'id' => $orders_products['products_id'], 'name' => $orders_products['products_name'], 'model' => $orders_products['products_model'], 'tax' => $orders_products['products_tax'], 'price' => $orders_products['products_price'], 'cost' => $orders_products['products_cost'], 'final_price' => $orders_products['final_price'], Find: $this->products[$index] = array('qty' => $products[$i]['quantity'], 'name' => $products[$i]['name'], 'model' => $products[$i]['model'], 'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']), 'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']), 'price' => $products[$i]['price'], 'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']), 'weight' => $products[$i]['weight'], 'id' => $products[$i]['id']); Replace With: $this->products[$index] = array('qty' => $products[$i]['quantity'], 'name' => $products[$i]['name'], 'model' => $products[$i]['model'], 'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']), 'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']), 'price' => $products[$i]['price'], 'cost' => $products[$i]['cost'], 'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']), 'weight' => $products[$i]['weight'], 'id' => $products[$i]['id']); /catalog/includes/classes/shopping_cart.php Find: // products price $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); if ($product = tep_db_fetch_array($product_query)) { $prid = $product['products_id']; $products_tax = tep_get_tax_rate($product['products_tax_class_id']); $products_price = $product['products_price']; $products_weight = $product['products_weight']; Replace With: // products price $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); if ($product = tep_db_fetch_array($product_query)) { $prid = $product['products_id']; $products_tax = tep_get_tax_rate($product['products_tax_class_id']); $products_price = $product['products_price']; $products_cost = $product['products_cost']; $products_weight = $product['products_weight']; Find: while (list($products_id, ) = each($this->contents)) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); Replace With: while (list($products_id, ) = each($this->contents)) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_cost, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); Find: $products_array[] = array('id' => $products_id, 'name' => $products['products_name'], 'model' => $products['products_model'], 'image' => $products['products_image'], 'price' => $products_price, 'quantity' => $this->contents[$products_id]['qty'], Replace With: $products_array[] = array('id' => $products_id, 'name' => $products['products_name'], 'model' => $products['products_model'], 'image' => $products['products_image'], 'price' => $products_price, 'cost' => $products['products_cost'], 'quantity' => $this->contents[$products_id]['qty'], /catalog/checkout_process.php Find: $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']); Replace With: $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'], 'products_cost' => $order->products[$i]['cost'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty']); Save and close all files mySQL Instructions: Run mySQL Command by copying the code below OR using the included .sql file: # Margin Report v2.56 SQL File ALTER TABLE `products` ADD `products_cost` DECIMAL( 15, 4 ) DEFAULT '0.0000' NOT NULL AFTER `products_price`; ALTER TABLE `orders_products` ADD `products_cost` DECIMAL( 15, 4 ) DEFAULT '0.0000' NOT NULL AFTER `products_price`; Done! if you do this correctly THIS will work! I even managed to include the Retail Price contribution with this..
  4. ok lol i should probably be more patient.... just change the class and create a new class in your stylesheet.css this contrib uses the smalltext which is standard in the OSC script... so you can control this seperately if you create a new style cool although optimally it would be the best to be able to do this from within the script... just a small config line that specifies the backround color :)
  5. Can someone help me figure this out... without changing any of my CSS how can i go about changing the backround of this contrib? code is as follows this contrib displays your main categories/images on the main page... the backround is formatted by the stylesheet.css, but i dont want to alter my whole shops backround i just want the table generated by this contrib to be white you can view my page at http://armynavydeals.ca to see what i mean.. thanks in advance <?php /* $Id: main_categories.php,v 1.0a 2002/08/01 10:37:00 Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com/ Copyright (c) 2002 Barreto Gustavo Barreto <gustavo@barreto.net> http://www.barreto.net/ Based on: all_categories.php Ver. 1.6 by Christian Lescuyer History: 1.0 Creation 1.0a Correction: Extra Carriage Returns 1.1 added parameters to change display options -- mdt Released under the GNU General Public License */ //------------------------------------------------------------------------------------------------------ // PARAMETERS //------------------------------------------------------------------------------------------------------ $item_column_number = 3; // range of 1 to 9 $item_title_on_newline = true; // true or false $valign = middle; // middle, top, or bottom (determines the vertical placement of the images) $hover = on; // turns hover effect on or off // The Following Parameters are for customizing the hover effect // leave the # in the color values or the border may not show $hovercolor = "#BBC3D3"; // color for category when the mouse hovers over it $hoverborder = "#CCCC99"; // color for category border when hovered (ignore if $borderwidth is set to 0) $regcolor = "#FFFFFF"; // color for category when not hovered $regborder = "#CCCC99"; // color for category border when not hovered (ignore if $borderwidth is set to 0) $borderwidth = 1; // width of border around categories (in pixels, 0 for none) // for item and subcategory options, suugest that you just put in CSS code // you can also just define a class and then change it in a template addon like BTS $item_div_options = 'style="text-align:center;font-weight:bold;font-size:larger;margin-top:5px;margin-bottom:5px;"'; $item_subcategories_options = ''; //------------------------------------------------------------------------------------------------------ // CODE - do not change below here //------------------------------------------------------------------------------------------------------ // error checking on parameters if($item_column_number < 1) { $item_column_number = 1; } if($item_column_number > 9) { $item_column_number = 9; } if($item_title_on_newline) { $item_separator = '<br>'; } else { $item_separator = ' '; } // Preorder tree traversal function preorder($cid, $level, $foo, $cpath) { global $categories_string, $HTTP_GET_VARS; // Display link if ($cid != 0) { for ($i=0; $i<$level; $i++) $categories_string .= ' '; $categories_string .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath =' . $cpath . $cid) . '">'; // 1.6 Are we on the "path" to selected category? $bold = strstr($HTTP_GET_VARS['cPath'], $cpath . $cid . '_') || $HTTP_GET_VARS['cPath'] == $cpath . $cid; // 1.6 If yes, use <b> if ($bold) $categories_string .= '<b>'; $categories_string .= $foo[$cid]['name']; if ($bold) $categories_string .= '</b>'; $categories_string .= '</a>'; // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false if (SHOW_COUNTS == 'false') { $products_in_category = tep_count_products_in_category($cid); if ($products_in_category > 0) { $categories_string .= ' (' . $products_in_category . ')'; } } $categories_string .= '<br>'; } // Traverse category tree if (is_array($foo)) { foreach ($foo as $key => $value) { if ($foo[$key]['parent'] == $cid) { preorder($key, $level+1, $foo, ($level != 0 ? $cpath . $cid . '_' : '')); } } } } ?> <!-- main_categories //--> <tr> <td> <?php ////////// // Display box heading ////////// $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CATEGORIES); new infoBoxHeading($info_box_contents, false, false); ////////// // Get categories list ////////// // 1.2 Test for presence of status field for compatibility with older versions $status = tep_db_num_rows(tep_db_query('describe categories status')); $query = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id"; // 1.3 Can't have 'where' in an if statement! if ($status >0) $query.= " and c.status = '1'"; $query.= " and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name"; $categories_query = tep_db_query($query); // Initiate tree traverse $categories_string = ''; preorder(0, 0, $foo, ''); ////////// // Display box contents ////////// $info_box_contents = array(); $row = 0; $col = 0; while ($categories = tep_db_fetch_array($categories_query)) { if ($categories['parent_id'] == 0) { $cPath_new = tep_get_path($categories['categories_id']); /*"OMITED SO IT DOESNT DISPLAY SUBCATEGORIES" $text_subcategories = ''; $subcategories_query = tep_db_query($query); while ($subcategories = tep_db_fetch_array($subcategories_query))*/ { if ($subcategories['parent_id'] == $categories['categories_id']) { $cPath_new_sub = "cPath=" . $categories['categories_id']/*"OMITED SO IT DOESNT DISPLAY SUBCATEGORIES" . "_" . $subcategories['categories_id']*/; $text_subcategories .= '? <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">'; $text_subcategories .= $subcategories['categories_name'] . '</a>' . " "; } // if ($subcategories['parent_id'] == $categories['categories_id']) } // while ($subcategories = tep_db_fetch_array($subcategories_query)) if ($hover == 'on') { $info_box_contents[$row][$col] = array('align' => 'left', 'params' => 'class="smallText" style="border:' . $borderwidth . 'px solid ' . $regborder . '" onMouseOver="window.status=\'' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '\'; this.style.backgroundColor=\'' . $hovercolor . '\'; this.style.cursor=\'hand\'; this.style.border=\'' . $borderwidth . 'px solid ' . $hoverborder . '\';" onMouseOut="window.status=\'\'; this.style.backgroundColor=\'' . $regcolor . '\'; this.style.border=\'' . $borderwidth . 'px solid ' . $regborder . '\';" onclick="location.href=\'' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '\'" width="'.intval(100/$item_column_number).'%" valign="' . $valign . '"', 'text' => '<div '. $item_div_options . '><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>' . $item_separator . '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '">' . $categories['categories_name'] . '</a><DIV ' . $item_subcategories_options . '>' . $text_subcategories . $spacing . '</DIV></DIV>'); } else { $info_box_contents[$row][$col] = array('align' => 'left', 'params' => 'class="smallText" width="'.intval(100/$item_column_number).'%" valign="' . $valign . '"', 'text' => '<div '. $item_div_options . '><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>' . $item_separator . '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '">' . $categories['categories_name'] . '</a><DIV ' . $item_subcategories_options . '>' . $text_subcategories . '</DIV></DIV>'); } // determine the column position to see if we need to go to a new row $col ++; if ($col > ($item_column_number - 1)) { $col = 0; $row ++; } //if ($col > ($number_of_columns - 1)) } //if ($categories['parent_id'] == 0) } // while ($categories = tep_db_fetch_array($categories_query)) //output the contents new contentBox($info_box_contents); ?> </td> </tr> <!-- main_categories_eof //-->
  6. I havent been able to try this because i lack the multi images contribution, I do however wonder if this would be possible, mainly because the images are stuck at one standard width and format at this point. It would be nice if they could be dynamically resized, especially considering most use On the fly thumbnails. I hope someone can chime in and help later
  7. Here we can talk about this cool contribution which I hope people can expand on. if your looking for the latest version it can be found here Image Zoom In And Zoom Out + No Right Click No Image Save This contribution will allow you to Zoom in and Out on images in you popup images.. It easily modifies your popup images in 2 simple steps modifying your popup_image.php file. Things id like to add: Control of the contrib from the admin end.. 360 degree zoom/multiple zoom images pan/magnify inclusion of product features/specs in zoom screen side by side zoom comparison of products ok so if anyone has problems post them here and Ill be happy to help all i can peace
  8. Hi maybe someone can help me with this very strange problem half the time my Urls are correctly formatted ie: http://mysite.com/catalog/product-is-cool.html The other half of the time Urls are formatted correctly except the Session ID will append itself to the end of the URL resulting in ie: http://mysite.com/catalog/product-is-cool....FDSFG234432GC03 i also noticed whenever I run a spider simulator on my site it always comes back with the SID attached... does anyone know why this is happening? I have tried resetting the cache..... Enabling and renabling the module to no avail.... Why would this happen? if anyone could help this would be greatly appreciated... being that the contrib is working I wouldnt normally care except I am told that the appended OsCid will cause problems with Search engine spiders... Thanks in advance Indi
  9. Problem with this contrib Line: 28 Char: 7 Error: Permission Denied Browser: IE6 Server LINUX Line 28, 29 and 30 var req; function loadXMLDoc(key) { var url="quickfind.php?osCsid=<?php echo tep_session_id();?>&keywords="+key; Basically i cant get any search results via ajax... nothing pops up when i type I have used the latest version Any ideas??? Thanks Indi
  10. FIX FOR THOSE WHO CANT SEEM TO GET THE DEDUCTIONS TO SHOW UP ON CHECKOUT CONFIRMATIONS WHEN CHECKING OUT OR AFTER INSTALLING PAY PAL IPN.... and then removing it... This may work for othery similar symptoms as well THIS is what finally after 8 hours worked for me For some reason no matter what I did in regards to display sort order changes , the module would not show up correctly or calculate the rewards and show them on the confirmation pages.. What fixed this... I followed the sort order directions in this thread which resulted in NO CHANGES what did however work is the reset of the module.... Go to configurations.... then points rewards module find the following option Enable Points system Enable Redemptions system Click on each and set to FALSE..... Update them both Go back to each Set Both to TRUE Update both Now check your checkout pages... if your sort order is somewhat correct and you reset the module it appears and calculates once again.... Interesting....... but this is what worked for me.... It only took me 8 damn hours, and countless lost order, to figure it out
  11. Ok I had this module working flawlessly until today when i tried to set up a Pay Pal IPN module which now i have decided not to use... In the process I chenged some of the sort orders of the order total modules... I have attempted to change them back with no avail... It seems points and rewards is not being calculated against the total of order any longer... and the total amount redeemed is not being shown on the checkout confirmation pages I have read through this thread and have come to the conclusion that the sort order must be correct for the module to function so i have tried tinkering around with mine to get this back to its working state with no success Here is my sort order Points Redeemptions 4 Shipping 3 Sub-Total 1 Tax 2 Total 5 I have checked all my modified files that did work and point rewards queries and functions all appear fine... What am i doing wrong??? Please help this is a LIVE shop having problems.. Thanks INDI
  12. Ok ... I have spent hours reading this thread.. and STILL have found no answer to a problem asked many times... If im missing the answer please forgive me and point me in the right direction... a link to the answer would help.. anyways I have this contrib wroking semi correctly, it seems to work well with my Points and rewards module which im happy about... but when i do a test transaction on the sandbox servers... on confirm order i get the following message We are sorry, we are experiencing temporary difficulties. Please try again later. If this error occurred while making a payment, avoid duplicate payments by checking your Account Overview before resending a payment. Message 3005 I have tried re doing order... starting new orders, etc... nothing seems to fix this and I simply cant trust that it will work in live mode without testing in test mode... Does anyone have a solution to this??? Thanks Indi
  13. I would like to thank the person whom recommended this contribution over the "other" header tag contribution I was fighting with..... LOL This was so much easier and deffinietly works alot better... the install time was amazingly fast... much kudos on this contribution.... just one quick question.... is there anything that can be added that would allow me to set title information on an individual basis??? The products work fine... but on other pages i would like the title to be a bit more customizable.... anyway of acheiving this? if not its cool I love the contrib anyways... oh and i gotta say one thing.... ITS FAST!!!!!!!!!! thanks alot indi
  14. i used winmerge to compare both header files and checked the differences.. i then uploaded the new header_tag file .... i also re installed the contribution from scratch... before i did all this i reverted to a backed up version of my site with no errors.... once the contrib was re installed I re encounter the same MYSQL fetch error on line 99 something with the contrib is obviously interfering with the shop..... i guess i have to remove it and revert to my backup of my site until this issue is fixed. i hope we can work this out thanks erick
  15. i didnt have this problem until this contribution was installed... any idea why it might be happening??? what can i do to fix it? thanks erick