Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

I'm using the two together on several sites, so I would say yes.

 

Regards

Jim

 

Jim could you assist me in merging this query - not sure what to do:

 

This is the exisiting mvs code:

//MVS start Many additions here, the order they are listed is very important: all new fields have vendor or vendors in the name, (ie, "vendors_product_price,")

$product_query = tep_db_query("select products_quantity, products_model, vendors_prod_id, products_image, products_price, vendors_product_price, vendors_prod_comments, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, vendors_id, manufacturers_id, products_to_rss 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, vendors_prod_id, products_image, products_price, vendors_product_price, vendors_prod_comments, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, vendors_id, manufacturers_id, products_to_rss) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['vendors_prod_id']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', '" . tep_db_input($product['vendors_product_price']) . "', '" . tep_db_input($product['vendors_prod_comments']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '" . tep_db_input($product['products_status']) . "', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['vendors_id'] . "', '" . (int)$product['manufacturers_id'] . "', '" . (int)$product['products_to_rss'] . "')");

$dup_products_id = tep_db_insert_id();

//MVS end

 

and this is the QPBPP code:

// BOF qpbpp

//$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_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_qty_blocks, products_date_available, products_weight, products_tax_class_id, manufacturers_id, ptdc.discount_categories_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc on p.products_id = ptdc.products_id where p.products_id = '" . (int)$products_id . "'");

// EOF qpbpp

 

// BOF qpbpp

//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(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");

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, products_qty_blocks) 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(), " .

(empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" .

tep_db_input($product['products_weight']) . "', '0', '" .

(int)$product['products_tax_class_id'] . "', '" .

(int)$product['manufacturers_id'] . "', '" .

tep_db_input($product['products_qty_blocks']) . "')");

// EOF qpbpp

 

 

Thanks in advance for your help!

PN

Link to comment
Share on other sites

I can't just eyeball that mess, and I'm in the middle of something right now. Suggest that you use a good comparison probram to compare the two files. That will highlight the differences. Then just combine them until they're the same.

 

Regards

Jim

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

Link to comment
Share on other sites

Hi, everyone!!

 

I recently installed MVS into a customised templete with some changes to the existing files. It seemed to work fine at the first stage but now I have some problem with 'Zone Rates' module.

 

With standard OSCommerce(when MVS is off), the 'Zone Rates' work normal but it says 'No shipping available to the selected country' when MVS is on.

Of cause I installed 'Zone Rates' in 'Vendor Manager' for the Venfor. Do I need to set up the zones in somewhere else?

 

To sort this out, I changed "Number of zones (Zones module)" to 3 from 0. Then this erorr came up;

 

Can anyone please help this? Thank you in advance.

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_1 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 176

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_2 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 176

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_3 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 176

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_1 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 186

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_2 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 186

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_3 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 186

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_1 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 176

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_2 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 176

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_3 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 176

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_1 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 186

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_2 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 186

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_SHIPPING_ZONES_COUNTRIES_6_3 in /home/devils13/public_html/includes/modules/vendors_shipping/zones.php on line 186

Link to comment
Share on other sites

After you change the number of zones, you need to uninstall and then reinstall the module.

 

Regards

Jim

 

 

Thanks Jim!!!

 

But can you please tell me which module you are talking about and how I can remove the current module for re-install?

 

have a good day!!

 

Thanks again.

 

Jong.

Edited by devils13
Link to comment
Share on other sites

Thanks Jim!!!

 

But can you please tell me which module you are talking about and how I can remove the current module for re-install?

 

have a good day!!

 

Thanks again.

 

Jong.

 

I sort it out... I reinstalled the module(cilcking the 'REMOVE' and 'INSTALL' buttons)in the Vendor Manager.

 

Thanks,

 

Jong

Link to comment
Share on other sites

could you assist me in merging this query - not sure what to do:

I think this should do it:

 

