Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

Ok Here is a updated orders_by_vendor.php verified it works.

<?php
/*
  $Id: $orders_by_vendor.php V1.0 2006/03/25 by Craig Garrison Sr www.blucollarsales.com
  $Loc: /catalog/admin/ $
  $Mod: MVS V1.2 2009/02/28 JCK/CWG $
  
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2006 osCommerce

  Released under the GNU General Public License
*/

  require_once ('includes/application_top.php');

  require_once (DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  $line_filter = '';
  if (isset ($_GET['line']) && $_GET['line'] != '') {
    $line_filter = $_GET['line'];
    $line_filter = preg_replace("(\r\n|\n|\r)", '', $line_filter); // Remove CR &/ LF
    $line_filter = preg_replace("/[^a-z]/i", '', $line_filter); // strip anything we don't want
  }

  $vendors_id = 1;
  if (isset ($_POST['vendors_id']) && $_POST['vendors_id'] != '') { 
  $vendors_id = (int) $_POST['vendors_id'];
  }

  $sort_by_filter = 'orders_id';
  if (isset ($_GET['by']) && $_GET['by'] != '') {
    switch ($_GET['by']) {
      case 'date':
        $sort_by_filter = 'date_purchased';
        break;
      case 'customer':
        $sort_by_filter = 'customers_id';
        break;
      case 'status':
        $sort_by_filter = 'status';
        break;
      case 'sent':
        $sort_by_filter == 'sent';
        break;
      default:
        $sort_by_filter = 'orders_id';
        break;
    }
  }

  
  if (isset ($_POST['status']) && $_POST['status'] != '') {
    $status = preg_replace("(\r\n|\n|\r)", '', $status); // Remove CR &/ LF
    $status = preg_replace("/[^A-Za-z0-9]/i", '', $status); // strip everthing except alphanumerics
  }

  $sent = '';
  if (isset ($_GET['sent']) && ($_GET['sent'] == 'yes' || $_GET['sent'] == 'no') ) {
    $sent == $_GET['sent'];
  }

  require(DIR_WS_INCLUDES . 'template_top.php');
?>

    <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>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
<?php
  $vendors_array = array();
  $vendors_query = tep_db_query ("select vendors_id,
                                         vendors_name
                                  from " . TABLE_VENDORS . "
                                  order by vendors_id
                               ");
  while ($vendors = tep_db_fetch_array ($vendors_query) ) {
    $vendors_array[] = array ('id' => $vendors['vendors_id'],
                              'text' => $vendors['vendors_name']
                             );
  }
?>
                <td class="main" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_VENDORS, '&vendors_id=' . $vendors_id) . '"><b>Click to reset form</a></b>';?></td>
                <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_VENDORS) . '"><b>Go To Vendors List</a>';?><td>
              </tr>
              <tr>
                <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif','1','5'); ?></td>
              <tr>
                <td colspan="3"><?php echo tep_black_line(); ?></td>
              </tr>
              <tr>
                <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif','1','5'); ?></td>
              </tr>
              <tr>
                <td class="main" align="left"><?php echo tep_draw_form('vendors_report', FILENAME_ORDERS_VENDORS) . TABLE_HEADING_VENDOR_CHOOSE . ' '; ?><?php echo tep_draw_pull_down_menu('vendors_id', $vendors_array,'','onChange="this.form.submit()";');?></form></td>
                <td class="main" align="left"><?php echo 'Filter by email sent: <a href="' . tep_href_link(FILENAME_ORDERS_VENDORS, '&vendors_id=' . $vendors_id . '&line_filter=' . $line_filter . '&sent=yes') . '"><b>YES</a></b>  <a href="' . tep_href_link(FILENAME_ORDERS_VENDORS, '&vendors_id=' . $vendors_id . '&line_filter=' . $line_filter . '&sent=no') . '"><b>NO</a></b>'; ?></td>
