Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

Im getting a internal 500 error when I click on Vendors Order List from Admin:

 

In my Logs I have this:

 

 

 

[Mon Jan 07 04:49:39 2008] [error] [client 127.0.0.1] PHP Parse error: syntax error, unexpected $end in C:\\www\\Apache2.2\\htdocs\\catalog\\admin\\orders_by_vendor.php on line 234, referer: http://localhost:81/catalog/admin/vendors....ted_box=vendors

 

Whats wrong here?

Link to comment
Share on other sites

Hi folks, first of all i'm a brazilian and i'm sorry about my poor english...

 

All vendors of my shop will use the same way of delivery. How can i setting up MVS not to use the modules from vendors shipping?

 

 

---

 

Todos os vendedores da minha loja irão utilizar a mesma forma de entrega. Como posso configuro o MVS para que não utilize os módulos de vendedores?

Link to comment
Share on other sites

  • 2 weeks later...

Hello all,

 

I'm using MVS as my shipping system in my OSC.Im happy with this contribution.However,when I'm trying to add the third zone in a vendor, an error occured at the catalog side (delivery information)

 

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

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

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

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

 

 

 

If I only use 2 zones in the vendor,no error will show up.But I'm unable to use 3 zones.Please help me on this.

 

 

Thank you for reading and your valuable time.

Edited by Rezolles_Net
Link to comment
Share on other sites

My first post in MVS thread, so thank you for this contribution!

 

Installed and working fine on MySQL5/PHP4 register_globals=off, except the report pages display sql errors.

 

prods_by_vendor.php

1054 - Unknown column 'Array' in 'order clause'

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 products p, products_description pd where p.products_id = pd.products_id and p.vendors_id = 1 and pd.language_id = 1 order by Array

[TEP STOP]

orders_by_vendors.php

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array' at line 1

select distinct orders_id, vendor_order_sent from orders_shipping where vendors_id='' group by orders_id Array

Is this a MySQL5 problem?

 

Thanks,

EricK

Link to comment
Share on other sites

<snip>

If I only use 2 zones in the vendor,no error will show up.But I'm unable to use 3 zones.Please help me on this.

Thank you for reading and your valuable time.

Admin > Vendors > [select your Vendor and] Edit > Number of zones (Zones module) -- Set to the number of Zones you need. Default is 2.

 

Regards

Jim

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

Link to comment
Share on other sites

<snip>

Is this a MySQL5 problem?

 

Thanks,

EricK

It could have something to do with MySQL 5, but it's definitely a Register Globals problem. The variable $line is not properly defined. That is supposed to be passed as a $_GET (in the URL). If it's not being passed, or Register Globals is off, then it will pick up whatever global value is set elsewhere in the code, or possibly a system variable. It could be anything at all.

 

We need to make some changes to the top of both those files. Let me test some code and get back to you.

 

Regards

Jim

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

Link to comment
Share on other sites

Admin > Vendors > [select your Vendor and] Edit > Number of zones (Zones module) -- Set to the number of Zones you need. Default is 2.

 

Regards

Jim

 

 

Yup...I know...currently the zone was set to 2.However,if I set it to 3,the errors will show up. :'(

Link to comment
Share on other sites

Yup...I know...currently the zone was set to 2.However,if I set it to 3,the errors will show up. :'(

Drat. Well, so much for the easy answer. Do you have the third zone set up in the Admin?

 

Regards

Jim

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

Link to comment
Share on other sites

EricK:

 

In prods_by_vendor.php, comment out these lines (Lines 18 ff)

  $line2 = $line;
 if (!isset($line)) {
 $line = 'p.products_price';
 }
 if ($line == 'prod') {
 $line = 'pd.products_name';
 } elseif ($line == 'vpid'){
 $line = 'p.vendors_prod_id';
 } elseif ($line == 'pid'){
 $line = 'p.products_id';
 } elseif ($line == 'qty'){
 $line = 'p.products_quantity';
 } elseif ($line == 'vprice'){
 $line = 'p.vendors_product_price';
 } elseif ($line == 'price'){
 $line = 'p.products_price';
 }

and replace with the following code

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

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