// MVS plus QPBPP (adds products_qty_blocks and discount_categories_id, the last one needs a join
// with products_to_discount_categories)
$product_query = tep_db_query("select products_quantity, products_model, vendors_prod_id, products_image, products_price, vendors_product_price, vendors_prod_comments, products_qty_blocks, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, vendors_id, manufacturers_id, ptdc.discount_categories_id, products_to_rss from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc on p.products_id = ptdc.products_id where p.products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);

// the discount_categories_id is not administered here but on a separate page
// only products_qty_blocks is needed for QPBPP
tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, vendors_prod_id, products_image, products_price, vendors_product_price, vendors_prod_comments, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, vendors_id, manufacturers_id, products_to_rss, products_qty_blocks) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['vendors_prod_id']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', '" . tep_db_input($product['vendors_product_price']) . "', '" . tep_db_input($product['vendors_prod_comments']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '" . tep_db_input($product['products_status']) . "', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['vendors_id'] . "', '" . (int)$product['manufacturers_id'] . "', '" . (int)$product['products_to_rss'] . "', '" . tep_db_input($product['products_qty_blocks']) . "')");
$dup_products_id = tep_db_insert_id();
//MVS plus QPBPP end

Link to comment
Share on other sites

I think this should do it:

 

// MVS plus QPBPP (adds products_qty_blocks and discount_categories_id, the last one needs a join
// with products_to_discount_categories)
$product_query = tep_db_query("select products_quantity, products_model, vendors_prod_id, products_image, products_price, vendors_product_price, vendors_prod_comments, products_qty_blocks, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, vendors_id, manufacturers_id, ptdc.discount_categories_id, products_to_rss from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " ptdc on p.products_id = ptdc.products_id where p.products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);

// the discount_categories_id is not administered here but on a separate page
// only products_qty_blocks is needed for QPBPP
tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, vendors_prod_id, products_image, products_price, vendors_product_price, vendors_prod_comments, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, vendors_id, manufacturers_id, products_to_rss, products_qty_blocks) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['vendors_prod_id']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', '" . tep_db_input($product['vendors_product_price']) . "', '" . tep_db_input($product['vendors_prod_comments']) . "', now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '" . tep_db_input($product['products_status']) . "', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['vendors_id'] . "', '" . (int)$product['manufacturers_id'] . "', '" . (int)$product['products_to_rss'] . "', '" . tep_db_input($product['products_qty_blocks']) . "')");
$dup_products_id = tep_db_insert_id();
//MVS plus QPBPP end

Jan:

Thank You for your help - being a novice at this can you tell me what decides the order of the query?

 

Thanks again!

Pete

Edited by pete636ua
Link to comment
Share on other sites

being a novice at this can you tell me what decides the order of the query?

In the select the order is not relevant. In the insert you have to be careful that the declaration and order of the fields matches the number and order of values insert into YOUR_TABLE (column1, column2, etcetera) values (new_value_for_column1, new_value_for_column2, etcetera)

Link to comment
Share on other sites

Hi,

 

I have installed MVS and have obviously missed something as neither the Vendors Product Report nor the Vendors Order List show anything. When I process an order I get the emails (I am sending all vendors emails to myself for testing) no problems.

 

Could someone please direct me to the files, where I may have overlooked something in?

 

Thanks

Link to comment
Share on other sites

Hi Jim,

 

Hope all is excellent with you, thanks for this

awesome achievement (to all involved), yeah, now i'm

about to pester you for some clues in regards

to integrating MVS with paypal ipn, i searched

the thread before resorting to the dreaded

'asking for directions', but couldn't seem to locate

any definitive set of details, only vague references

that they were compatible, thanks again for both the

contribution and ongoing support...

 

jk

 

ps - also had a problem similar to the above post

(Products Reports and Vendors Orders List)

made some changes to admin/prods_by_vendors.php and

admin/orders_by_vendors.php that managed to get them

to work - could post those 2 files if it might help...

Link to comment
Share on other sites

Hi Jim,

 

Hope all is excellent with you, thanks for this

awesome achievement (to all involved), yeah, now i'm

about to pester you for some clues in regards

to integrating MVS with paypal ipn, i searched

the thread before resorting to the dreaded

'asking for directions', but couldn't seem to locate

any definitive set of details, only vague references