<?php
  if ($line_filter == 'asc') {
    if (isset ($status) ) {
?>
                <td class="main" align="right"><?php echo 'Change to <a href="' . tep_href_link (FILENAME_ORDERS_VENDORS, 'vendors_id=' . $vendors_id . '&line_filter=desc' . '&sent=' . $sent . '&status=' . $status) . '"><b>DESCENDING</a></b> order'; ?></td>
<?php
    } else {
?>
<td class="main" align="right"><?php echo 'Change to <a href="' . tep_href_link (FILENAME_ORDERS_VENDORS, 'vendors_id=' . $vendors_id . '&line_filter=desc' . '&sent=' . $sent) . '"><b>DESCENDING</a></b> order'; ?></td>
<?php
}
} else {
if (isset ($status) ) {
?>
<td class="main" align="right"><?php echo 'Change to <a href="' . tep_href_link(FILENAME_ORDERS_VENDORS, '&vendors_id=' . $vendors_id . '&line_filter=asc' . '&sent=' . $sent . '&status=' . $status) . '"><b>ASCENDING</a></b> order'; ?></td>
<?php
} else {

?>
<td class="main" align="right"><?php echo 'Change to <a href="' . tep_href_link(FILENAME_ORDERS_VENDORS, '&vendors_id=' . $vendors_id . '&line_filter=asc' . '&sent=' . $sent) . '"><b>ASCENDING</a></b> order'; ?></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 class="main" align="right"><?php echo tep_draw_form('status_report', FILENAME_ORDERS_VENDORS . '?&vendors_id=' . $vendors_id) . HEADING_TITLE_STATUS . ' '; echo tep_draw_pull_down_menu('status', $orders_statuses, '','onChange="this.form.submit()";');?></form></td>
              </tr>
            </table>
          </tr>
          <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_VENDOR; ?></td>
                    <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_ORDER_ID; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
                    <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>
                    <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
                    <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_STATUS; ?></td>
                    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_SENT; ?> </td>
                  </tr>
<?php
  $vend_query_raw = "select vendors_name as name from " . TABLE_VENDORS . " where vendors_id = '" . $vendors_id . "'";
  $vend_query = tep_db_query($vend_query_raw);
  $vendors = tep_db_fetch_array($vend_query);
?>
                  <tr class="dataTableRow">
                    <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_VENDORS, '&vendors_id=' . $vendors_id . '&action=edit') . '" TARGET="_blank"><b>' . $vendors['name'] . '</a></b>'; ?></td>
                    <td class="dataTableContent"><?php echo ''; ?></td>
                    <td class="dataTableContent"><?php echo ''; ?></td>
                    <td class="dataTableContent"><?php echo ''; ?></td>
                    <td class="dataTableContent"><?php echo ''; ?></td>
                    <td class="dataTableContent"><?php echo ''; ?></td>
                    <td class="dataTableContent" align="right">Click To<br>Send Email</td>
                  </tr>
<?php
  if ($sent == 'yes') {
    $vendors_orders_data_query = tep_db_query ("select distinct orders_id, vendor_order_sent from " . TABLE_ORDERS_SHIPPING . " where vendors_id='" . $vendors_id . "' and vendor_order_sent='yes' group by orders_id " . $line_filter . "");
} elseif ($sent == 'no') {
$vendors_orders_data_query = tep_db_query ("select distinct orders_id, vendor_order_sent from " . TABLE_ORDERS_SHIPPING . " where vendors_id='" . $vendors_id . "' and vendor_order_sent='no' group by orders_id " . $line_filter . "");
} else {
$vendors_orders_data_query = tep_db_query ("select distinct orders_id, vendor_order_sent from " . TABLE_ORDERS_SHIPPING . " where vendors_id='" . $vendors_id . "' group by orders_id " . $line_filter . "");
// echo 'in admin/orders by vendor php line 224 line filter = ' . $line_filter . ' and orders id = ' . $vendors_orders_data['orders_id'];

}
while ($vendors_orders_data = tep_db_fetch_array ($vendors_orders_data_query)) {
if (isset ($status)) {
// $status = '1';
$orders_query = tep_db_query ("select distinct o.customers_id, o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from (" . TABLE_ORDERS . " o) left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = '" . $status . "' and o.orders_status = s.orders_status_id and s.language_id = '" . $languages_id . "' and ot.class = 'ot_total' and o.orders_id = '" . $vendors_orders_data['orders_id'] . "' order by o." . $sort_by_filter . " ASC");
// comes here but status is blank echo 'in admin/orders by vendor php line 219 vendors id = ' . $vendors_id . ' and orders id = ' . $vendors_orders_data['orders_id']. ' and status = ' . $status;

} else {
$orders_query = tep_db_query ("select distinct o.customers_id, o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from (" . TABLE_ORDERS . " o) left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . $languages_id . "' and ot.class = 'ot_total' and o.orders_id = '" . $vendors_orders_data['orders_id'] . "' order by o." . $sort_by_filter . " ASC");
// echo 'in admin/orders by vendor php line 223 vendors id = ' . $vendors_id . ' and orders id = ' . $vendors_orders_data['orders_id'];

}
while ($vendors_orders = tep_db_fetch_array ($orders_query) ) {
// echo 'in admin/orders by vendor php line 227 vendors id = ' . $vendors_id . ' and orders id = ' . $vendors_orders_data['orders_id'];

$date_purchased = $vendors_orders['date_purchased'];

?>
                  <tr class="dataTableRow">
                    <td class="dataTableContent" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $vendors_orders_data['orders_id'] . '&action=edit') . '" TARGET="_blank"><b>View this order</b></a>'; ?></td>
                    <td class="dataTableContent" align="left"><?php echo $vendors_orders['orders_id']; ?></td>
           <!--     <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=new_product&pID=' . $vendors_orders_data['v_products_id']) . '" TARGET="_blank"><b>' . $vendors_products_data['products_name'] . '</a>'; ?></td>  -->
                    <td class="dataTableContent"><?php echo ' from <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $vendors_orders['customers_id'] . '&action=edit') . '" TARGET="_blank"><b>' . $vendors_orders['customers_name'] . '</b></a>'; ?></td>
                    <td class="dataTableContent" align="left"><?php echo strip_tags($vendors_orders['order_total']); ?></td>
                    <td class="dataTableContent" align="left"><?php echo tep_date_short ($date_purchased); ?></td>
                    <td class="dataTableContent" align="left"><?php echo $vendors_orders['orders_status_name']; ?></td>
                    <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_VENDORS_EMAIL_SEND, '&vID=' . $vendors_id . '&oID=' . $vendors_orders_data['orders_id'] . '&vOS=' . $vendors_orders_data['vendor_order_sent']) . '"><b>' . $vendors_orders_data['vendor_order_sent'] . '</a></b>'; ?></td>
                  </tr>
<?php
    }
  }