I've verified that this code works, at least, but I can't tell if it will solve your problem. If it does, I'll do something similar to orders_by_vendor.php.

 

Regards

Jim

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

Link to comment
Share on other sites

EricK:

In prods_by_vendor.php, comment out these lines (Lines 18 ff)

- snip -

I've verified that this code works, at least, but I can't tell if it will solve your problem. If it does, I'll do something similar to orders_by_vendor.php.

Thanks Jim, I replaced the code in prods_by_vendor.php and when I select a vendor I still get the sql error

 

1054 - Unknown column 'Array' in 'order clause'

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 products p, products_description pd where p.products_id = pd.products_id and p.vendors_id = 1 and pd.language_id = 1 order by Array

[TEP STOP]

Regards,

EricK

Link to comment
Share on other sites

Rezolles_Net: OK, let's see if I can get it right this time. After changing the number of zones for the vendor you are using, you need to remove and reinstall the Zones module. Save your data for the first two zones first. Then edit and add the data back in, and add the data for the third zone. The additional zones should then work.

 

Eric_K: I think I need to do some more work on this. I probably need to get rid of the $line variable entirely, since it is conflicting with something else. Variable conflicts in a large codebase like this are a pain.

 

Regards

Jim

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

Link to comment
Share on other sites

Eric_K: I think I need to do some more work on this. I probably need to get rid of the $line variable entirely, since it is conflicting with something else. Variable conflicts in a large codebase like this are a pain.

If this is a register_globals=off issue can we define the needed variables in the file, something like this?

 

// BEGIN REGISTER_GLOBALS=OFF

$line = $_REQUEST['line'];

 

Don't know if this helps, but the stats_sales_report2.php works fine.

 

Thanks,

EricK

Link to comment
Share on other sites

If this is a register_globals=off issue can we define the needed variables in the file, something like this?

 

// BEGIN REGISTER_GLOBALS=OFF

$line = $_REQUEST['line'];

 

Don't know if this helps, but the stats_sales_report2.php works fine.

 

Thanks,

EricK

I tried that -- that long Switch in there should set $line in all cases. I don't understand why that is not working. Could you try something for me? Find this code

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

and add this just after the <?php

	print "<b>List array: </b>\n";
print '<pre>';
print_r ($line);  
print '</pre>';

Then run it and post what shows up after the List array: I want to see what's in that array. Maybe that will give a clue to where it is coming from.

 

Regards

Jim

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

Link to comment
Share on other sites

Rezolles_Net: OK, let's see if I can get it right this time. After changing the number of zones for the vendor you are using, you need to remove and reinstall the Zones module. Save your data for the first two zones first. Then edit and add the data back in, and add the data for the third zone. The additional zones should then work.

 

Regards

Jim

 

 

Thx Jim...its working now...Thx for the help :thumbsup:

Link to comment
Share on other sites

I use MVS for internal tracking between different stores only. For the customer it should behave as if it was one store.

 

Now the problem is I can do that by just setting "Enable Vendor Shipping" to 'false' in Admin->Config->Shipping/Packaging, however an order will then fail with

 

Warning: Invalid argument supplied for foreach() in /path/to/checkout_process.php on line 155

(which is the " foreach ($shipping_array as $vendors_id => $shipping_data) {" line)

 

This is due to the fact that there is no $shipping['vendor'] in that case in the previous line.

 

:'(

Link to comment
Share on other sites

About my previous posting (the one just above):

I have now enclosed the MVS-block containing the command I mentioned with a

if (SELECT_VENDOR_SHIPPING=='true'){ ... }

 

Now if I leave "Enable Vendor Shipping" at "false", it still records the vendors_id in the table "orders_products", which is good enough for me. (I actually need the multiple vendors without the shipping part for now ;) )

Edited by jmroth
Link to comment
Share on other sites

CODE

print "<b>List array: </b>\n";

print '<pre>';

print_r ($line);

print '</pre>';

 

Then run it and post what shows up after the List array: I want to see what's in that array. Maybe that will give a clue to where it is coming from.

 

Regards

Jim

Thanks Jim, this is what displays at the top:

 

List array:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/username/htdocs/backoffice_admin/prods_by_vendor.php:13) in /home/username/htdocs/backoffice_admin/includes/functions/sessions.php on line 100

 

