Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

Hi,

 

Problems cosolidation after instalation.

 

osCommerce Online Merchant v2.2 Release Candidate 1 installed plus MVS 1.1 installed

 

So.... osCommerce works fine without this module with about 7 shipping modles installed.

 

 

Some ideas and questions about fixes and bugs:

 

1. Even if Configuration "Enable Vendor Shipping" setting FALSE we should have to possiblity to use our shop with already standart shipping module installed. Just we have only ONE vendor with vendors_id=1 , like just how it explained in REEDME file here : What this Contribution Does: There is also a configuration setting to turn this whole Contribution off if it is no longer needed. In Admin->Configuration->Shipping/Packaging.

 

But the problem comes exactly from this part of code on checkout_process.php when "Enable Vendor Shipping" setting FALSE:

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

//MVS - added insert for new orders_shipping table

 

$shipping_array = $shipping['vendor'];

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

$vendors_query = tep_db_query("select vendors_name

from " . TABLE_VENDORS . "

where vendors_id = '" . (int)$vendors_id . "'"

);

$vendors_name = 'Unknown';

if ($vendors = tep_db_fetch_array($vendors_query)) {

$vendors_name = $vendors['vendors_name'];

}

$shipping_method_array = explode ('_', $shipping_data['id']);

if ($shipping_method_array[0] == 'fedex1') {

$shipping_method = 'Federal Express';

} elseif ($shipping_method_array[0] == 'upsxml') {

$shipping_method = 'UPS';

} elseif ($shipping_method_array[0] == 'usps') {

$shipping_method = 'USPS';

} else {

$shipping_method = $shipping_method_array[0];

}

$sql_data_array = array('orders_id' => $insert_id,

'vendors_id' => $vendors_id,

'shipping_module' => $shipping_method,

'shipping_method' => $shipping_data['title'],

'shipping_cost' => $shipping_data['cost'],

'shipping_tax' => $shipping_data['ship_tax'],

'vendors_name' => $vendors_name,

'vendor_order_sent' => 'no'

);

tep_db_perform(TABLE_ORDERS_SHIPPING, $sql_data_array);

}

//MVS End-------------------------------

 

Error: Warning: Invalid argument supplied for foreach() ........

But email was sent to customer and in TABLE_ORDERS_SHIPPING there is the records But vendors_id "0" , should be "1".

Without this part of code verything works ok.

 

2. Finally I created 2 vendors and installed 1 shipping module (ZONES) for each vendor, and created 1 products for each vendor.

 

Problem is that when I buy these products, in TABLE_ORDERS_SHIPPING code registred vendors_id "0" , that is why on account_history_info.php Client can not find details about the product...... missed info about Products Model Tax Price (ex) Total (inc) ...... When i corrected this vendors_id number in datebase it works.....

 

One more time problem come from checkout_process.php...

 

What i did ......

I replaced this: 'vendors_id' => $order->products[$i]['vendors_id'] like that

 

// Update products_ordered (for bestsellers list)

tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

 

$sql_data_array = array('orders_id' => $insert_id,

'products_id' => tep_get_prid($order->products[$i]['id']),

'products_model' => $order->products[$i]['model'],

'products_name' => $order->products[$i]['name'],

'products_price' => $order->products[$i]['price'],

'final_price' => $order->products[$i]['final_price'],

'products_tax' => $order->products[$i]['tax'],

'products_quantity' => $order->products[$i]['qty'],

//MVS start

 

//'vendors_id' => $order->products[$i]['vendors_id']

'vendors_id' => $vendors_id

 

); //MVS end

tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

$order_products_id = tep_db_insert_id();

 

 

But it records in TABLE_ORDERS_SHIPPING last vendors_id products for each products.......

 

Unfortunatelly I am not very strong in php codding ......

 

So would be grate if Craig could help us......... Thnks in advance......

Share this post


Link to post
Share on other sites

Okay, finally is up and running...

 

 

What to do if I would like to add multiple Zone Rates per vendor so that I can have some several shipping options per that vendor's product. I like the Zone Rates since I can adjust manually the rates in it...

 

 

thanks,

Gabstero

Share this post


Link to post
Share on other sites

Taking a stab at responding to my own question above:

 