?>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table>

<?php
  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Link to comment
Share on other sites

here is a updated prod_by_vendors.php verified it works:

<?php
/*
  $ID: prods_by_vendor.php (for use with MVS) by Craig Garrison Sr, BluCollar Sales
  $Loc: /catalog/admin/ $
  $Mod: MVS V1.2 2009/02/28 JCK/CWG $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2006 osCommerce

  Released under the GNU General Public License
*/

  require_once ('includes/application_top.php');

  require_once (DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  // Test changes 01-19-2008
  $line_filter = '';
  if (isset ($_GET['line']) && $_GET['line'] != '') {
    $line_filter = $_GET['line'];
    $line_filter = preg_replace("(\r\n|\n|\r)", '', $line_filter); // Remove CR &/ LF
    $line_filter = preg_replace("/[^a-z]/i", '', $line_filter); // strip anything we don't want
  }

  $vendors_id = 1;
  if (isset ($_POST['vendors_id']) && $_POST['vendors_id'] != '') { 
  $vendors_id = (int) $_POST['vendors_id'];
  }

  $show_order = '';
  if (isset ($_GET['show_order']) && $_GET['show_order'] != '') {
    $show_order = $_GET['show_order'];
    $show_order = preg_replace("(\r\n|\n|\r)", '', $show_order); // Remove CR &/ LF
    $show_order = preg_replace("/[^a-z]/i", '', $show_order); // strip anything we don't want
  }

  switch ($line_filter) {
    case 'prod' :
      $sort_by_filter = 'pd.products_name';
      break;
    case 'vpid' :
      $sort_by_filter = 'p.vendors_prod_id';
      break;
    case 'pid' :
      $sort_by_filter = 'p.products_id';
      break;
    case 'qty' :
      $sort_by_filter = 'p.products_quantity';
      break;
    case 'vprice' :
      $sort_by_filter = 'p.vendors_product_price';
      break;
    case 'price' :
    case '' :
    default :
      $sort_by_filter = 'p.products_price';
      break;
  }

  require(DIR_WS_INCLUDES . 'template_top.php');
?>

    <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>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
<?php

  $vendors_query = tep_db_query ("select vendors_id,
                                         vendors_name
                                  from " . TABLE_VENDORS . "
                                  order by vendors_name
                                ");
  while ($vendors = tep_db_fetch_array ($vendors_query) ) {
    $vendors_array[] = array (
      'id' => $vendors['vendors_id'],
      'text' => $vendors['vendors_name']
    );
  }
?>
                <td class="main" align="left"><?php echo TABLE_HEADING_VENDOR_CHOOSE . ' '; ?><?php echo tep_draw_form ('vendors_report', FILENAME_PRODS_VENDORS) . tep_draw_pull_down_menu ('vendors_id', $vendors_array,'','onChange="this.form.submit()";');?></form></td>
                <td class="main" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_VENDORS) . '"><b>Go To Vendors List</a>';?><td>
              </tr>
              <tr>
                <td class="main" align="left">
<?php

  if ($show_order == 'desc') {
    // Test code -- 3 lines
    echo 'Click for <a href="' . tep_href_link (FILENAME_PRODS_VENDORS, '&vendors_id=' . $vendors_id . '&line=' . $line_filter . '&show_order=asc') . '"><b>ascending order</b></a>';
  } else {
    echo 'Click for <a href="' . tep_href_link (FILENAME_PRODS_VENDORS, '&vendors_id=' . $vendors_id . '&line=' . $line_filter . '&show_order=desc') . '"><b>descending order</b></a>';
  }
?>
              </td>
            </tr>
        </table></td>
      </tr>
<?php

  if (isset ($vendors_id)) {
    $vend_query_raw = "select vendors_name as name from " . TABLE_VENDORS . " where vendors_id = '" . $vendors_id . "'";
    $vend_query = tep_db_query ($vend_query_raw);
    $vendors = tep_db_fetch_array ($vend_query);
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="1">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_VENDOR; ?></td>
                <td class="dataTableHeadingContent" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_PRODS_VENDORS, 'vendors_id=' . $vendors_id . '&line=prod') . '">' . TABLE_HEADING_PRODUCTS_NAME . '</a>'; ?> </td>
                <td class="dataTableHeadingContent" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_PRODS_VENDORS, 'vendors_id=' . $vendors_id . '&line=vpid') . '">' . TABLE_HEADING_VENDORS_PRODUCT_ID . '</a>'; ?></td>
                <td class="dataTableHeadingContent" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_PRODS_VENDORS, 'vendors_id=' . $vendors_id . '&line=pid') . '">' .  TABLE_HEADING_PRODUCTS_ID . '</a>'; ?></td>
                <td class="dataTableHeadingContent" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_PRODS_VENDORS, 'vendors_id=' . $vendors_id . '&line=qty') . '">' .  TABLE_HEADING_QUANTITY . '</a>'; ?></td>
                <td class="dataTableHeadingContent" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_PRODS_VENDORS, 'vendors_id=' . $vendors_id . '&line=vprice') . '">' .  TABLE_HEADING_VENDOR_PRICE . '</a>'; ?></td>
                <td class="dataTableHeadingContent" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_PRODS_VENDORS, 'vendors_id=' . $vendors_id . '&line=price') . '">' .  TABLE_HEADING_PRICE . '</a>'; ?></td>
              </tr>
              <tr class="dataTableRow">
                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_VENDORS, '&vendors_id=' . $vendors_id . '&action=edit') . '" TARGET="_blank"><b>' . $vendors['name'] . '</a></b>'; ?></td>
                <td class="dataTableContent"><?php echo ''; ?></td>
                <td class="dataTableContent"><?php echo ''; ?></td>
                <td class="dataTableContent"><?php echo ''; ?></td>
                <td class="dataTableContent"><?php echo ''; ?></td>
                <td class="dataTableContent"><?php echo ''; ?></td>
                <td class="dataTableContent"><?php echo ''; ?></td>