Here is my lines 96-100 in admin/includes/functions/sessions.php

 

if ($sane_session_id == false) {

tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

}

 

return session_start();

 

Regards,

EricK

Link to comment
Share on other sites

<snip>

return session_start();

 

Regards,

EricK

Session is started in application_top.php, up at the top of the file. The code that I quoted is around line 170 in the body, just above the SQL that is showing the error. Are you certain that you put the code in the right place?

 

Regards

Jim

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

Link to comment
Share on other sites

Everything seems ok until checkout_shipping, Page is blank and no errors at all.

 

Heres my checkout_shipping, Please Help:

 

<?php

/*

$Id: checkout_shipping.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

require('includes/classes/http_client.php');

 

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

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

}

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}

 

// if no shipping destination address was selected, use the customers own address as default

if (!tep_session_is_registered('sendto')) {

tep_session_register('sendto');

$sendto = $customer_default_address_id;

} else {

// verify the selected shipping address

if ( (is_array($sendto) && empty($sendto)) || is_numeric($sendto) ) {

$check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");

$check_address = tep_db_fetch_array($check_address_query);

 

if ($check_address['total'] != '1') {

$sendto = $customer_default_address_id;

if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');

}

}

}

 

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

 

// register a random ID in the session to check throughout the checkout procedure

// against alterations in the shopping cart contents

if (!tep_session_is_registered('cartID')) tep_session_register('cartID');

$cartID = $cart->cartID;

 

// if the order contains only virtual products, forward the customer to the billing page as

// a shipping address is not needed

if ($order->content_type == 'virtual') {

if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

$shipping = false;

$sendto = false;

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

}

 

//$total_weight = $cart->show_weight();

// $total_count = $cart->count_contents();

 

// load all enabled shipping modules

// require(DIR_WS_CLASSES . 'shipping.php');

// $shipping_modules = new shipping;

 

// if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {

// $pass = false;

 

// switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {

// case 'national':

// if ($order->delivery['country_id'] == STORE_COUNTRY) {

// $pass = true;

// }

// break;

// case 'international':

// if ($order->delivery['country_id'] != STORE_COUNTRY) {

// $pass = true;

// }

// break;

// case 'both':

// $pass = true;

// break;

// }

 

// $free_shipping = false;

// if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {

// $free_shipping = true;

 

// include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');

// }

//} else {

// $free_shipping = false;

//}

 

// process the selected shipping method

// if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {

// if (!tep_session_is_registered('comments')) tep_session_register('comments');

// if (tep_not_null($HTTP_POST_VARS['comments'])) {

// $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

// }

 

// if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

 

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

// $shipping = false;

 

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

// }

//}

//MVS

if (SELECT_VENDOR_SHIPPING == 'true') {

include(DIR_WS_CLASSES . 'vendor_shipping.php');

$shipping_modules = new shipping;

} else {

include(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping;

$total_weight = $cart->show_weight();

$cost = $cart->show_total();

$total_count = $cart->count_contents();

}

 

// process the selected shipping method

if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {

if (!tep_session_is_registered('comments')) tep_session_register('comments');

if (tep_not_null($HTTP_POST_VARS['comments'])) {

$comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

}

 

if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

 

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

 

if ( is_object($$module) || ($module == 'free') ) {

if ($module == 'free') {

$quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;

$quote[0]['methods'][0]['cost'] = '0';

} else {

$total_weight = $vendor_shipping[$vendor_id]['weight'];

$shipping_weight = $total_weight;

$cost = $vendor_shipping[$vendor_id]['cost'];

$total_count = $vendor_shipping[$vendor_id]['qty'];

$quote = $shipping_modules->quote($method, $module, $vendor_id);

 

}

if (isset($quote['error'])) {

tep_session_unregister('shipping');

} else {

if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {

$output[$vendor_id] = array('id' => $module . '_' . $method,

'title' => $quote[0]['methods'][0]['title'],

'ship_tax' => $ship_tax,

'products' => $products_array,

'cost' => $quote[0]['methods'][0]['cost']

);

$total_ship_tax += $ship_tax;

$total_shipping_cost += $quote[0]['methods'][0]['cost'];

}//if isset

}//if isset

}//if is_object

}//foreach

if ($free_shipping == true) {

$shipping_title = $quote[0]['module'];

} elseif (count($output) <2) {

$shipping_title = $quote[0]['methods'][0]['title'];

}

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

'title' => $shipping_title,

'cost' => $total_shipping_cost,

'shipping_tax_total' => $total_ship_tax,

'vendor' => $output

);

 

} else {

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');

}

}

tep_redirect(tep_href_link('checkout_payment.php', '', 'SSL'));

exit;

} //MVS END

// get all available shipping quotes

$quotes = $shipping_modules->quote();

 

// if no shipping method has been selected, automatically select the cheapest method.

// if the modules status was changed when none were available, to save on implementing

// a javascript force-selection method, also automatically select the cheapest shipping

// method if more than one module is now enabled

if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();

 

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

 

$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

?>

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

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

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

<script language="javascript"><!--

var selected;

 

function selectRowEffect(object, buttonSelect) {

if (!selected) {

if (document.getElementById) {

selected = document.getElementById('defaultSelected');

} else {

selected = document.all['defaultSelected'];

}

}

 

if (selected) selected.className = 'moduleRow';

object.className = 'moduleRowSelected';

selected = object;

 

// one button is not an array

if (document.checkout_address.shipping[0]) {

document.checkout_address.shipping[buttonSelect].checked=true;

} else {

document.checkout_address.shipping.checked=true;

}

}

 

function rowOverEffect(object) {

if (object.className == 'moduleRow') object.className = 'moduleRowOver';

}

 

function rowOutEffect(object) {

if (object.className == 'moduleRowOver') object.className = 'moduleRow';

}

//--></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

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

<!-- header_eof //-->

 

<!-- body //-->

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

<tr>

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

<!-- left_navigation //-->

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

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<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_image(DIR_WS_IMAGES . 'table_background_delivery.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

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

<tr>

<td class="main"><b><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

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

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_DESTINATION . '<br><br><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td>

<td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main" align="center" valign="top"><?php echo '<b>' . TITLE_SHIPPING_ADDRESS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" valign="top"><?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br>'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

// if (tep_count_shipping_modules() > 0) {

//?>

// <tr>

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

// <tr>

// <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></b></td>

// </tr>

// </table></td>

//</tr>

//<tr>

// <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

// <tr class="infoBoxContents">

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

//<?php

// if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) {

//?>

// <tr>

// <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// <td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?></td>

// <td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>

// <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// </tr>

//<?php

//} elseif ($free_shipping == false) {

//?>

// <tr>

// <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?></td>

// <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// </tr>

//<?php

// }

 

//if ($free_shipping == true) {

//?>

// <tr>

// <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

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

// <tr>

// <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// <td class="main" colspan="3"><b><?php echo FREE_SHIPPING_TITLE; ?></b> <?php echo $quotes[$i]['icon']; ?></td>

// <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// </tr>

// <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)">

// <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// <td class="main" width="100%"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>

// <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// </tr>

// </table></td>

// <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// </tr>

//<?php

//} else {

// $radio_buttons = 0;

// for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {

//?>

// <tr>

// <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

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

// <tr>

// <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// <td class="main" colspan="3"><b><?php echo $quotes[$i]['module']; ?></b> <?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td>

// <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// </tr>

//<?php

// if (isset($quotes[$i]['error'])) {

//?>

//<tr>

// <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// <td class="main" colspan="3"><?php echo $quotes[$i]['error']; ?></td>

// <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// </tr>

//<?php

// } else {

// for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {

// set the radio button to be checked if it is the method chosen

// $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);

 

// if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {

// echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

// } else {

// echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

// }

//?>

// <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

// <td class="main" width="75%"><?php echo $quotes[$i]['methods'][$j]['title']; ?></td>

//<?php

//if ( ($n > 1) || ($n2 > 1) ) {

//?>

// <td class="main"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>

// <td class="main" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td>

//<?php

// } else {

//?>

//<td class="main" align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>

//<?php

//}

//?>

// <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

//</tr>

//<?php

// $radio_buttons++;

// }

// }

//?>

//</table></td>

//<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

//</tr>

//<?php

//}

// }

//?>

// </table></td>

// </tr>

// </table></td>

// </tr>

// <tr>

// <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

//</tr>

//<?php

// }

//MVS

if (SELECT_VENDOR_SHIPPING == 'true') {

require(DIR_WS_MODULES . 'vendor_shipping.php');

} else {

$quotes = $shipping_modules->quote();

 

if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {

$pass = false;

 

switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {

case 'national':

if ($order->delivery['country_id'] == STORE_COUNTRY) {

$pass = true;

}

break;

case 'international':

if ($order->delivery['country_id'] != STORE_COUNTRY) {

$pass = true;

}

break;

case 'both':

$pass = true;

break;

}

 

$free_shipping = false;

if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {

$free_shipping = true;

 

include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');

}

} else {

$free_shipping = false;

}

 

// if no shipping method has been selected, automatically select the cheapest method.

// if the modules status was changed when none were available, to save on implementing

// a javascript force-selection method, also automatically select the cheapest shipping

// method if more than one module is now enabled

if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();

//MVS End

?>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

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

<?php

if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?></td>

<td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

} elseif ($free_shipping == false) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

}

 

if ($free_shipping == true) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

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

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" colspan="3"><b><?php echo FREE_SHIPPING_TITLE; ?></b> <?php echo $quotes[$i]['icon']; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)">

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="100%"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

} else {

$radio_buttons = 0;

for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

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

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" colspan="3"><b><?php echo $quotes[$i]['module']; ?></b> <?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

if (isset($quotes[$i]['error'])) {

?>

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" colspan="3"><?php echo $quotes[$i]['error']; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

} else {

for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {

// set the radio button to be checked if it is the method chosen

$checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);

 

if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {

echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

} else {

echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

}

?>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="75%"><?php echo $quotes[$i]['methods'][$j]['title']; ?></td>

<?php

if ( ($n > 1) || ($n2 > 1) ) {

?>

<td class="main"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>

<td class="main" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td>

<?php

} else {

?>

<td class="main" align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>

<?php

}

?>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

$radio_buttons++;

}

}

?>

</table></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

}

}

?>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

} //MVS end

?>

<tr>

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

<tr>

<td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

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

<tr>

<td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

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

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>

<td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

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

<tr>

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

<tr>

<td width="50%" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

</tr>

</table></td>

<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

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

<tr>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>

<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>

<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>

<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>

</tr>

</table></td>

</tr>

</table></form></td>

<!-- body_text_eof //-->

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

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

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

<!-- footer_eof //-->

<br>

</body>

</html>

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

Link to comment
Share on other sites

Hi

 

I m installing this contrib... It seems to work... But I can't add my own shipping modules... Here's the error message:

 

Fatal error: Call to undefined function: sort_order() in c:\program files\easyphp1-8\www\remorques-online\admin\vendor_modules.php on line 182

 

It appears when i add my modified zones.php

 

This code seems to be a problem:

 

	function zones() {
  $this->code = 'zones';
  $this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;
  $this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;
  $this->sort_order = MODULE_SHIPPING_ZONES_SORT_ORDER;
  $this->icon = '';
  $this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;
  $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);

  // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
  $this->num_zones = 50;
}

 

I tried to set the code like that:

 

  function sort_order($vendors_id='1')
			   { $sort_order = 'MODULE_SHIPPING_ZONES_SORT_ORDER_' . $vendors_id;
				 if (defined($sort_order))
					 { $this->sort_order = constant($sort_order);
					}
				 else
					 { $this->sort_order = '-';
					}
				 return $this->sort_order;
			   }

 

But it doesn't work...

 

It's the same with my other modified shipping files.

Link to comment
Share on other sites

Session is started in application_top.php, up at the top of the file. The code that I quoted is around line 170 in the body, just above the SQL that is showing the error. Are you certain that you put the code in the right place?

 

Regards

Jim

Opps, I put it at the top of prods_by_vendor, in the correct location about line 180 returns this:

 

List array:

 

Array

(

[qty] => 0

)

 

Thanks,

Eric

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