Would creating a copy of the "includes/modules/vendors_shipping/zones.php" to something like "zones_2.php" work? This way I can add several zone tables options to a single product (reflecting the carrier's charges, etc.)...

 

Anyone??????

 

Gabstero

Share this post


Link to post
Share on other sites
Taking a stab at responding to my own question above:

 

Would creating a copy of the "includes/modules/vendors_shipping/zones.php" to something like "zones_2.php" work? This way I can add several zone tables options to a single product (reflecting the carrier's charges, etc.)...

 

Anyone??????

 

Gabstero

That will work if you change the appropriate constants as well. Any constant that has a $vendors_id attached to it will need to be renamed. You'll also need to change the value of $this->code to reflect the new file name.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Jim!!!

 

Fantastic! Thanks a lot for your reply!!! Are you talking about only changing those constants in the zones.php? Would you mind giving me an example of a constant that needs to be changed? I searched for "$vendors_id" in the zones.php and all I could find were instances of it but not attached to any constants.

Also - no need to change anything in the DB structure? I have limited php coding capabilities but I can find my way around.

 

GREATLY appreciated!!!!!

 

Gabstero

Share this post


Link to post
Share on other sites

BUG.......

 

How to fix delete order information in orders_shipping table ......? when click on delete order button on order.php page in admin

 

here the code which shows the buttons, I can not understand where is placed the code for deleting from date base !?

 

switch ($action) {

case 'delete':

$heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_ORDER . '');

 

$contents = array('form' => tep_draw_form('orders', FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm'));

$contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '');

$contents[] = array('text' => '' . tep_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);

$contents[] = array('align' => 'center', 'text' => '' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' orders_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');

break;

 

Tanks......

Share this post


Link to post
Share on other sites

Hi Folks!

 

I am going to move this MVS related subtopic here from my private messaging so everyone can benefit.

 

The main idea is to have multiple Zone Tables so one can add multiple carrier's rate tables for one vendor. Jim (kymation) helped me (THANKS JIM!) out to get me started in renaming the constants attached to "$vendor_id" and renamed the class and class constructor names, in my two files I duplicated namely from their respective "zone.php" files:

 

1. includes/modules/vendors_shipping/zonesTNT.php:

 

<?php
/*
 $Id: zones.php,v 1.20 2003/06/15 19:48:09 thomasamoulton Exp $
 Modified for MVS V1.0 2006/03/25 JCK/CWG
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2006 osCommerce

 Released under the GNU General Public License

 USAGE
 By default, the module comes with support for 1 zone.  This can be
 easily changed by changing the value for Zones in the Vendors admin panel.

 Next, you will want to activate the module by going to the Admin screen,
 clicking on Modules, then clicking on Shipping.  A list of all shipping
 modules should appear.  Click on the green dot next to the one labeled
 zones.php.  A list of settings will appear to the right.  Click on the
 Edit button.

 PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER
 SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a
 backup of your shipping settings somewhere at all times.

 If you want an additional handling charge applied to orders that use this
 method, set the Handling Fee field.

 Next, you will need to define which countries are in each zone.  Determining
 this might take some time and effort.  You should group a set of countries
 that has similar shipping charges for the same weight.  For instance, when
 shipping from the US, the countries of Japan, Australia, New Zealand, and
 Singapore have similar shipping rates.  As an example, one of my customers
 is using this set of zones:
1: USA
2: Canada
3: Austria, Belgium, Great Britain, France, Germany, Greenland, Iceland,
   Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain,
   Sweden, Switzerland, Finland, Portugal, Israel, Greece
4: Japan, Australia, New Zealand, Singapore
5: Taiwan, China, Hong Kong

 When you enter these country lists, enter them into the Zone X Countries
 fields, where "X" is the number of the zone.  They should be entered as
 two character ISO country codes in all capital letters.  They should be
 separated by commas with no spaces or other punctuation. For example:
1: US
2: CA
3: AT,BE,GB,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR
4: JP,AU,NZ,SG
5: TW,CN,HK

 Now you need to set up the shipping rate tables for each zone.  Again,
 some time and effort will go into setting the appropriate rates.  You
 will define a set of weight ranges and the shipping price for each
 range.  For instance, you might want an order than weighs more than 0
 and less than or equal to 3 to cost 5.50 to ship to a certain zone.
 This would be defined by this:  3:5.5

 You should combine a bunch of these rates together in a comma delimited
 list and enter them into the "Zone X Shipping Table" fields where "X"
 is the zone number.  For example, this might be used for Zone 1:
1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
12:19.1,13:20.55,14:22,15:23.45

 The above example includes weights over 0 and up to 15.  Note that
 units are not specified in this explanation since they should be
 specific to your locale.

 CAVEATS
 At this time, it does not deal with weights that are above the highest amount
 defined.  This will probably be the next area to be improved with the
 module.  For now, you could have one last very high range with a very
 high shipping rate to discourage orders of that magnitude.  For
 instance:  999:1000

 If you want to be able to ship to any country in the world, you will
 need to enter every country code into the Country fields. For most
 shops, you will not want to enter every country.  This is often
 because of too much fraud from certain places. If a country is not
 listed, then the module will add a $0.00 shipping charge and will
 indicate that shipping is not available to that destination.
 PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!

 It appears that the osC shipping system automatically rounds the
 shipping weight up to the nearest whole unit.  This makes it more
 difficult to design precise shipping tables.  If you want to, you
 can hack the shipping.php file to get rid of the rounding.

 Lastly, there is a limit of 255 characters on each of the Zone
 Shipping Tables and Zone Countries.

*/

 class zonesTNT {
var $code, $title, $description, $enabled, $num_zones, $vendors_id; //multi vendor

// class constructor
function zonesTNT() {
//MVS
  $this->vendors_id = ($products['vendors_id'] <= 0) ? 1 : $products['vendors_id'];
  $this->code = 'zonesTNT';
  $this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;
  $this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;
  $this->icon = '';
}

//MVS Start
			function sort_order($vendors_id='1') {
 $sort_order = @constant ('MODULE_SHIPPING_ZONES_TNT_SORT_ORDER_' . $vendors_id);
   if (isset ($sort_order)) {
   $this->sort_order = $sort_order;
  } else {
	$this->sort_order = '-';
  }
					return $this->sort_order;
}

			function tax_class($vendors_id='1') {
  $this->tax_class = constant('MODULE_SHIPPING_ZONES_TNT_TAX_CLASS_' . $vendors_id);
					return $this->tax_class;
}

			function enabled($vendors_id='1') {
  $this->enabled = false;
  $status = @constant('MODULE_SHIPPING_ZONES_TNT_STATUS_' . $vendors_id);
					if (isset ($status) && $status != '') {
	$this->enabled = (($status == 'True') ? true : false);
  }
  return $this->enabled;
}

//Set the number of zones used for this vendor
			function num_zones($vendors_id='1') {
  $vendors_data_query = tep_db_query("select zones
									  from " . TABLE_VENDORS . "
									  where vendors_id = '" . (int)$vendors_id . "'"
									);
  $vendors_data = tep_db_fetch_array($vendors_data_query);
  $this->num_zones = $vendors_data['zones'];
					return $this->num_zones;
}
//MVS End

//Get a quote
function quote($method = '', $module = '', $vendors_id = '1') {
  global $HTTP_POST_VARS, $shipping_weight, $order, $cart, $shipping_num_boxes;
//MVS Start
//return an error if the module is not enabled for this vendor
  if ($this->enabled($vendors_id) < 1) {
	$this->quotes['error'] = MODULE_SHIPPING_ZONES_INVALID_ZONE;
	return $this->quotes;
  }
//MVS End

  $dest_country = $order->delivery['country']['iso_code_2'];
  $dest_zone = 0;
  $error = false;

  for ($i=1; $i<=$this->num_zones($vendors_id); $i++) {
	$countries_table = constant('MODULE_SHIPPING_ZONES_TNT_COUNTRIES_' . $vendors_id . '_' . $i);
	$country_zones = split("[,]", $countries_table);
	if (in_array($dest_country, $country_zones)) {
	  $dest_zone = $i;
	  break;
	}
  }

  if ($dest_zone == 0) {
	$error = true;
  } else {
	$shipping = -1;
	$zones_cost = constant('MODULE_SHIPPING_ZONES_TNT_COST_' . $vendors_id . '_' . $dest_zone);

	$zones_table = split("[:,]" , $zones_cost);
	$size = sizeof($zones_table);
	for ($i=0; $i<$size; $i+=2) {
	  if ($shipping_weight <= $zones_table[$i]) {
		$shipping = $zones_table[$i+1];
		$shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS;
		break;
	  }
	}

	if ($shipping == -1) {
	  $shipping_cost = 0;
	  $shipping_method = MODULE_SHIPPING_ZONES_UNDEFINED_RATE;
	} else {
//MVS Start
	  $vendors_data_query = tep_db_query("select handling_charge,
												 handling_per_box
										  from " . TABLE_VENDORS . "
										  where vendors_id = '" . (int)$vendors_id . "'"
										);
	  $vendors_data = tep_db_fetch_array($vendors_data_query);

	  //Set handling to the handling per box times number of boxes, or handling charge if it is larger
	  $handling_charge = $vendors_data['handling_charge'];
	  $handling_per_box = $vendors_data['handling_per_box'];
	  if ($handling_charge > $handling_per_box*$shipping_num_boxes) {
		$handling = $handling_charge;
	  } else {
		$handling = $handling_per_box*$shipping_num_boxes;
	  }

	  //Set handling to the module's handling charge if it is larger
	  $module_handling = constant('MODULE_SHIPPING_ZONES_TNT_HANDLING_' . $vendors_id . '_' . $dest_zone);
	  if ($module_handling > $handling) {
		$handling = $module_handling;
	  }
	  $shipping_cost = ($shipping * $shipping_num_boxes) + $handling;
//MVS End
	}
  }

  $this->quotes = array('id' => $this->code,
						'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
						'methods' => array(array('id' => $this->code,
												 'title' => $shipping_method,
												 'cost' => $shipping_cost)));
// $this->tax_class = constant(MODULE_SHIPPING_ZONES_TNT_TAX_CLASS_ . $vendors_id);
  if ($this->tax_class($vendors_id) > 0) {
	   $this->quotes['tax'] = tep_get_tax_rate($this->tax_class($vendors_id), $order->delivery['country']['id'], $order->delivery['zone_id']);
  }
  if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

  if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_ZONES_INVALID_ZONE;

  return $this->quotes;
}

function check($vendors_id='1') {
  if (!isset($this->_check)) {
  //multi vendor add  "vendors_id = '". $vendors_id ."' and"
	$check_query = tep_db_query("select configuration_value from " . TABLE_VENDOR_CONFIGURATION . " where vendors_id = '". $vendors_id ."' and configuration_key = 'MODULE_SHIPPING_ZONES_TNT_STATUS_" . $vendors_id . "'");
	$this->_check = tep_db_num_rows($check_query);
  }
  return $this->_check;
}

//MVS start
function install($vendors_id='1') {
		$vID = $vendors_id;
		//multi vendor add 'vendors_id' to field names and '" . $vID . "', to values
  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('" . $vendors_id . "', 'Enable Zones Method', 'MODULE_SHIPPING_ZONES_TNT_STATUS_" . $vendors_id . "', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('" . $vendors_id . "', 'Tax Class', 'MODULE_SHIPPING_ZONES_TNT_TAX_CLASS_" . $vendors_id . "', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . $vendors_id . "', 'Sort Order', 'MODULE_SHIPPING_ZONES_TNT_SORT_ORDER_" . $vendors_id . "', '0', 'Sort order of display.', '6', '0', now())");
  for ($i = 1; $i <= $this->num_zones($vendors_id); $i++) {
	$default_countries = '';
	if ($i == 1) {
	  $default_countries = 'US,CA';
	}
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . $vendors_id . "', 'Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_TNT_COUNTRIES_" . $vendors_id . "_" . $i . "', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . $vendors_id . "', 'Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_TNT_COST_" . $vendors_id . "_" . $i . "', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . $vendors_id . "', 'Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_ZONES_TNT_HANDLING_" . $vendors_id . "_" . $i . "', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
  }
}

function remove($vendors_id) {
  tep_db_query("delete from " . TABLE_VENDOR_CONFIGURATION . " where vendors_id = '". $vendors_id ."' and configuration_key in ('" . implode("', '", $this->keys($vendors_id)) . "')");
}

function keys($vendors_id) {
  $keys = array('MODULE_SHIPPING_ZONES_TNT_STATUS_' . $vendors_id, 'MODULE_SHIPPING_ZONES_TNT_TAX_CLASS_' . $vendors_id, 'MODULE_SHIPPING_ZONES_TNT_SORT_ORDER_' . $vendors_id);

  for ($i=1; $i<=$this->num_zones($vendors_id); $i++) {
	$keys[] = 'MODULE_SHIPPING_ZONES_TNT_COUNTRIES_' . $vendors_id . '_' . $i;
	$keys[] = 'MODULE_SHIPPING_ZONES_TNT_COST_' . $vendors_id . '_' . $i;
	$keys[] = 'MODULE_SHIPPING_ZONES_TNT_HANDLING_' . $vendors_id . '_' . $i;
  }
//MVS End

  return $keys;
}
 }
?>

 

 

2. includes/languages/english/modules/vendors_shipping/zonesTNT.php:

 

<?php
/*
 $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $

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

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

define('MODULE_SHIPPING_ZONES_TEXT_TITLE', 'Zone Rates TNT');
define('MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION', 'Zone Based Rates for TNT');
define('MODULE_SHIPPING_ZONES_TEXT_WAY', 'Shipping to');
define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'lb(s)');
define('MODULE_SHIPPING_ZONES_INVALID_ZONE', 'No shipping available to the selected country');
define('MODULE_SHIPPING_ZONES_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
?>

 

 

But now I am getting this following error:

 

Fatal error: Call to undefined method zonesTNT::zones() in /home/gabkitsc/public_html/catalogplay/admin/vendor_modules.php on line 143

 

Any idea where to go from here?

 

thanks,

Gabstero

Share this post


Link to post
Share on other sites
BUG.......

 

How to fix delete order information in orders_shipping table ......? when click on delete order button on order.php page in admin

 

here the code which shows the buttons, I can not understand where is placed the code for deleting from date base !?

<snip>

Tanks......

The code that performs the work is under the 'deleteconfirm' action, just below the code you quoted. It uses tep_remove_order() in catalog/includes/functions/general.php to delete the order, including everything from the orders_shipping table.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
<code snipped>

But now I am getting this following error:

 

Fatal error: Call to undefined method zonesTNT::zones() in /home/gabkitsc/public_html/catalogplay/admin/vendor_modules.php on line 143

 

Any idea where to go from here?

 

thanks,

Gabstero

This appears to be a naming convention problem. All of the modules have a zones option to restrict them to a particular zone. The zones module doesn't, because that's the purpose of the whole module. Apparently we got away with this due to this naming fluke. That fluke of naming no longer applies now that you've renamed the class. So it goes.

 

This is actually a nasty bug that we should fix in some future release. For now, let's see if we can fake it. Try adding the following code:

		
function zones ($vendors_id='1') {
  // Do nothing
  return true;
}//function

You can put that just after the first //MVS Start line (before the function sort_order). I haven't tested this, so there may be other consequences that I haven't thought about yet. Please post if there are further problems.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Jim!!!

 

THanks a lot it actually WORKED!!!! The only thing is that the different Zone naming is not reflected in the Admin->Vendor manage and on the shipping options on a checkout cart (as defined in my includes/languages/english/modules/vendors_shipping/zonesTNT.php) - see image captions below:

 

1. Admin:

multizones_admin.gif

 

2. Catalog checkout:

 

multizones_catalog.gif

 

 

thanks a ton!

Gabstero

Share this post


Link to post
Share on other sites

Hi. I'm trying to get my arms around this contribution, and something in the instructions is confusing me.

 

I have a client who does 100% drop shipping. His vendors are international, and it's possible that a given vendor might ship with one shipper or another depending on the item, or even depending on the location of the warehouse that the item will come from.

 

The instructions first say that if a vendor uses a different method for some products, create a different vendor.

 

But, the next instruction talks about installing multiple shipping methods under one vendor...completely the opposite for apparently the same issue.

 

Can you explain when I would do one versus the other?

Share this post


Link to post
Share on other sites
Jim!!!

 

THanks a lot it actually WORKED!!!! The only thing is that the different Zone naming is not reflected in the Admin->Vendor manage and on the shipping options on a checkout cart (as defined in my includes/languages/english/modules/vendors_shipping/zonesTNT.php) - see image captions below:

 

<images snipped>

thanks a ton!

Gabstero

You can change the names in the language files: catalog/includes/languages/english/modules/vendors_shipping/zones.php for the original. You need to change the constant MODULE_SHIPPING_ZONES_TEXT_TITLE in the one you modified, if you haven't already, or they will both have the same name.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
Hi. I'm trying to get my arms around this contribution, and something in the instructions is confusing me.

 

I have a client who does 100% drop shipping. His vendors are international, and it's possible that a given vendor might ship with one shipper or another depending on the item, or even depending on the location of the warehouse that the item will come from.

 

The instructions first say that if a vendor uses a different method for some products, create a different vendor.

 

But, the next instruction talks about installing multiple shipping methods under one vendor...completely the opposite for apparently the same issue.

 

Can you explain when I would do one versus the other?

They are actually different circumstances. In the first case, you would create a vendor for each group of products that you need to have separate shipping for, i.e. one vendor for each warehouse. In the second case, you assign shipping methods to each "vendor" that you have set up, i.e. one of your warehouses may offer the choice of shipping UPS or Fedex. The first is the restriction based on a particular group of products, and the second sets the customer's choices for the group created by the first.

 

I hope this hasn't just confused you more.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
They are actually different circumstances. In the first case, you would create a vendor for each group of products that you need to have separate shipping for, i.e. one vendor for each warehouse. In the second case, you assign shipping methods to each "vendor" that you have set up, i.e. one of your warehouses may offer the choice of shipping UPS or Fedex. The first is the restriction based on a particular group of products, and the second sets the customer's choices for the group created by the first.

 

I hope this hasn't just confused you more.

 

Regards

Jim

 

But what is it that requires the separate vendor...what's the decision point...is it that the vendor is used to isolate which shippers are available for a given product, or is it when the shipping origin differs...or both?

Share this post


Link to post
Share on other sites

Jim: THANKS A LOT! That was it!!!

 

Jeff: Think of it this way:

 

One vendor has for example two wear-houses:

- one that has smaller items, maybe retail sales, etc. and ships with USPS.

- one for heavy items sales that usually ships with some sort of freight for example FedEx Freight

When a customer has for example a big item in the cart, you would usually want (in this example) the FedEx Freight shipping charge displayed for that particular item (or group of items in that heavy class). Same thing for the smaller items - you want the USPS ship charges displayed in the cart. You do not want the USPS shipping charges to be applied to the big items because they would probably charge you an arm and a leg.

So this is where you decide what items (or items) will group under what vendor...

For this, you set up two separate vendors (they actually are referring to the same physical vendor), with their respective names, for example "Vendor - USPS" and "Vendor - FedEx Freight" and assign for each of those their respective shipping option (from the Vendors-->Manage)etc.

Once you have this down and when you are entering the actual product, all you have to do is assign the appropriate vendor to it ...

 

Hope this makes any sense...

 

Gabstero

Edited by gabstero

Share this post


Link to post
Share on other sites

Jim,

 

Another phenomenon when adding more than 3 in the "Number of zones (Zones module)field (Needed for the Zones module)" field in the vendor editor... I seem to be getting the right amount of fields in each of my extra Zone Table shipping thing, a set of three fields for each Zone:

 

- one for Zone x Countries

- one for Zone x Shipping Table

- one for Zone x Handling Fee

 

But not the explanatory text as I have for the previous three. See screen shot:

 

zones_emptyfields.gif

 

After looking in the zones.php module in my shipping_vendor folder I see that the first three set of them are hard-coded. I am suspecting that I need to do that for each of the added number of zones beyond 3... Am I right?

 

thanks!!!

Gabstero

Edited by gabstero

Share this post


Link to post
Share on other sites
Jim: THANKS A LOT! That was it!!!

 

Jeff: Think of it this way:

 

One vendor has for example two wear-houses:

- one that has smaller items, maybe retail sales, etc. and ships with USPS.

- one for heavy items sales that usually ships with some sort of freight for example FedEx Freight

When a customer has for example a big item in the cart, you would usually want (in this example) the FedEx Freight shipping charge displayed for that particular item (or group of items in that heavy class). Same thing for the smaller items - you want the USPS ship charges displayed in the cart. You do not want the USPS shipping charges to be applied to the big items because they would probably charge you an arm and a leg.

So this is where you decide what items (or items) will group under what vendor...

For this, you set up two separate vendors (they actually are referring to the same physical vendor), with their respective names, for example "Vendor - USPS" and "Vendor - FedEx Freight" and assign for each of those their respective shipping option (from the Vendors-->Manage)etc.

Once you have this down and when you are entering the actual product, all you have to do is assign the appropriate vendor to it ...

 

Hope this makes any sense...

 

Gabstero

Thanks Jim and Gabstero, it's clear now. The next thing I'm sure I'll be back for is getting Royal Mail and Sweden Post and Desutsche Post to work with it :-)

Share this post


Link to post
Share on other sites

Let me start with a thanks to everyone who has contributed to the MVS development. I've been using it successfully for quite a while. I want to incorporate MVS in my new site. Will MVS 1.1 function appropriately on an osCommerce 2.2RC1 site with STS 4.5.8 and HTC 2.6.3 contributions already installed?


"Artificial intelligence is no match for natural stupidity"

Share this post


Link to post
Share on other sites

Jim,

 

To add to my previous post about greater than 3 zones per vendor, the values aren't retained in those un-labeled fields either...

 

I'd really appreciate your take on this one...

 

THANKS!

Gabstero

Edited by gabstero

Share this post


Link to post
Share on other sites
The code that performs the work is under the 'deleteconfirm' action, just below the code you quoted. It uses tep_remove_order() in catalog/includes/functions/general.php to delete the order, including everything from the orders_shipping table.

 

Regards

Jim

 

Right way :

 

general.php file is here

 

catalog/admin/includes/functions/general.php

 

I did not find any info about adding some part of code in Admin_Install.txt in this function tep_remove_order() ....so to fix:

 

************************************************************************

 

Add in catalog/admin/includes/functions/general.php before

 

tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

 

this code:

 

tep_db_query("delete from " . TABLE_ORDERS_SHIPPING . " where orders_id = '" . (int)$order_id . "'");

 

**************************************************************************

Share this post


Link to post
Share on other sites

Okay - getting closer to my sub-thread multiple Zone Tables thing...

 

I realized that I needed to remove/install a certain custom Zone Table to reflect the number of zones I specified per vendor.

 

Now a funny shipping calculation bug. Take for example this following Zone shipping table:

 

1.1:34, 2.2:43, 3.3:51, 4.4:59, 5.5:68, 6.6:75, 7.7:83, 8.8:91, 9.9:98, 11.0:106, 12.1:112, 13.2:118, 14.3:124, 15.4:130, 16.5:136, 17.6:142, 18.7:148, 19.8:154, 20.9:160, 22.1:166, 23.2:171, 24.3:176, 25.4:181, 26.5:186, 27.6:191, 28.7:196, 29.8:201, 30.9:206, 32.0:211, 33.1:216, 34.2:221, 35.3:226, 36.4:231, 37.5:236, 38.6:241, 39.7:246, 40.8:251, 41.9:256, 43.0:261, 44.1:266, 45.2:272, 55.1:327, 66.2:381, 88.2:489, 110.3:596, 132.3:715, 154.4:834, 176.4:926, 198.5:1041, 220.5:1147

 

The shipping for a customer from that certain country zone is calculated correct until a product weight hits the triple digits (in my case 110.3:596)... From there the product weight & prices are completely wrong on the checkout page...

 

In other words instead of showing up as:

 

Shipping to RO : 110.3 lb(s) ---- $596.00

 

it shows:

 

Shipping to RO : 55 lb(s) ----- $654.00

 

Same problem occurs in the regular Zone Rates shipping method in the Vendor Manager...

 

Any clue what can be wrong???

 

Thanks!

Gabstero

Edited by gabstero

Share this post


Link to post
Share on other sites
Same problem occurs in the regular Zone Rates shipping method in the Vendor Manager...

 

Any clue what can be wrong???

 

Thanks!

Gabstero

I can't get this to happen in my test store. I copied the string you posted, and even added a 4-digit weight onto the end, and it works fine. I suspect some other limitation here. Take a look at your vendor_configuration database table. Does the 'configuration_value' column have a type of 'text'? If not, change it. A shorter character limit may be chopping off part of the string.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
<snip>Add in catalog/admin/includes/functions/general.php before

tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

this code:

tep_db_query("delete from " . TABLE_ORDERS_SHIPPING . " where orders_id = '" . (int)$order_id . "'");

You are right -- that change needs to be made on the admin side as well as the catalog side. Thanks for finding this bug.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
I can't get this to happen in my test store. I copied the string you posted, and even added a 4-digit weight onto the end, and it works fine. I suspect some other limitation here. Take a look at your vendor_configuration database table. Does the 'configuration_value' column have a type of 'text'? If not, change it. A shorter character limit may be chopping off part of the string.

 

Regards

Jim

 

Jim,

 

Thanks so much for your response! I checked and it is set to text (see screenshot below). And I checked the value in it ant the whole string is in there, entirely (not chopped of)...

Any hints where should I look maybe?

 

configuration_value.gif

 

thanks a lot!

Gabstero

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×