<?php

    // if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
    $rows = 0;
    if ($show_order == 'desc') {
      $products_query_raw = "select p.products_id, p.vendors_id, pd.products_name, p.products_quantity , p.products_price, p.vendors_product_price, p.vendors_prod_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.vendors_id = " . $vendors_id . " and pd.language_id = " . $languages_id . " order by " . $sort_by_filter . " desc";
    } elseif ($show_order == 'asc') {
      $products_query_raw = "select p.products_id, p.vendors_id, pd.products_name, p.products_quantity , p.products_price, p.vendors_product_price, p.vendors_prod_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.vendors_id = " . $vendors_id . " and pd.language_id = " . $languages_id . " order by " . $sort_by_filter . " asc";
    } else {
      $products_query_raw = "select p.products_id, p.vendors_id, pd.products_name, p.products_quantity , p.products_price, p.vendors_product_price, p.vendors_prod_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.vendors_id = " . $vendors_id . " and pd.language_id = " . $languages_id . " order by " . $sort_by_filter . "";
    }

    $products_query = tep_db_query ($products_query_raw);
    while ($products = tep_db_fetch_array ($products_query)) {
      $rows++;

      if (strlen ($rows) < 2) {
        $rows = '0' . $rows;
      }
?>
              <tr class="dataTableRow">
<?php

      if ($products['vendors_prod_id'] == '') {
        $products['vendors_prod_id'] = 'None Specified';
      }
?>
                <td class="dataTableContent"><?php echo ''; ?></td>
                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=new_product&pID=' . $products['products_id']) . '" TARGET="_blank"><b>' . $products['products_name'] . '</a></b>'; ?></td>
                <td class="dataTableContent"><?php echo $products['vendors_prod_id']; ?></td>
                <td class="dataTableContent"><?php echo $products['products_id']; ?></td>
                <td class="dataTableContent" align="left"><?php echo $products['products_quantity']; ?> </td>
                <td class="dataTableContent"><?php echo $products['vendors_product_price']; ?></td>
                <td class="dataTableContent"><?php echo $products['products_price']; ?></td>
              </tr>
<?php

    }
  }