that they were compatible, thanks again for both the

contribution and ongoing support...

 

jk

 

ps - also had a problem similar to the above post

(Products Reports and Vendors Orders List)

made some changes to admin/prods_by_vendors.php and

admin/orders_by_vendors.php that managed to get them

to work - could post those 2 files if it might help...

 

If you could that would be great - I am still learning how this code hangs together.

 

Thanks

Edited by Dihusky
Link to comment
Share on other sites

here tis... the best thing to do is use something like

winmerge to compare these files to yours and bear in

mind that i don't claim to be the brightest bulb on the

shelf so take the usual precaution of making a backup copy

(i rename the old files with a date at the end, for example

prods_by_vendor21510.php so it shows when the file was changed)

 

==============================================================================

<?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 © 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

}

// echo 'in admin/prodss by vendor php line 27 and post vendors id = ' . $_POST['vendors_id'];

// echo 'in admin/prodss by vendor php line 28 and get vendors id = ' . $_GET['vendors_id'];

// echo 'in admin/prodss by vendor php line 28 and var vendors id = ' . $vendors_id;

 

// if (isset ($_GET['vendors_id']) && $_GET['vendors_id'] != '') {

if (isset ($vendors_id)) {

 

// $vendors_id = (int) $_GET['vendors_id'];

// $vendors_id = $_POST['vendors_id'];

} else {

 

$vendors_id = 1;

}

 

$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;

}

 

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<script language="javascript" src="includes/general.js"></script>

</head>

<body bgcolor="#FFFFFF">

<!-- header //-->

<?php require_once(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require_once(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><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_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 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

// $vendors_id = $_POST['vendors_id'];

 

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)) {

 

// $vendors_id = $_POST['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($_GET['page']) && ($_GET['page'] > 1)) $rows = $_GET['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_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);

Decide not to use SPLIT pages for the $vendors_id variable not being maintained.

*/

 

$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

 

// echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS);

?>

</td>

<td class="smallText" align="right">

<?php

 

// echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'].$vendors_id);

?>

</td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

</table></td>

<!-- body_text_eof //-->

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require_once(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

</body>

</html>

<?php require_once(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

===================================================================

<?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 © 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();

 

/* 2-15-10 commented out used below " jk fix" $vendors_id = 0;

if (isset ($_GET['vendors_id'])) {

$vendors_id = (int) $_GET['vendors_id'];

}

X 2-15-10 commented out used below "jk fix"

*/

 

// echo 'in admin/prodss by vendor php line 27 and post vendors id = ' . $_POST['vendors_id'];

// echo 'in admin/prodss by vendor php line 28 and get vendors id = ' . $_GET['vendors_id'];

// echo 'in admin/prodss by vendor php line 28 and var vendors id = ' . $vendors_id;

 

// if (isset ($_GET['vendors_id']) && $_GET['vendors_id'] != '') {

// 2-15-10 "jk fix"

if (isset ($vendors_id)) {

 

// $vendors_id = (int) $_GET['vendors_id'];

// $vendors_id = $_POST['vendors_id'];

} else {

 

$vendors_id = 1;

}

// X 2-15-10 "jk fix"

 

 

// $line_filter = 'desc';

// if (isset ($_GET['line_filter']) && $_GET['line_filter'] == 'asc') {

if (isset ($_GET['line_filter'])) {

 

$line_filter == $_GET['line_filter'];

 

} else {

$line_filter = 'desc';

}

// echo 'in admin/orders by vendor php line 35 and line = ' . $_GET['line_filter'];

 

$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;

}

}

 

// 2-15-10 commented out because was resetting status to nothing - $status = '';

if (isset ($_POST['status']) && $_POST['status'] != '') {

// echo 'in admin/orders by vendor php line 79 and status = ' . $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

// echo 'in admin/orders by vendor php line 83 and status = ' . $status;

 

}

 

$sent = '';

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

$sent == $_GET['sent'];

}

 

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<script language="javascript" src="includes/general.js"></script>

</head>

<body bgcolor="#FFFFFF">

<!-- header //-->

