Jump to content
Latest News: (loading..)

driven22

Members
  • Content count

    18
  • Joined

  • Last visited

Profile Information

  • Real Name
    Grzesiek

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. driven22

    Count products in bm_categories (BS)

    Thank you
  2. driven22

    Count products in bm_categories (BS)

    yes- i have it in general.php but in bm_categories.php no call to function count that's why counting products does not work in category box. It's should be ex.: Battery (10) Pencils (12) Pens (4) Now it's only: Battery Pencils Pens
  3. Hi, where is "Show Category Counts " in Oscommerce CE ? I would like to show in category box number of products like in previous version oscmmerce 2.3.4. In general.php i have: // Return the number of products in a category // TABLES: products, products_to_categories, categories function tep_count_products_in_category($category_id, $include_inactive = false) { $products_count = 0; if ($include_inactive == true) { $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$category_id . "'"); } else { $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int)$category_id . "'"); } $products = tep_db_fetch_array($products_query); $products_count += $products['total']; $child_categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$category_id . "'"); if (tep_db_num_rows($child_categories_query)) { while ($child_categories = tep_db_fetch_array($child_categories_query)) { $products_count += tep_count_products_in_category($child_categories['categories_id'], $include_inactive); } } return $products_count; } //// // Return true if the category has subcategories // TABLES: categories function tep_has_category_subcategories($category_id) { $child_category_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$category_id . "'"); $child_category = tep_db_fetch_array($child_category_query); if ($child_category['count'] > 0) { return true; } else { return false; } } ..but in bm_categories only this without function "count" ?: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ class bm_categories { var $code = 'bm_categories'; var $group = 'boxes'; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->title = MODULE_BOXES_CATEGORIES_TITLE; $this->description = MODULE_BOXES_CATEGORIES_DESCRIPTION; if ( defined('MODULE_BOXES_CATEGORIES_STATUS') ) { $this->sort_order = MODULE_BOXES_CATEGORIES_SORT_ORDER; $this->enabled = (MODULE_BOXES_CATEGORIES_STATUS == 'True'); $this->group = ((MODULE_BOXES_CATEGORIES_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); } } function execute() { global $oscTemplate, $cPath; $OSCOM_CategoryTree = new category_tree (); $OSCOM_CategoryTree->setCategoryPath($cPath, '<strong>', '</strong>'); $OSCOM_CategoryTree->setSpacerString('&nbsp;&nbsp;', 1); $OSCOM_CategoryTree->setParentGroupString('<ul class="nav nav-pills nav-stacked">', '</ul>', true); $category_tree = $OSCOM_CategoryTree->getTree(); ob_start(); include('includes/modules/boxes/templates/categories.php'); $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_BOXES_CATEGORIES_STATUS'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Categories Module', 'MODULE_BOXES_CATEGORIES_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_CATEGORIES_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_CATEGORIES_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_BOXES_CATEGORIES_STATUS', 'MODULE_BOXES_CATEGORIES_CONTENT_PLACEMENT', 'MODULE_BOXES_CATEGORIES_SORT_ORDER'); } } help me pls with missing function.
  4. driven22

    Change ...| store name to ..-store name

    Perfect MrPhil Thank You
  5. driven22

    Change ...| store name to ..-store name

    I would like to change in webpage title mark | to mark - . Now when i enter to subpages always display after page tite ... | kuzdrowiu24-shop. I would like to change this to ... - kuzdrowiu24-shop. Example: now is: "Herbals | kuzdrowiu24-shop". I would like to change this: "Herbals - kuzdrowiu24-shop".
  6. Hi, I can't find how to change sign | before store name to -before store name. I have 2.3.4 CE BS, Please help me
  7. driven22

    Disappear "edit" in banner manager /admin side

    It's work !. Thank you :)
  8. driven22

    Disappear "edit" in banner manager /admin side

    I can add a banner in admin and display on every page, but i can't edit this banner, delete this banner (i can only edit or delete by phpmyadmin). Right column is missing.
  9. driven22

    Disappear "edit" in banner manager /admin side

    Yes - if I go to tools- banner manager the right colum is missing in my new shop 2.3.4.1 BS (first screenshot). The second screeshot shows how it should be (my old shop 2.3.4). How to fix it ?
  10. I have a problem with banner manager (admin side) in osc 2.3.4.1 BS. Disapear edit, delete, etc (osc.png) In normal version 2.3.4 is everything is ok (osc2.png). My banner_manager.php is standard- no mods. How to fix it ? Where is the problem ? <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2018 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $action = (isset($_GET['action']) ? $_GET['action'] : ''); $banner_extension = tep_banner_image_extension(); if (tep_not_null($action)) { switch ($action) { case 'setflag': if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) { tep_set_banner_status($_GET['bID'], $_GET['flag']); $messageStack->add_session(SUCCESS_BANNER_STATUS_UPDATED, 'success'); } else { $messageStack->add_session(ERROR_UNKNOWN_STATUS_FLAG, 'error'); } tep_redirect(tep_href_link('banner_manager.php', 'page=' . $_GET['page'] . '&bID=' . $_GET['bID'])); break; case 'insert': case 'update': if (isset($_POST['banners_id'])) $banners_id = tep_db_prepare_input($_POST['banners_id']); $banners_title = tep_db_prepare_input($_POST['banners_title']); $banners_url = tep_db_prepare_input($_POST['banners_url']); $new_banners_group = tep_db_prepare_input($_POST['new_banners_group']); $banners_group = (empty($new_banners_group)) ? tep_db_prepare_input($_POST['banners_group']) : $new_banners_group; $banners_html_text = tep_db_prepare_input($_POST['banners_html_text']); $banners_image_local = tep_db_prepare_input($_POST['banners_image_local']); $banners_image_target = tep_db_prepare_input($_POST['banners_image_target']); $db_image_location = ''; $expires_date = tep_db_prepare_input($_POST['expires_date']); $expires_impressions = tep_db_prepare_input($_POST['expires_impressions']); $date_scheduled = tep_db_prepare_input($_POST['date_scheduled']); $banner_error = false; if (empty($banners_title)) { $messageStack->add(ERROR_BANNER_TITLE_REQUIRED, 'error'); $banner_error = true; } if (empty($banners_group)) { $messageStack->add(ERROR_BANNER_GROUP_REQUIRED, 'error'); $banner_error = true; } if (empty($banners_html_text)) { if (empty($banners_image_local)) { $banners_image = new upload('banners_image'); $banners_image->set_destination(DIR_FS_CATALOG_IMAGES . $banners_image_target); if ( ($banners_image->parse() == false) || ($banners_image->save() == false) ) { $banner_error = true; } } } if ($banner_error == false) { $db_image_location = (tep_not_null($banners_image_local)) ? $banners_image_local : $banners_image_target . $banners_image->filename; $sql_data_array = array('banners_title' => $banners_title, 'banners_url' => $banners_url, 'banners_image' => $db_image_location, 'banners_group' => $banners_group, 'banners_html_text' => $banners_html_text, 'expires_date' => 'null', 'expires_impressions' => 0, 'date_scheduled' => 'null'); if ($action == 'insert') { $insert_sql_data = array('date_added' => 'now()', 'status' => '1'); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_BANNERS, $sql_data_array); $banners_id = tep_db_insert_id(); $messageStack->add_session(SUCCESS_BANNER_INSERTED, 'success'); } elseif ($action == 'update') { tep_db_perform(TABLE_BANNERS, $sql_data_array, 'update', "banners_id = '" . (int)$banners_id . "'"); $messageStack->add_session(SUCCESS_BANNER_UPDATED, 'success'); } if (tep_not_null($expires_date)) { $expires_date = substr($expires_date, 0, 4) . substr($expires_date, 5, 2) . substr($expires_date, 8, 2); tep_db_query("update " . TABLE_BANNERS . " set expires_date = '" . tep_db_input($expires_date) . "', expires_impressions = null where banners_id = '" . (int)$banners_id . "'"); } elseif (tep_not_null($expires_impressions)) { tep_db_query("update " . TABLE_BANNERS . " set expires_impressions = '" . tep_db_input($expires_impressions) . "', expires_date = null where banners_id = '" . (int)$banners_id . "'"); } if (tep_not_null($date_scheduled)) { $date_scheduled = substr($date_scheduled, 0, 4) . substr($date_scheduled, 5, 2) . substr($date_scheduled, 8, 2); tep_db_query("update " . TABLE_BANNERS . " set status = '0', date_scheduled = '" . tep_db_input($date_scheduled) . "' where banners_id = '" . (int)$banners_id . "'"); } tep_redirect(tep_href_link('banner_manager.php', (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'bID=' . $banners_id)); } else { $action = 'new'; } break; case 'deleteconfirm': $banners_id = tep_db_prepare_input($_GET['bID']); if (isset($_POST['delete_image']) && ($_POST['delete_image'] == 'on')) { $banner_query = tep_db_query("select banners_image from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'"); $banner = tep_db_fetch_array($banner_query); if (is_file(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) { if (tep_is_writable(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) { unlink(DIR_FS_CATALOG_IMAGES . $banner['banners_image']); } else { $messageStack->add_session(ERROR_IMAGE_IS_NOT_WRITEABLE, 'error'); } } else { $messageStack->add_session(ERROR_IMAGE_DOES_NOT_EXIST, 'error'); } } tep_db_query("delete from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'"); tep_db_query("delete from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banners_id . "'"); if (function_exists('imagecreate') && tep_not_null($banner_extension)) { if (is_file('images/graphs/banner_infobox-' . $banners_id . '.' . $banner_extension)) { if (tep_is_writable('images/graphs/banner_infobox-' . $banners_id . '.' . $banner_extension)) { unlink('images/graphs/banner_infobox-' . $banners_id . '.' . $banner_extension); } } if (is_file('images/graphs/banner_yearly-' . $banners_id . '.' . $banner_extension)) { if (tep_is_writable('images/graphs/banner_yearly-' . $banners_id . '.' . $banner_extension)) { unlink('images/graphs/banner_yearly-' . $banners_id . '.' . $banner_extension); } } if (is_file('images/graphs/banner_monthly-' . $banners_id . '.' . $banner_extension)) { if (tep_is_writable('images/graphs/banner_monthly-' . $banners_id . '.' . $banner_extension)) { unlink('images/graphs/banner_monthly-' . $banners_id . '.' . $banner_extension); } } if (is_file('images/graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) { if (tep_is_writable('images/graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) { unlink('images/graphs/banner_daily-' . $banners_id . '.' . $banner_extension); } } } $messageStack->add_session(SUCCESS_BANNER_REMOVED, 'success'); tep_redirect(tep_href_link('banner_manager.php', 'page=' . $_GET['page'])); break; } } // check if the graphs directory exists $dir_ok = false; if (function_exists('imagecreate') && tep_not_null($banner_extension)) { if (is_dir('images/graphs')) { if (tep_is_writable('images/graphs')) { $dir_ok = true; } else { $messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error'); } } else { $messageStack->add(ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error'); } } require('includes/template_top.php'); ?> <script type="text/javascript"><!-- function popupImageWindow(url) { window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150') } //--></script> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <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_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <?php if ($action == 'new') { $form_action = 'insert'; $parameters = array('expires_date' => '', 'date_scheduled' => '', 'banners_title' => '', 'banners_url' => '', 'banners_group' => '', 'banners_image' => '', 'banners_html_text' => '', 'expires_impressions' => ''); $bInfo = new objectInfo($parameters); if (isset($_GET['bID'])) { $form_action = 'update'; $bID = tep_db_prepare_input($_GET['bID']); $banner_query = tep_db_query("select banners_title, banners_url, banners_image, banners_group, banners_html_text, status, date_format(date_scheduled, '%Y/%m/%d') as date_scheduled, date_format(expires_date, '%Y/%m/%d') as expires_date, expires_impressions, date_status_change from " . TABLE_BANNERS . " where banners_id = '" . (int)$bID . "'"); $banner = tep_db_fetch_array($banner_query); $bInfo->objectInfo($banner); } elseif (tep_not_null($_POST)) { $bInfo->objectInfo($_POST); } $groups_array = array(); $groups_query = tep_db_query("select distinct banners_group from " . TABLE_BANNERS . " order by banners_group"); while ($groups = tep_db_fetch_array($groups_query)) { $groups_array[] = array('id' => $groups['banners_group'], 'text' => $groups['banners_group']); } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr><?php echo tep_draw_form('new_banner', 'banner_manager.php', (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'action=' . $form_action, 'post', 'enctype="multipart/form-data"'); if ($form_action == 'update') echo tep_draw_hidden_field('banners_id', $bID); ?> <td><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main"><?php echo TEXT_BANNERS_TITLE; ?></td> <td class="main"><?php echo tep_draw_input_field('banners_title', $bInfo->banners_title, '', true); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_BANNERS_URL; ?></td> <td class="main"><?php echo tep_draw_input_field('banners_url', $bInfo->banners_url); ?></td> </tr> <tr> <td class="main" valign="top"><?php echo TEXT_BANNERS_GROUP; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('banners_group', $groups_array, $bInfo->banners_group) . TEXT_BANNERS_NEW_GROUP . '<br />' . tep_draw_input_field('new_banners_group', '', '', ((sizeof($groups_array) > 0) ? false : true)); ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main" valign="top"><?php echo TEXT_BANNERS_IMAGE; ?></td> <td class="main"><?php echo tep_draw_file_field('banners_image') . ' ' . TEXT_BANNERS_IMAGE_LOCAL . '<br />' . DIR_FS_CATALOG_IMAGES . tep_draw_input_field('banners_image_local', (isset($bInfo->banners_image) ? $bInfo->banners_image : '')); ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_BANNERS_IMAGE_TARGET; ?></td> <td class="main"><?php echo DIR_FS_CATALOG_IMAGES . tep_draw_input_field('banners_image_target'); ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td valign="top" class="main"><?php echo TEXT_BANNERS_HTML_TEXT; ?></td> <td class="main"><?php echo tep_draw_textarea_field('banners_html_text', 'soft', '60', '5', $bInfo->banners_html_text); ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_BANNERS_SCHEDULED_AT; ?></td> <td class="main"><?php echo tep_draw_input_field('date_scheduled', $bInfo->date_scheduled, 'id="date_scheduled"') . ' <small>(YYYY-MM-DD)</small>'; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td valign="top" class="main"><?php echo TEXT_BANNERS_EXPIRES_ON; ?></td> <td class="main"><?php echo tep_draw_input_field('expires_date', $bInfo->expires_date, 'id="expires_date"') . ' <small>(YYYY-MM-DD)</small>' . TEXT_BANNERS_OR_AT . '<br />' . tep_draw_input_field('expires_impressions', $bInfo->expires_impressions, 'maxlength="7" size="7"') . ' ' . TEXT_BANNERS_IMPRESSIONS; ?></td> </tr> </table> <script type="text/javascript"> $('#date_scheduled').datepicker({ dateFormat: 'yy-mm-dd' }); $('#expires_date').datepicker({ dateFormat: 'yy-mm-dd' }); </script> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><?php echo TEXT_BANNERS_BANNER_NOTE . '<br />' . TEXT_BANNERS_INSERT_NOTE . '<br />' . TEXT_BANNERS_EXPIRCY_NOTE . '<br />' . TEXT_BANNERS_SCHEDULE_NOTE; ?></td> <td class="smallText" align="right" valign="top" nowrap><?php echo tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link('banner_manager.php', (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['bID']) ? 'bID=' . $_GET['bID'] : ''))); ?></td> </tr> </table></td> </form></tr> <?php } else { ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_BANNERS; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_GROUPS; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATISTICS; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td> </tr> <?php $banners_query_raw = "select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added from " . TABLE_BANNERS . " order by banners_title, banners_group"; $banners_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $banners_query_raw, $banners_query_numrows); $banners_query = tep_db_query($banners_query_raw); while ($banners = tep_db_fetch_array($banners_query)) { $info_query = tep_db_query("select sum(banners_shown) as banners_shown, sum(banners_clicked) as banners_clicked from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banners['banners_id'] . "'"); $info = tep_db_fetch_array($info_query); if ((!isset($_GET['bID']) || (isset($_GET['bID']) && ($_GET['bID'] == $banners['banners_id']))) && !isset($bInfo) && (substr($action, 0, 3) != 'new')) { $bInfo_array = array_merge($banners, $info); $bInfo = new objectInfo($bInfo_array); } $banners_shown = ($info['banners_shown'] != '') ? $info['banners_shown'] : '0'; $banners_clicked = ($info['banners_clicked'] != '') ? $info['banners_clicked'] : '0'; if (isset($bInfo) && is_object($bInfo) && ($banners['banners_id'] == $bInfo->banners_id)) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('banner_statistics.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id) . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('banner_manager.php', 'page=' . $_GET['page'] . '&bID=' . $banners['banners_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo '<a href="javascript:popupImageWindow(\'popup_image.php?banner=' . $banners['banners_id'] . '\')">' . tep_image('images/icon_popup.gif', 'View Banner') . '</a>&nbsp;' . $banners['banners_title']; ?></td> <td class="dataTableContent" align="right"><?php echo $banners['banners_group']; ?></td> <td class="dataTableContent" align="right"><?php echo $banners_shown . ' / ' . $banners_clicked; ?></td> <td class="dataTableContent" align="right"> <?php if ($banners['status'] == '1') { echo tep_image('images/icon_status_green.gif', 'Active', 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link('banner_manager.php', 'page=' . $_GET['page'] . '&bID=' . $banners['banners_id'] . '&action=setflag&flag=0') . '">' . tep_image('images/icon_status_red_light.gif', 'Set Inactive', 10, 10) . '</a>'; } else { echo '<a href="' . tep_href_link('banner_manager.php', 'page=' . $_GET['page'] . '&bID=' . $banners['banners_id'] . '&action=setflag&flag=1') . '">' . tep_image('images/icon_status_green_light.gif', 'Set Active', 10, 10) . '</a>&nbsp;&nbsp;' . tep_image('images/icon_status_red.gif', 'Inactive', 10, 10); } ?></td> <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link('banner_statistics.php', 'page=' . $_GET['page'] . '&bID=' . $banners['banners_id']) . '">' . tep_image('images/icons/statistics.gif', ICON_STATISTICS) . '</a>&nbsp;'; if (isset($bInfo) && is_object($bInfo) && ($banners['banners_id'] == $bInfo->banners_id)) { echo tep_image('images/icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link('banner_manager.php', 'page=' . $_GET['page'] . '&bID=' . $banners['banners_id']) . '">' . tep_image('images/icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td> </tr> <?php } ?> <tr> <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"><?php echo $banners_split->display_count($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_BANNERS); ?></td> <td class="smallText" align="right"><?php echo $banners_split->display_links($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td> </tr> <tr> <td class="smallText" align="right" colspan="2"><?php echo tep_draw_button(IMAGE_NEW_BANNER, 'plus', tep_href_link('banner_manager.php', 'action=new')); ?></td> </tr> </table></td> </tr> </table></td> <?php $heading = array(); $contents = array(); switch ($action) { case 'delete': $heading[] = array('text' => '<strong>' . $bInfo->banners_title . '</strong>'); $contents = array('form' => tep_draw_form('banners', 'banner_manager.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '<br /><strong>' . $bInfo->banners_title . '</strong>'); if ($bInfo->banners_image) $contents[] = array('text' => '<br />' . tep_draw_checkbox_field('delete_image', 'on', true) . ' ' . TEXT_INFO_DELETE_IMAGE); $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link('banner_manager.php', 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']))); break; default: if (is_object($bInfo)) { $heading[] = array('text' => '<strong>' . $bInfo->banners_title . '</strong>'); $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link('banner_manager.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=new')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link('banner_manager.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=delete')) . tep_draw_button(IMAGE_DETAILS, 'info', tep_href_link('banner_statistics.php', 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id))); $contents[] = array('text' => '<br />' . TEXT_BANNERS_DATE_ADDED . ' ' . tep_date_short($bInfo->date_added)); if ( (function_exists('imagecreate')) && ($dir_ok) && ($banner_extension) ) { $banner_id = $bInfo->banners_id; $days = '3'; include('includes/graphs/banner_infobox.php'); $contents[] = array('align' => 'center', 'text' => '<br />' . tep_image('images/graphs/banner_infobox-' . $banner_id . '.' . $banner_extension)); } else { include('includes/functions/html_graphs.php'); $contents[] = array('align' => 'center', 'text' => '<br />' . tep_banner_graph_infoBox($bInfo->banners_id, '3')); } $contents[] = array('text' => tep_image('images/graph_hbar_blue.gif', 'Blue', '5', '5') . ' ' . TEXT_BANNERS_BANNER_VIEWS . '<br />' . tep_image('images/graph_hbar_red.gif', 'Red', '5', '5') . ' ' . TEXT_BANNERS_BANNER_CLICKS); if ($bInfo->date_scheduled) $contents[] = array('text' => '<br />' . sprintf(TEXT_BANNERS_SCHEDULED_AT_DATE, tep_date_short($bInfo->date_scheduled))); if ($bInfo->expires_date) { $contents[] = array('text' => '<br />' . sprintf(TEXT_BANNERS_EXPIRES_AT_DATE, tep_date_short($bInfo->expires_date))); } elseif ($bInfo->expires_impressions) { $contents[] = array('text' => '<br />' . sprintf(TEXT_BANNERS_EXPIRES_AT_IMPRESSIONS, $bInfo->expires_impressions)); } if ($bInfo->date_status_change) $contents[] = array('text' => '<br />' . sprintf(TEXT_BANNERS_STATUS_CHANGE, tep_date_short($bInfo->date_status_change))); } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' <td width="25%" valign="top">' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr> </table></td> </tr> <?php } ?> </table> <?php require('includes/template_bottom.php'); require('includes/application_bottom.php'); ?> Best Regards
  11. Solved: checkout_process.php this line: $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"; change to this: $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
  12. Hi, I can't find how to remove brackets in email confirmation order when there is no "model name" after product name ex: ------------------------------------------------------------------------------------------------- 1 x Gynostemma 250ml () = 38,00$ ------------------------------------------------------------------------------------------------- I have OSC 2.3.4.1 Please help me i looking for this whole day :(
  13. driven22

    Export orders into csv

    1. add a field in table "orders" via phpMyAdmin called "weight" immediately after "payment_method", the field is DECIMAL (5,2) NOT NULL, 2. in catalog/checkout_process.php after: $shipping_modules = new shipping($shipping); add $total_weight = $cart->show_weight(); same file - after: 'payment_method' => $order->info['payment_method'], add 'weight' => $total_weight, in catalog/admin/includes/classes/order.php in line 38 add 'weight' $order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, weight, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); same file line 56 add after: 'payment_method' => $order['payment_method'], this: 'weight' => $order['weight'], Aftert this "solution" i have in sql table weight and i can export to csv orders with weight. In exportordes.php in line 199-217 added word weight: // Patch dlan // if both fields are empty we select all orders if ($start=="" && $end=="") { $orders = tep_db_query("SELECT orders_id, date_purchased, customers_name, customers_id, cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires, weight FROM orders ORDER BY orders_id"); // if $start is empty we select all orders up to $end } else if($start=="" && $end!="") { $orders = tep_db_query("SELECT orders_id, date_purchased, customers_name, customers_id, cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires, weight FROM orders WHERE orders_id <= $end ORDER BY orders_id"); // if $end is empty we select all orders from $start } else if($start!="" && $end=="") { $orders = tep_db_query("SELECT orders_id, date_purchased, customers_name, customers_id, cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires, weight FROM orders WHERE orders_id >= $start ORDER BY orders_id"); // if both fields are filed in we select orders betwenn $start and $end } else { $orders = tep_db_query("SELECT orders_id, date_purchased, customers_name, customers_id, cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires, weight FROM orders WHERE orders_id >= $start AND orders_id <= $end ORDER BY orders_id"); } //patch in line 261: $weight = $row_orders ['weight']; in line 428: $csv_output .= $weight . "^" ; It's work for me.
  14. driven22

    Export orders into csv

    ok- problem solved.
  15. driven22

    Export orders into csv

    Hi, I need to export CSV file with total weight order but i don't know how do that. Osc 2.3.4 - my exportorders.php is: <?php /* $Id: exportorders.php,v 1.1 April 21, 2006 Harris Ahmed $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2004 Oscommerce Use this module on your own risk. I will be updating a new one soon. This template is used to create the csv export for Ideal Computer Systems Accounting Software */ define('FILENAME_EXPORTORDERS_DPD', 'exportorders_dpd.php'); require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_EXPORTORDERS); // Check if the form is submitted if (!$_GET['submitted']) { require(DIR_WS_INCLUDES . 'template_top.php'); ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo "Export pliku do CSV" ?></td> <td class="pageHeading" align="left"></td> </tr> </table> </td> </tr> <!-- first ends // --> <tr> <td><table border="0" style="font-family:tahoma;font-size:11px;" width="100%" cellspacing="2" cellpadding="2"> <tr> <td> <form method="GET" action="<?php echo $PHP_SELF; ?>"> <table border="0" style="font-family:tahoma;font-size:11px;" cellpadding="3"> <tr> <td><?php echo "Od numeru zamówienia:"; ?></td> <td><input name="start" size="5" value="<?php echo $start; ?>"> </tr> <tr> <td><?php echo "Do numeru zamówienia:" ; ?></td> <td><input name="end" size="5" value="<?php echo $end; ?>"> </tr> <tr> <td><?php echo "Status Zamówienia"; ?></td> <?php $orders_statuses = array(); $orders_status_array = array(); $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_statuses[] = array('id' => $orders_status['orders_status_id'], 'text' => $orders_status['orders_status_name']); $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name']; } ?> <td><?php echo tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => 'Wszystkie zamówienia')), $orders_statuses), $status); ?> </tr> <tr> <td><?php echo "Sposób Wyświetlania:"; ?></td> <td> <select name="submitted"> <option value="1">Utwórz plik CSV</option> <option value="2">Pokaż plik na ekranie</option> </select> </td></tr> <tr> <td>&nbsp;</td> <td><input type="submit" value="<?php echo "Export pliku DPD CSV"; ?>"></td> </tr> </table></form> </td></tr></table> </td></tr></table> </td></tr> </table></td> </tr> </table></td> </tr> </table <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> <?php } // submitted so generate csv if the form is submitted else { generatecsv($_GET['start'], $_GET['end']); } // generates csv file from $start order to $end order, inclusive function generatecsv($start, $end) { //Placing columns names in first row $delim = '^' ; //$csv_output .= "Orders_id".$delim; //$csv_output .= "Date".$delim; //$csv_output .= "Time".$delim; //$csv_output .= "First_Name".$delim; //$csv_output .= "Last_Name".$delim; //$csv_output .= "Name_On_Card".$delim; //$csv_output .= "Company".$delim; //$csv_output .= "email".$delim; //$csv_output .= "Billing_Address_1".$delim; //$csv_output .= "Billing_Address_2".$delim; //$csv_output .= "Billing_City".$delim; //$csv_output .= "Billing_State".$delim; //$csv_output .= "Billing_Zip".$delim; //$csv_output .= "Billing_Country".$delim; //$csv_output .= "Billing_Phone".$delim; $csv_output .= "Imie Nazwisko".$delim; //$csv_output .= "Nazwisko".$delim; //$csv_output .= "ShipTo_Name".$delim; $csv_output .= "Nazwa Firmy".$delim; $csv_output .= "Address_1".$delim; //$csv_output .= "Address_2".$delim; $csv_output .= "kod pocztowy".$delim; $csv_output .= "Miejscowosc".$delim; //$csv_output .= "ShipTo_State".$delim; //$csv_output .= "ShipTo_Country".$delim; $csv_output .= "telefon".$delim; //$csv_output .= "Card_Type".$delim; //$csv_output .= "Card_Number".$delim; //$csv_output .= "Exp_Date".$delim; //$csv_output .= "Bank_Name".$delim; //$csv_output .= "Gateway".$delim; //$csv_output .= "AVS_Code".$delim; //$csv_output .= "Transaction_ID".$delim; ///$csv_output .= "Order_Special_Notes".$delim; //$csv_output .= "Comments".$delim; //$csv_output .= "Order_Subtotal".$delim; //$csv_output .= "Order_Tax".$delim; //$csv_output .= "Order_Insurance".$delim; //$csv_output .= "Tax_Exempt_Message".$delim; //$csv_output .= "Order_Shipping_Total".$delim; //$csv_output .= "Small_Order_Fee".$delim; //$csv_output .= "Discount_Rate".$delim; //$csv_output .= "Discount_Message".$delim; $csv_output .= "email".$delim; //$csv_output .= "Order_Grand_Total".$delim; //$csv_output .= "Number_of_Items".$delim; //$csv_output .= "Sposob wysylki".$delim; $csv_output .= "Numer Zamowienia".$delim; $csv_output .= "Waga wysylki".$delim; $csv_output .= "Waga wysylki2".$delim; //$csv_output .= "Coupon_Code".$delim; //$csv_output .= "Order_security_msg.".$delim; //$csv_output .= "Order_Surcharge_Amount".$delim; //$csv_output .= "Order_Surcharge_Something".$delim; //$csv_output .= "Affiliate_code".$delim; //$csv_output .= "Sentiment_message".$delim; //$csv_output .= "Checkout_form_type".$delim; //$csv_output .= "Card_CVV_value".$delim; //$csv_output .= "future1".$delim; //$csv_output .= "future2".$delim; //$csv_output .= "future3".$delim; //$csv_output .= "future4".$delim; //$csv_output .= "future5".$delim; //$csv_output .= "future6".$delim; //$csv_output .= "future7".$delim; //$csv_output .= "future8".$delim; //$csv_output .= "future9".$delim; //$csv_output .= "Remarks".$delim; //$csv_output .= "ProductId".$delim; //$csv_output .= "Product_Price".$delim; //$csv_output .= "Number".$delim; //$csv_output .= "Product".$delim; //$csv_output .= "Attribute".$delim; //$csv_output .= "Attribute_Value".$delim; $csv_output .= "\n"; //End Placing columns in first row // Patch dlan // if both fields are empty we select all orders if ($start=="" && $end=="") { $orders = tep_db_query("SELECT orders_id, date_purchased, customers_name, customers_id, cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires FROM orders ORDER BY orders_id"); // if $start is empty we select all orders up to $end } else if($start=="" && $end!="") { $orders = tep_db_query("SELECT orders_id, date_purchased, customers_name, customers_id, cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires FROM orders WHERE orders_id <= $end ORDER BY orders_id"); // if $end is empty we select all orders from $start } else if($start!="" && $end=="") { $orders = tep_db_query("SELECT orders_id, date_purchased, customers_name, customers_id, cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires FROM orders WHERE orders_id >= $start ORDER BY orders_id"); // if both fields are filed in we select orders betwenn $start and $end } else { $orders = tep_db_query("SELECT orders_id, date_purchased, customers_name, customers_id, cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires FROM orders WHERE orders_id >= $start AND orders_id <= $end ORDER BY orders_id"); } //patch //$csv_output ="\n"; while ($row_orders = mysqli_fetch_array($orders)) { //start one loop $csv_output_ordersbefore = $csv_output; $Orders_id = $row_orders["orders_id"]; $customers_id = $row_orders["customers_id"]; $Date1 = $row_orders["date_purchased"]; //list($Date, $Time) = explode (' ',$Date1); $Date = date('mdY', strtotime($Date1)); $Time= date('H:i:s', strtotime($Date1)); $Name_On_Card1 = $row_orders["customers_name"]; $Name_On_Card = filter_text($Name_On_Card1);// order changed list($First_Name,$Last_Name) = explode(' ',$Name_On_Card1); // order changed $Company = filter_text($row_orders["customers_company"]); $email = filter_text($row_orders["customers_email_address"]); $Billing_Address_1 = filter_text($row_orders["billing_street_address"]); $Billing_Address_2 = ""; $Billing_City = filter_text($row_orders["billing_city"]); $Billing_State = filter_text($row_orders["billing_state"]); $Billing_Zip = filter_text($row_orders["billing_postcode"]); $Billing_Country = str_replace("(48 Contiguous Sta", "", $row_orders["billing_country"]); $Billing_Phone = filter_text($row_orders["customers_telephone"]); $ShipTo_Name1 = $row_orders["delivery_name"]; $ShipTo_Name = filter_text($ShipTo_Name1); // order changed list($ShipTo_First_Name,$ShipTo_Last_Name) = explode(' ',$ShipTo_Name1); // order changed $ShipTo_Company = filter_text($row_orders["delivery_company"]); $ShipTo_Address_1 = filter_text($row_orders["delivery_street_address"]); $ShipTo_Address_2 = ""; $ShipTo_City = filter_text($row_orders["delivery_city"]); $ShipTo_State = filter_text($row_orders["delivery_state"]); $ShipTo_Zip = filter_text($row_orders["delivery_postcode"]); $ShipTo_Country = str_replace("(48 Contiguous Sta", "", $row_orders["delivery_country"]); $ShipTo_Phone = ""; $Card_Type = $row_orders["cc_type"]; $Card_Number = $row_orders["cc_number"]; $Exp_Date = $row_orders["cc_expires"]; $Bank_Name = ""; $Gateway = ""; $AVS_Code = ""; $Transaction_ID = ""; $Order_Special_Notes = ""; // -------------------- QUERIES 1 ------------------------------------// //Orders_status_history for comments $orders_status_history = tep_db_query("select comments from orders_status_history where orders_id = " . $Orders_id); //$row_orders_status_history = tep_db_fetch_array($comments); while($row_orders_status_history = mysqli_fetch_array($orders_status_history)) { // end // $Comments = filter_text($row_orders_status_history["comments"]); } // -------------------- QUERIES 2 ------------------------------------// //Orders_subtotal $orders_subtotal = tep_db_query("select value from orders_total where class = 'ot_subtotal' and orders_id = " . $Orders_id); //$row_orders_subtotal = tep_db_fetch_array($orders_subtotal); while($row_orders_subtotal = mysqli_fetch_array($orders_subtotal)) { // end // $Order_Subtotal = filter_text($row_orders_subtotal["value"]); } // -------------------- QUERIES 3 ------------------------------------// //Orders_tax $orders_tax = tep_db_query("select value from orders_total where class = 'ot_tax' and orders_id = " . $Orders_id); //$row_orders_tax = tep_db_fetch_array($orders_tax); while($row_orders_tax = mysqli_fetch_array($orders_tax)) { // end // $Order_Tax = filter_text($row_orders_tax["value"]); } // -------------------- QUERIES 4 ------------------------------------// //Orders_Insurance $orders_insurance = tep_db_query("select value from orders_total where class = 'ot_insurance' and orders_id = " . $Orders_id); //$row_orders_insurance = tep_db_fetch_array($orders_insurance); while($row_orders_insurance = mysqli_fetch_array($orders_insurance)) { // end // $Order_Insurance = filter_text($row_orders_insurance["value"]); } $Tax_Exempt_Message = ""; // -------------------- QUERIES 5 ------------------------------------// //Orders_Shipping $orders_shipping = tep_db_query("select title, value from orders_total where class = 'ot_shipping' and orders_id = " . $Orders_id); //$row_orders_shipping = tep_db_fetch_array($orders_shipping); while($row_orders_shipping = mysqli_fetch_array($orders_shipping)) { // end // $Order_Shipping_Total = $row_orders_shipping["value"]; $Shipping_Method = filter_text($row_orders_shipping["title"]); // Shipping method from query 5 } // -------------------- QUERIES 6 ------------------------------------// //Orders_Residential Del Fee (Giftwrap) $orders_residential_fee = tep_db_query("select value from orders_total where class = 'ot_giftwrap' and orders_id = " . $Orders_id); //$row_orders_residential_fee = tep_db_fetch_array($orders_residential_fee); while($row_orders_residential_fee = mysqli_fetch_array($orders_residential_fee)) { // end // $Small_Order_Fee = $row_orders_residential_fee["value"]; } //////////////////////////////////// $Discount_Rate = ""; $Discount_Message = ""; $CODAmount = ""; // -------------------- QUERIES 7 ------------------------------------// //Orders_Total $orders_total = tep_db_query("select value from orders_total where class = 'ot_total' and orders_id = " . $Orders_id); //$row_orders_total = tep_db_fetch_array($orders_total); while($row_orders_total = mysqli_fetch_array($orders_total)) { // end // $Order_Grand_Total = $row_orders_total["value"]; } // -------------------- QUERIES 8 ------------------------------------// //Products COunt $orders_count = tep_db_query("select count(products_quantity) as o_count from orders_products where orders_id = " . $Orders_id); //$row_orders_total = tep_db_fetch_array($orders_total); while($row_orders_count = mysqli_fetch_array($orders_count)) { // end // $Number_of_Items = $row_orders_count[0]; // used array to show the number of items ordered } // $shipping_weight = ""; //$Coupon_Code = ""; //$Order_security_msg = ""; //$Order_Surcharge_Amount = ""; //$Order_Surcharge_Something = ""; //$Affiliate_code = ""; //$Sentiment_message = ""; //$Checkout_form_type = ""; //$Card_CVV_value = $row_orders["cvvnumber"]; //$future1 = ""; //$future2 = ""; //$future3 = ""; //$future4 = ""; //$future5 = ""; //$future6 = ""; //$future7 = ""; //$future8 = ""; //$future9 = ""; // csv settings $CSV_SEPARATOR = "^"; $CSV_NEWLINE = "\r\n"; //$csv_output .= "". "^" ; $csv_output .= $ShipTo_First_Name . " " ; $csv_output .= $ShipTo_Last_Name . "^" ; $csv_output .= $ShipTo_Company . "^" ; $csv_output .= $ShipTo_Address_1 . "^" ; //$csv_output .= "PL" . "^" ; $csv_output .= $ShipTo_Zip . "^" ; $csv_output .= $ShipTo_City . "^" ; //$csv_output .= $Time . "," ; //$csv_output .= $First_Name . "," ; //$csv_output .= $Last_Name . "," ; //$csv_output .= $Name_On_Card . "," ; //$csv_output .= $Company . "," ; //$csv_output .= $email . "," ; //$csv_output .= $Billing_Address_1 . "," ; //$csv_output .= $Billing_Address_2 . "," ; //$csv_output .= $Billing_City . "," ; //$csv_output .= $Billing_State . "," ; //$csv_output .= $Billing_Zip . "," ; //$csv_output .= $Billing_Country . "," ; $csv_output .= $Billing_Phone . "^" ; $csv_output .= $email . "^" ; $csv_output .= $Orders_id . "^" ; //$csv_output .= $Date . "^" ; //$csv_output .= "2000^^N^N^N^N^N^N^N^N^N". "" ; //$csv_output .= $ShipTo_Name . "," ; //$csv_output .= $ShipTo_Company . "," ; //$csv_output .= $ShipTo_Address_1 . "," ; //$csv_output .= $ShipTo_Address_2 . "," ; //$csv_output .= $ShipTo_State . "," ; //$csv_output .= $ShipTo_Zip . "," ; //$csv_output .= $ShipTo_Country . "," ; //$csv_output .= $ShipTo_Phone . "," ; //$csv_output .= $Card_Type . "," ; //$csv_output .= $Card_Number . "," ; //$csv_output .= $Exp_Date . "," ; //$csv_output .= $Bank_Name . "," ; //$csv_output .= $Gateway . "," ; //$csv_output .= $AVS_Code . "," ; //$csv_output .= $Transaction_ID . "," ; //$csv_output .= $Order_Special_Notes . "," ; //$csv_output .= $Comments . "," ; //$csv_output .= $Order_Subtotal . "," ; //$csv_output .= $Order_Tax . "," ; //$csv_output .= $Order_Insurance . "," ; //$csv_output .= $Tax_Exempt_Message . "," ; //$csv_output .= $Order_Shipping_Total . "," ; //$csv_output .= $Small_Order_Fee . "," ; //$csv_output .= $Discount_Rate . "," ; //$csv_output .= $Discount_Message . "," ; //$csv_output .= $CODAmount . "^" ; //$csv_output .= $Order_Grand_Total . "," ; //$csv_output .= $Number_of_Items . "," ; //$csv_output .= $Shipping_Method . "," ; //$csv_output .= $total_weight . "^" ; $csv_output .= $shipping_weight . "2^" ; //$csv_output .= $Coupon_Code . "," ; //$csv_output .= $Order_security_msg . "," ; //$csv_output .= $Order_Surcharge_Amount . "," ; //$csv_output .= $Order_Surcharge_Something . "," ; //$csv_output .= $Affiliate_code . "," ; //$csv_output .= $Sentiment_message . "," ; //$csv_output .= $Checkout_form_type . "," ; //$csv_output .= $Card_CVV_value . "," ; //$csv_output .= $future1 . "," ; //$csv_output .= $future2 . "," ; //$csv_output .= $future3 . "," ; //$csv_output .= $future4 . "," ; //$csv_output .= $future5 . "," ; //$csv_output .= $future6 . "," ; //$csv_output .= $future7 . "," ; //$csv_output .= $future8 . "," ; //$csv_output .= $future9 ; // -------------------- QUERIES 9 ------------------------------------// //Get list of products ordered //$orders_products = tep_db_query("select products_model, products_price, products_quantity, products_name, orders_products_id from orders_products //where orders_id = " . $Orders_id); // While loop to list the item //$countproducts = 0; //$csv_output_item = ""; //$csv_output_order = str_replace($csv_output_ordersbefore, "", $csv_output); //while($row_orders_products = mysql_fetch_array($orders_products)) { // loop through orders // More than one product per order, new line // if ($countproducts>0){ // $csv_output .= "\n"; // $csv_output .= $csv_output_order; // $csv_output_item = ""; // } // $csv_output_item .= "," . "BEGIN_ITEM". "," ; // $csv_output_item .= ","; // $csv_output_item .= filter_text($row_orders_products[0]) . "," ; // $csv_output_item .= $row_orders_products[1] . "," ; // $csv_output_item .= $row_orders_products[2] . "," ; // $csv_output_item .= filter_text($row_orders_products[3]) . "," ; // $Products_id = $row_orders_products[4]; // // $orders_products_attributes = tep_db_query("select products_options, products_options_values from orders_products_attributes // where orders_id = " . $Orders_id . " and orders_products_id = " . $Products_id); // // while($row_orders_products_attributes = mysql_fetch_array($orders_products_attributes)) { // $csv_output_item .= filter_text($row_orders_products_attributes[0]) . "," ; // $csv_output_item .= filter_text($row_orders_products_attributes[1]) . "," ; // } // $csv_output_item .= "END_ITEM"; // $csv_output .= $csv_output_item; // $countproducts += 1; //} // end while loop for products // --------------------------------------------------------------------------// $csv_output .= "\n"; } // while loop main first //print header("Content-Type: application/force-download\n"); header("Cache-Control: cache, must-revalidate"); header("Pragma: public"); header("Content-Disposition: attachment; filename=ordersexports_" . date("Ymd") . ".csv"); print $csv_output; exit; }//function main function filter_text($text) { $filter_array = array(",","\r","\n","\t"); return str_replace($filter_array,"",$text); } // function for the filter ?> Please help me :)
×