?>
            </table></td>
          </tr>
          <tr>
            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td class="smallText" valign="top">
<?php

?>
                </td>
                <td class="smallText" align="right">
<?php

?>
                </td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table>
<?php
  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
Link to comment
Share on other sites

I'm not sure why we were checking for weight in that code. It doesn't need to be there, so go ahead and make that change.

 

If you're sure that your code is on an unmodified osC 2.3.4, go ahead and upload to the addon area for MVS. Call it Version 1.3, and note the version of osC that it's for.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I have to figure out that checkout Payment error before I submit anything. It has to be something stupid. I am going to go back and see from 2.3.1 what changes where made to checkout_shipping.php. If i upload a file at a time on 2.3.4 from 2.3.1 would it break anything? This way I can see what file is causing it. I am guessing checkout_shipping.php . The error is thrown out at after you check the shipping on checkout_payment.php

 

I cant use a print_r for this correct?

Link to comment
Share on other sites

You can probably persuade Github to show you the changes for a given file, or you can download the upgrade package and read the instructions in that.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

the orders_by_vendors.php the status isn't working and I am lost why:

 

If I comment the status I at least see the orders by the drop down but the drop down status wont work if commented out. I hope I am making sense here. I think you had $_GET and should have been $_POST I think. For the status not sure why that isn't working. I tried putting print_r between the status and showed nothing at all