<?php require_once(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require_once(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><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 (array ('id' => '1',

// 'text' => 'NONE'

// )

// );

$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']

);

// correct echo 'in orders by vendor php line 115 id = ' . $vendors['vendors_id'] . 'and name = '. $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

// echo 'in admin/orders by vendor php line 140 vendors id = ' . $vendors_id . ' and line filter = ' . $line_filter . ' and status = ' . $status;

 

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) ) {

// echo 'in admin/orders by vendor php line 157 vendors id = ' . $vendors_id . ' and line filter = ' . $line_filter . ' and status = ' . $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 {

 

// echo 'in admin/orders by vendor php line 164 vendors id = ' . $vendors_id . ' and line filter = ' . $line_filter . ' and status = ' . $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) . '"><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

// $index1 = 0;

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></td>

<!-- body_text_eof //-->

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require_once (DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

</body>

</html>

<?php require_once (DIR_WS_INCLUDES . 'application_bottom.php'); ?>

========================================================================

 

good luck,

 

jk

Link to comment
Share on other sites

G'day guys!

 

Can anyone tell me this is an erorr please?

 

I installed MVS and it works alright but whenever I try to set a vendor for a product in Categories/Products(Admin panel), it keeps saying "Warning: No file uploaded". And it seems nothing changes. Do I need to change a folder permission?

 

Thanks in advance.

 

cheers,

 

Jong

Link to comment
Share on other sites

G'day guys!

 

Can anyone tell me this is an erorr please?

 

I installed MVS and it works alright but whenever I try to set a vendor for a product in Categories/Products(Admin panel), it keeps saying "Warning: No file uploaded". And it seems nothing changes. Do I need to change a folder permission?

 

Thanks in advance.

 

cheers,

 

Jong

 

The "no file uploaded" warning only occurs if you do not upload an image to go with the Product information. It's not really an error, it's just letting you know you didn't attach an image to that Product's listing (which isn't required). The fact that nothing changes means that you probably missed something in making the modifications to your catalog/admin/categories.php file. I recommend using a tool like WinMerge to compare the MVS categories.php file to your own (make sure to back up your current copy before making any changes)

 

Also make sure you've added all your Vendors to the MVS Vendor listing before creating new products for that Vendor.

Edited by gwynwyffar
Link to comment
Share on other sites

in regards

to integrating MVS with paypal ipn

 

still pressing on, having a bit of trouble incorporating this part into paypal.ipn:

=============================================

if (SELECT_VENDOR_SHIPPING == 'true') {

// Insert data into new orders_shipping table

$shipping_array = $shipping['vendor'];

 

foreach ($shipping_array as $vendors_id => $shipping_data) {

===============================================

 

this generates

Warning: Invalid argument supplied for foreach() in /public_html/includes/modules/payment/paypal_ipn.php on line 347

 

wondering if there is a conflict with $shipping in paypal.ipn?

 

(I am able to successfully print out using the code snippet "print 'Array Vendor Shipping: <pre>'; ..."

in checkout_confirmation.php

but receive no values for "print_r ($shipping);" when trying the same code snippet in paypal.ipn)

 

does anyone have any suggestions on how to access the $shipping array values in paypal.ipn?

 

thanks for your insight

 

jk

Link to comment
Share on other sites

If that code is inside a function, you need to add

global $shipping;

just after the function declaration.

 

Regards

Jim

 

You're right, it is - function confirmation() - to be specific.

global $shipping; - now added and sailing full steam ahead!

eg. saving to TABLE_ORDERS_SHIPPING

 

Thank you, it's a huge relief to move forward.

 

Gratefully,

John

Link to comment
Share on other sites

perhaps this is a php 5.3 "issue"

(subtitled "how to lose your hair in 5 easy handfuls")

when checking out

Warning: substr() expects parameter 1 to be string, array given in C:\server\xampp\htdocs\public_html\includes\classes\vendor_shipping.php on line 64

line 64 is:

if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $modules_array)) ) {

 

some troubleshooting info:

echo ' in classes/vendors_shipping php line 63 '

. '<br />' . ' and module = ' . $module (PRODUCES - module = Array)

. '<br />' . ' and modules_id = ' . $module['id'] (PRODUCES - modules_id = Array)

. '<br />' . ' and PHP_SELF = ' . $PHP_SELF; (PRODUCES - PHP_SELF = checkout_confirmation.php)

 

then it reproduces eerily similar warnings in ot_shipping.php (or is that errorly)

anyway, from my extensively limited grasp of php, it seems that shipping array needs to

be extracted somehow to retrieve the id - am I getting warm?

 

Thanks for any guidance,

 

John

Link to comment
Share on other sites

Nothing to do with PHP 5.3, as far as I know anyway. It appears that $module['id'] is being set to an array. This should never happen. I would first print out that array to see what it is. That may give us a hint.

print '$module['id']: <pre>';
print_r ($module['id']);
print '</pre>';

Regards

Jim

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

Link to comment
Share on other sites

Nothing to do with PHP 5.3, as far as I know anyway. It appears that $module['id'] is being set to an array. This should never happen. I would first print out that array to see what it is. That may give us a hint.

print '$module['id']: <pre>';
print_r ($module['id']);
print '</pre>';

Regards

Jim

 

Hi Jim,

 

Thanks for the swift response.

 

Ok, the results of adding the print code

(before the: if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $modules_array)) ) {

 

 

$module[id]:

 

Array

(

)

 

===============================

also did another printout in case it might help...

 

This is going from checkout payment to checkout confirmation using:

print ' in classes/vendor shipping php line 81 ' . "<br />\n";

// print 'Array Vendor Shipping: <pre>';

print_r ($module);

print_r ($module['id']);

print_r ($modules_array);

print_r ($include_modules);

 

print '</pre>' . "<br />\n";

print 'class = ' . $class . "<br />\n";

print 'file = ' . $value . "<br />\n";

 

 

ECHO RESULTS:

 

in classes/vendor shipping php line 81

Array Vendor Shipping:

 

Array

(

[id] => Array

(

)

 

[title] => Combined Shipping

[cost] => 3.0002

[shipping_tax_total] => 0

[vendor] => Array

(

[1] => Array

(

[id] => freeamount_freeamount

[title] => Economy (9 - 14 Days)

[ship_tax] => 0

[products] => Array

(

[0] => 8

[1] => 11

)

 

[cost] => 0.0001

)

 

[3] => Array

(

[id] => freeamount_freeamount

[title] => Economy (9 - 14 Days)

[ship_tax] => 0

[products] => Array

(

[0] => 1{4}3{3}6

[1] => 22{5}10

[2] => 22{5}13

)

 

[cost] => 3.0001

)

 

)

 

)

Array

(

)

Array

(

[0] => freeamount.php

[1] => usps.php

)

Array

(

)

 

 

class =

file =

 

Warning: strpos() expects parameter 1 to be string, array given in C:\server\xampp\htdocs\public_html\includes\classes\vendor_shipping.php on line 95

 

Warning: substr() expects parameter 1 to be string, array given in C:\server\xampp\htdocs\public_html\includes\classes\vendor_shipping.php on line 95

 

Warning: strpos() expects parameter 1 to be string, array given in C:\server\xampp\htdocs\public_html\includes\modules\order_total\ot_shipping.php on line 57

 

Warning: substr() expects parameter 1 to be string, array given in C:\server\xampp\htdocs\public_html\includes\modules\order_total\ot_shipping.php on line 57

 

End echo

============================================

 

Thanks again for your patience and wisdom,

John

 

p.s. I mentioned PHP5.3 because the code works fine on the webhost using <5.3

Link to comment
Share on other sites

$module['id'] should give you the text string freeamount_freeamount (or something similar, depending on which shipping module is in use.) This value is being overwritten with a blank array somewhere above the point you added my printout code. You'll need to look through the code to find where that is happening. Insert that block of code anywhere you suspect something might be changing the value.

 

Regards

Jim

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

Link to comment
Share on other sites

$module['id'] should give you the text string freeamount_freeamount (or something similar, depending on which shipping module is in use.) This value is being overwritten with a blank array somewhere above the point you added my printout code. You'll need to look through the code to find where that is happening. Insert that block of code anywhere you suspect something might be changing the value.

 

Regards

Jim

 

Thanks for isolating the snafu. I've been so busy adding

code that I haven't had time to figure out what it means!

I'll get back with the results.

 

John

Link to comment
Share on other sites

Here is the status report, Captain.

 

Based on your advice to "You'll need to look through the code to find where that is happening. Insert that block of code anywhere you suspect something might be changing the value."

I started at what appears to be the beginning - checkout_shipping.php, where I found no occurrences of $module['id'], nor in checkout_confirmation.php. Next, I traced the sequence in checkout_shipping looking for what might be calling

function shipping($module = '') (in vendor_shipping.php) since that is where the module['id'] is referenced. Boing back to checkout_+shipping.php, I plugged that printout code at the end of the section:

 

if (SELECT_VENDOR_SHIPPING == 'true') {

 

$total_shipping_cost = 0;

$shipping_title = MULTIPLE_SHIP_METHODS_TITLE;

$vendor_shipping = $cart->vendor_shipping;

$shipping = array();

foreach ($vendor_shipping as $vendor_id => $vendor_data) {

$products_shipped = $_POST['products_' . $vendor_id];

$products_array = explode ("_", $products_shipped);

 

$shipping_data = $_POST['shipping_' . $vendor_id];

$shipping_array = explode ("_", $shipping_data);

$module = $shipping_array[0];

$method = $shipping_array[1];

$ship_tax = $shipping_array[2];

 

print ' in classes/checkout shipping php line 97 ' . "<br />\n";

print 'shipping: <pre>';

print_r ($shipping);

print '</pre>';

-------------------------

ECHO RESULT:

in classes/checkout shipping php line 97

shipping:

 

Array

(

)

----------------------------

 

The point is maybe the $module['id'] value, rather than overwritten is not ever being written and because prior to php5.3

Warnings were not being given to indicate this.

 

what makes troubleshooting this so tricky is identifying how/where the $module['id'] array is being populated and with what values.

1. What elements should be shown when the array is printed?

Array

(

[id] => Array

(

)

---------------

2. in checkout_shipping.php, is this where the above array is populated?

$shipping = array('id' => $shipping,

'title' => $shipping_title,

'cost' => $total_shipping_cost,

'shipping_tax_total' => $total_ship_tax,

'vendor' => $output

);

----------------------------

this particular line:

$shipping = array('id' => $shipping,

the second $shipping (=> $shipping )doesn't show any values using the printout code (modified) inserted at this point in checkout_shipping.php:

 

if (SELECT_VENDOR_SHIPPING == 'true') {

 

$total_shipping_cost = 0;

$shipping_title = MULTIPLE_SHIP_METHODS_TITLE;

$vendor_shipping = $cart->vendor_shipping;

$shipping = array();

foreach ($vendor_shipping as $vendor_id => $vendor_data) {

$products_shipped = $_POST['products_' . $vendor_id];

$products_array = explode ("_", $products_shipped);

 

$shipping_data = $_POST['shipping_' . $vendor_id];

$shipping_array = explode ("_", $shipping_data);

$module = $shipping_array[0];

$method = $shipping_array[1];

$ship_tax = $shipping_array[2];

 

print ' in classes/checkout shipping php line 97 ' . "<br />\n";

print 'shipping: <pre>';

print_r ($shipping);

print '</pre>';

 

-------------ECHO RESULTS:--------------

in classes/checkout shipping php line 97

shipping:

 

Array

(

)

 

---------END ECHO RESULTS:--------------

 

this is the only place $shipping is mentioned prior to:

$shipping = array('id' => $shipping,

so how is: $shipping = array('id' => $shipping,

supposed to work (when $shipping is empty?

 

2.It seems to be a javascript radiobutton technique, true? Could that be the source of the malfunction?

 

Sorry for being so long winded but I wanted to provide as much feedback and give you a sense of how I'm attempting to solve this.

Hope it is coherent.

 

John

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...