$vendors_id = 1;
  if (isset ($_POST['vendors_id']) && $_POST['vendors_id'] != '') { 
  $vendors_id = (int) $_POST['vendors_id'];
  }

$line_filter = '';
  if (isset ($_GET['line']) && $_GET['line'] != '') {
    $line_filter = $_GET['line'];
    $line_filter = preg_replace("(\r\n|\n|\r)", '', $line_filter); // Remove CR &/ LF
    $line_filter = preg_replace("/[^a-z]/i", '', $line_filter); // strip anything we don't want
  }

  $sort_by_filter = 'orders_id';
  if (isset ($_GET['by']) && $_GET['by'] != '') {
    switch ($_GET['by']) {
      case 'date':
        $sort_by_filter = 'date_purchased';
        break;
      case 'customer':
        $sort_by_filter = 'customers_id';
        break;
      case 'status':
        $sort_by_filter = 'status';
        break;
      case 'sent':
        $sort_by_filter == 'sent';
        break;
      default:
        $sort_by_filter = 'orders_id';
        break;
    }
  }

  $status = '';
  if (isset ($_POST['status']) && $_POST['status'] != '') {
    $status = preg_replace("(\r\n|\n|\r)", '', $status); // Remove CR &/ LF
    $status = preg_replace("/[^A-Za-z0-9]/i", '', $status); // strip everthing except alphanumerics
  }
Link to comment
Share on other sites

Thanks to Peace2u I figured out orders_by_vendor.php working.

 

Ok I am probably going to upload the new version and call it MVS V1.4, I am going to do a fast Read Me page and have any bug reports to this forum.

 

Of course will say Beta release. I haven't tested all of the modules yet. I plan to do the product_ship_estimator another time so I won't include that in this release unless I got time. Once I figure out why I getting this payment error it should be ready to go.

Link to comment
Share on other sites

I am not sure if I did this right and this maybe the problem I having in checkout_shipping.php here is the line:

//MVS
        $shipping = array('id' => $shipping,
                          'title' => $shipping_title,
                          'cost' => $total_shipping_cost,
                          'shipping_tax_total' => $total_ship_tax,
                          'vendor' => $output
                         );

        tep_redirect (tep_href_link (FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL') );

      } else {
// MVS End
      if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
        if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
          $shipping = $HTTP_POST_VARS['shipping'];

          list($module, $method) = explode('_', $shipping);
          if ( is_object($$module) || ($shipping == 'free_free') ) {
            if ($shipping == 'free_free') {
              $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
              $quote[0]['methods'][0]['cost'] = '0';
            } else {
              $quote = $shipping_modules->quote($method, $module);
            }
            if (isset ($quote['error']) ) {
              tep_session_unregister('shipping');
            } else {
              if ( (isset($quote[0]['methods'][0]['title']) ) && (isset($quote[0]['methods'][0]['cost'])) ) {
                $shipping = array('id' => $shipping,
                                  'title' => ( ($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
                                  'cost' => $quote[0]['methods'][0]['cost']);

                tep_redirect (tep_href_link (FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL') );
              }
            }
          } else {
            tep_session_unregister ('shipping');
          }
        } else {
          tep_session_unregister('shipping');
        }
      } else {
      $shipping = false;
      
// MVS
      }
      
      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
    }    
  }

I have it like this:

//MVS
        $shipping = array('id' => $SESSION['shipping'],
                          'title' => $shipping_title,
                          'cost' => $total_shipping_cost,
                          'shipping_tax_total' => $total_ship_tax,
                          'vendor' => $output
                         );

        tep_redirect (tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
      } else {
// MVS End
      if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
      if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
        $shipping = $HTTP_POST_VARS['shipping'];

        list($module, $method) = explode('_', $shipping);
        if ( is_object($$module) || ($shipping == 'free_free') ) {
          if ($shipping == 'free_free') {
            $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
            $quote[0]['methods'][0]['cost'] = '0';
          } else {
            $quote = $shipping_modules->quote($method, $module);
          }
          if (isset($quote['error'])) {
            tep_session_unregister('shipping');
          } else {
            if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
              $shipping = array('id' => $shipping,
                                'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
                                'cost' => $quote[0]['methods'][0]['cost']);

              tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
   }
            }
        
          }
        } else {
          tep_session_unregister('shipping');
      }
        } else {
      if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') ) { //Update 2.3.4
        tep_session_unregister('shipping');
      } else {
        $shipping = false;

        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
      }
}
    }    
  }
Edited by drillsar
Link to comment
Share on other sites

Ok no longer get that error it's fixed. Is the above correct though? I added that shipping zone check from the update 2.3.4 but I am not sure if it's correct

 

One change I made and it works so

 

I changed the lines to checkout_payment if it's wrong than I don't know but it works.

Link to comment
Share on other sites

Most of that code will never execute, since the redirect on line 175 makes it jump to the confirmation page. Any changes after that line will do nothing (if MVS is enabled).

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

It's confusing because in 2.3.4 it mentions to add it here and this is where I believed MVS ended. MVS has two } else {
          tep_session_unregister('shipping'); statements so I deleted on and replaced it with that but your saying that it wouldnt be executed but I am confused. I looked at oscommerce stock and this line is almost the same except the added unregister shipping so I removed that and put this in place. After that I added this line to.

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING);

if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') && !tep_session_is_registered('shipping') && ($shipping == false) ) {
$messageStack->add_session('checkout_address', ERROR_NO_SHIPPING_AVAILABLE_TO_SHIPPING_ADDRESS);

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'));
}

This is what instructions tell u to do according to oscommerce update

 

around line 139, change from:

$shipping = false;

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

 

to

 

if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') ) {
tep_session_unregister('shipping');
} else {
$shipping = false;

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}

 

 

Than

 

 

around line 156, change from:

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING);

to:

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING);

if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') && !tep_session_is_registered('shipping') && ($shipping == false) ) {
$messageStack->add_session('checkout_address', ERROR_NO_SHIPPING_AVAILABLE_TO_SHIPPING_ADDRESS);

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'));
}

Edited by drillsar
Link to comment
Share on other sites

Jim have any ideas on why the order data isn't showing up on account_history_info.php? in the history it's there but when you click view it isn't.

 

I used the following to see if data is being pulled:

 

print '</pre>' . "<br>\n";
print 'Orders Shipping Id: ' . ($checked_data['orders_shipping_id']) . "<br>\n";
print 'Vendor Data Array = ';
print_r($check_new_vendor_data_query);

 

I got the following results


Orders Shipping Id: 10
Vendor Data Array = mysqli_result Object ( [current_field] => 0 [field_count] => 7 [lengths] => Array ( [0] => 2 [1] => 1 [2] => 1 [3] => 10 [4] => 4 [5] => 8 [6] => 6 ) [num_rows] => 10 [type] => 0 ) $include_modules[]:


Delivery Address
Name
address
some city
United States
Shipping Method
Combined Shipping
Shipment 	Products 	Model 	Each 	Total
Shipment Number 1 	Best Way
Shipment Number 2 	Best Way
Shipment Number 3 	Best Way
Shipment Number 4 	Best Way
Shipment Number 5 	Best Way
Shipment Number 6 	Best Way
Shipment Number 7 	Best Way
Shipment Number 8 	Best Way
Shipment Number 9 	Best Way
Shipment Number 10 	Best Way
Billing Information
Billing Address
tom mccaff
53 elmwood dr
Livingston, New Jersey 07039
United States
Payment Method
Cash on Delivery
	
Sub-Total: 	$579.98
Combined Shipping: 	$10.00
Total: 	$589.98

Edited by drillsar
Link to comment
Share on other sites

It looks like you're missing some data. You'll have to insert print statements at different places and track it down.

 

I worked on MVS about 8 years ago. Craig was the main programmer; I just helped out with some of the Admin parts and the class modifications. He had already done this part. So, the result is I don't know much about this part of the code. i would have to do what you're doing and trace it down.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...