Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

Hello,

 

Been using MVS for a while and it works great.

 

Recently, I think PayPal has made some changes and about every 2nd or 3rd order, the shipping charges are not included. This started happening last week. Are there any updates to the shipping modules included with MVS? Or does anyone know what's causing this?

 

TIA

Link to comment
Share on other sites

Re MVS Shipping Cost Estimator

 

Finally got around to cleaning up our ship estimator for MVS a little. The bulk of the initial work was done by Craig W. Garrison Sr of BluCollar Sales after which we collaborated with him and made some additional changes. Here is the link:

 

http://addons.oscommerce.com/info/5592

Hi,

I've tried your contrib. on your personal store for 'Estimated Shipping' and thinks its just what I've been looking for :)

 

I've loaded it on to my UK based store, however it doesn't seem to work for me at present, but would like to work with it further.

 

I don't ship out side the UK, neither do I have different shipping zones based on shipping zones/postcode (trying to keep it simple, which may be part of the problem?). However as I do have different shipping rates for different vendors.

 

When I've added an item to my cart (not logged on), then click on 'Estimated Shipping' a pop-up comes up, this lists the cart contents then it asks for a Postcode and Country (which pre lists as the UK), on entering or not the postcode, then click 'Process Order' the pop-up page reloads, but is blank apart from the header! Perhaps someone can indicate where I have gone wrong please.

 

It would be nice to (subject to getting it working) to comment out the need for a postcode entry.

 

Thanks in advance for any help and comments

 

Steve

____________________________________________________________________

____________________________________________________________________

Link to comment
Share on other sites

Hello

 

Anyone help me to Resolve issue with MVS 1.1 with STS Template 4.5.8

 

I had installed contribute file and admin side working fine but on front end on checkout_shipping.php Page is showing Messued its showing

$categorybox

$manufacturerbox

$whatsnewbox

$specialbox

$searchbox

$informationbox

Not showing page properly

 

Anyone will help please...

I am looking solution for few days

 

Thanks in advance

Link to comment
Share on other sites

I don't know who has noticed yet but USPS has decided to mess with thousands of vendors all across the world by changing their descriptions in the code they send to caps. Seems like a small change and I bet the new programmer their didn't realize what he did but he broke most oscommerce stores using usps.php either in mvs or the standard oscommerce. This change likely broke MANY other carts too and they will probably change it back when they realize what chaos they have caused with such a silly change.

 

In any case, for mvs, this is how you fix the problem:

/includes/modules/vendors_shipping/usps.php

 

change all cases of Express where is named ALONE, ie not Global Express Mail, to EXPRESS

change all cases of Priority where is named ALONE, ie not International Priority Mail, to PRIORITY

change all cases of First Class where is named ALONE, ie not First Class Mail International , to FIRST CLASS

change all cases of Parcel where is named ALONE, ie not International Parcel Post, to PARCEL

 

I can't list the exact locations for you because my usps.php file is changed, here is an example of a changed location

 

OLD:

	  $this->types = array('Express' => 'Express Mail',
					   'First Class' => 'First-Class Mail',
					   'Priority' => 'Priority Mail',
					   'Parcel' => 'Parcel Post');

 

NEW:

	  $this->types = array('EXPRESS' => 'Express Mail',
					   'FIRST CLASS' => 'First-Class Mail',
					   'PRIORITY' => 'Priority Mail',
					   'PARCEL' => 'Parcel Post');

 

 

How can I determine which ones need to be upper case? About how many should I be looking to change for each?

Link to comment
Share on other sites

How can I determine which ones need to be upper case? About how many should I be looking to change for each?

 

The changes only affect domestic packages so:

 

change all cases of Express where is named ALONE, ie not Global Express Mail, to EXPRESS

change all cases of Priority where is named ALONE, ie not International Priority Mail, to PRIORITY

change all cases of First Class where is named ALONE, ie not First Class Mail International , to FIRST CLASS

change all cases of Parcel where is named ALONE, ie not International Parcel Post, to PARCEL

 

A find and replace in the usps.php should answer how many you should be looking for unless I am misunderstanding your question. I'd recommend just going through the changes step by step as the process of changing the parameters in the admin panel, then updating the database must be followed step by step.

 

A smarter suggestion sent to me by grim is to alter the case of the strings sent back by USPS which I hope to get to at some point. Once I do this I will provide an updated usps.php file which will require no db changes. As per his suggestion:

 

The following functions do it for you....

strtolower() - Converts a string to lowercase letters

strtoupper() - Converts a string to uppercase letters

 

If someone else gets a chance its not a difficult change to write.

Link to comment
Share on other sites

Re MVS Shipping Cost Estimator

Hi,

I've tried your contrib. on your personal store for 'Estimated Shipping' and thinks its just what I've been looking for :)

 

I've loaded it on to my UK based store, however it doesn't seem to work for me at present, but would like to work with it further.

 

I don't ship out side the UK, neither do I have different shipping zones based on shipping zones/postcode (trying to keep it simple, which may be part of the problem?). However as I do have different shipping rates for different vendors.

 

When I've added an item to my cart (not logged on), then click on 'Estimated Shipping' a pop-up comes up, this lists the cart contents then it asks for a Postcode and Country (which pre lists as the UK), on entering or not the postcode, then click 'Process Order' the pop-up page reloads, but is blank apart from the header! Perhaps someone can indicate where I have gone wrong please.

 

It would be nice to (subject to getting it working) to comment out the need for a postcode entry.

 

Thanks in advance for any help and comments

 

Steve

 

 

The code is basically just passing the output from your standard shipping page during checkout. If you want to make changes regarding zones, etc then you would want to do this with respect to your shipping options normally, not through the estimator code. With respect to the postal code issue, we actually tapered the code down from requiring a lot of other things. Post code and country are required for services like our postal service, ups, fedex, etc. If you wanted to remove this and force a single post code, you could remove the box and just force this variable to be one post code I suppose. As far as the page not working after you click the process order button, either the information isn't being processed properly or isn't loading properly. I would take a look at our page at www.bmotorsports.com/shop (all locations internationally) or iofast.com (us, canada only) and look at the source output on the resulting quote page and see how that differs from your output to see where things are going wrong.

 

We have had a few other people have problems with their carts not passing the information so that they just get a message saying nothing is in the cart when a user is logged in. Basically this is due to differences in the code between our site and many others as well as differences in peoples cart code. At some point in the future we will set up a box with a fresh oscommerce install with mvs for testing but at the moment we don't have a fresh install or enough time to get much done beyond what works on our site.

Link to comment
Share on other sites

The changes only affect domestic packages so:

 

change all cases of Express where is named ALONE, ie not Global Express Mail, to EXPRESS

change all cases of Priority where is named ALONE, ie not International Priority Mail, to PRIORITY

change all cases of First Class where is named ALONE, ie not First Class Mail International , to FIRST CLASS

change all cases of Parcel where is named ALONE, ie not International Parcel Post, to PARCEL

 

A find and replace in the usps.php should answer how many you should be looking for unless I am misunderstanding your question. I'd recommend just going through the changes step by step as the process of changing the parameters in the admin panel, then updating the database must be followed step by step.

 

A smarter suggestion sent to me by grim is to alter the case of the strings sent back by USPS which I hope to get to at some point. Once I do this I will provide an updated usps.php file which will require no db changes. As per his suggestion:

 

The following functions do it for you....

strtolower() - Converts a string to lowercase letters

strtoupper() - Converts a string to uppercase letters

 

If someone else gets a chance its not a difficult change to write.

 

 

I tried that. Disabled everything but 'Parcel', made the changes in the sql, "Domestic Shipping Methods", made the changes in usps.php and went back and did the same for "Parcel'. Did I mis-understand?

Link to comment
Share on other sites

Hello Friends,

 

Is anyone there to help for integrete MVS 1.1 with STS Template 4.5.8

 

I have osCommerce RC1 with STS Template 4.5.8 installed

 

I had installed Contribute admin side and its working fine on admin side but on Front end checkout_shipping.php is broken its showing STS Tags on pages like

$categorybox

$manufacturerbox

$whatsnewbox

$specialbox

$searchbox

 

Please help me to resolve this

 

I am really thankfull to you

Link to comment
Share on other sites

I tried that. Disabled everything but 'Parcel', made the changes in the sql, "Domestic Shipping Methods", made the changes in usps.php and went back and did the same for "Parcel'. Did I mis-understand?

 

Went back and tried it again this morning. Same result. I do get rates but at the top of the page I get the following errors:

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_USPS_RATES_ZONE_6 in /includes/modules/vendors_shipping/usps.php on line 113

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_USPS_RATES_ZONE_6 in /includes/modules/vendors_shipping/usps.php on line 113

 

This is line 113: if ( ($this->enabled == true) && ((int)constant('MODULE_SHIPPING_USPS_RATES_ZONE_' . $vendors_id) > 0) ) {

 

 

I don't have a clue.

 

TIA

Link to comment
Share on other sites

Went back and tried it again this morning. Same result. I do get rates but at the top of the page I get the following errors:

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_USPS_RATES_ZONE_6 in /includes/modules/vendors_shipping/usps.php on line 113

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_USPS_RATES_ZONE_6 in /includes/modules/vendors_shipping/usps.php on line 113

 

This is line 113: if ( ($this->enabled == true) && ((int)constant('MODULE_SHIPPING_USPS_RATES_ZONE_' . $vendors_id) > 0) ) {

I don't have a clue.

 

TIA

That's an old bug. Replace all instances of MODULE_SHIPPING_USPS_RATES_ZONE_ with MODULE_SHIPPING_USPS_ZONE_. In fact, _RATES should be removed from all constants that include it.

 

Regards

Jim

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

Link to comment
Share on other sites

That's an old bug. Replace all instances of MODULE_SHIPPING_USPS_RATES_ZONE_ with MODULE_SHIPPING_USPS_ZONE_. In fact, _RATES should be removed from all constants that include it.

 

Regards

Jim

 

Thanks, that got it!!

 

I did a search for that string, but didn't get any results.

 

Again, thanks!!

 

Eddie

Link to comment
Share on other sites

At the risk of appearing EXTREMELY stupid can some point me to the exact download url for MVS. I have click3ed on various links and get to the contributions page but there are many download links there, some additional hacks etc.

 

What's the score here? Do I need to download the original file and add all the bug fixes?

 

Like I say, EXTREMELY stupid... :blush:

Link to comment
Share on other sites

At the risk of appearing EXTREMELY stupid can some point me to the exact download url for MVS. I have click3ed on various links and get to the contributions page but there are many download links there, some additional hacks etc.

 

What's the score here? Do I need to download the original file and add all the bug fixes?

 

Like I say, EXTREMELY stupid... :blush:

Go here and download MVS 1.1, and pay attention to "Another Bugfix for MVS 1.1 /admin/includes/database_tables.php", as I screwed up the "Manual Install" instructions. The best thing to do is to do a file comparison using software, and free one is WinMerge, I use it(as well others) and it does the job just fine.

 

If you have trouble, come back and the community will try to help out.

 

Good luck, Craig :)

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: [email protected]

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Link to comment
Share on other sites

Go here and download MVS 1.1, and pay attention to "Another Bugfix for MVS 1.1 /admin/includes/database_tables.php", as I screwed up the "Manual Install" instructions. The best thing to do is to do a file comparison using software, and free one is WinMerge, I use it(as well others) and it does the job just fine.

 

If you have trouble, come back and the community will try to help out.

 

Good luck, Craig :)

 

 

Thanks Craig. Not sure what you mean about 'file comparison' but will cross that bridge when I come to it :thumbsup:

Link to comment
Share on other sites

Here's what I did. I downloaded mvs 1.1 and the edited file as you suggested. I downloaded Winmerge. I opened the original file in the left window and the updated file in the right window. I then elected to 'merge all to the left' and saved it.

 

If my thinking is correct that would have taken all the differences of the updated file and placed them into the original file.

 

Sound right?

Link to comment
Share on other sites

When customers are logged into the site the shipping estimator pops up but gives this error

Page not found

The page you are looking for might have been removed,

had its name changed, or is temporarily unavailable.

Please try the following:

 

If you typed the page address in the Address bar, make sure that it is spelled correctly.

 

- Click the Back button in your browser to try another link.

- Use a search engine like Google to look for information on the Internet.

HTTP 404 - File not found

 

When your not logged in it works fine

also when people try using it from other countries other than US it doesnt work

 

anyone know how to fix this

 

Thanks

Link to comment
Share on other sites

Hello again.

 

Well I have been going through then installation and generally speaking everything has gone ok. I am a bit confused by a couple of things that seemed odd.

 

1. The download sometimes has more files than are mentioned. For instance it might say (in new files) that these two files must be uploaded but there are 4 files in the folder. What are the other 2 for?

 

2. A couple of times the code to look for has not existed in exactly the same form as the readme describes. For instance oscommerce.gif does not appear in my version.

 

3. I am installing the admin stuff and have got to here...

 

admin/index.php

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

 

======

Find

======

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

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

Replace With:

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

 

Modified for MVS V1.0 2006/03/25 JCK/CWG

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2006 osCommerce

 

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

Find Lines 26 thru 30

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

 

array('title' => BOX_HEADING_CATALOG,

'image' => 'catalog.gif',

'href' => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'),

'children' => array(array('title' => CATALOG_CONTENTS, 'link' => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog')),

array('title' => BOX_CATALOG_MANUFACTURERS, 'link' => tep_href_link(FILENAME_MANUFACTURERS, 'selected_box=catalog')))),

 

 

The above code does not appear in my admin/index file.

 

what do you suggest?

 

Many thanks

 

Martin

Link to comment
Share on other sites

having read the comment aboutn admin/index.php being a waste of space I just pressed ahead.

 

I finished the rest of the file edits, ran the sql, went to catalog/admin and get this

 

1146 - Table 'thekenya_osc.TABLE_VENDOR_CONFIGURATION' doesn't exist

 

select configuration_key as cfgKey, configuration_value as cfgValue from TABLE_VENDOR_CONFIGURATION

 

[TEP STOP]

 

Ho hum,

 

What do you think?

Link to comment
Share on other sites

having read the comment aboutn admin/index.php being a waste of space I just pressed ahead.

 

I finished the rest of the file edits, ran the sql, went to catalog/admin and get this

 

1146 - Table 'thekenya_osc.TABLE_VENDOR_CONFIGURATION' doesn't exist

 

select configuration_key as cfgKey, configuration_value as cfgValue from TABLE_VENDOR_CONFIGURATION

 

[TEP STOP]

 

Ho hum,

 

What do you think?

You forgot the changes to admin/includes/database_tables.php.

 

Per your previous comment, MVS was developed for osCommerce 2.2MS2. Subsequent updates have changed a few things. The most obvious of these is admin/index.php, which was completely rewritten. And I still think it's a waste, new version or old.

 

If you find places where the instructions don't match the code, please post those here. Every little bit helps.

 

Regards

Jim

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

Link to comment
Share on other sites

Here's a little christmas something for Australian users of MVS. A modification of the excellent Australian Shipping module for Aussie Post:

 

includes/modules/vendors_shipping/auspost.php:

<?php
/* 	Modified by Max Lian 02/12/2007 for use with MVS
All work is that of the original authors.  This modification is based on the original work of others - all credit where credit is due!
The Aussie Post shipping module was originally downloaded from http://addons.oscommerce.com/info/648 and is version 2.0.2.

To do:  Fix up tax!  This is currently quasi-hard coded.

All MVS mods have been commented with //MVS or //MVS start, //MVS end.
*/
/*
 $Id: auspost.php,v 2.0.2 2003/10/15
 Based on the above contribution but Auspost Insurance added
 and will recognise if address if for Aus or OS and not dispaly for
 OS.  Also will not display for packages that exceed maximum weight

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

class auspost {
var $code, $title, $description, $icon, $enabled;

// class constructor
function auspost() {
  global $order;

  $this->code = 'auspost';
  $this->title = MODULE_SHIPPING_AUSPOST_TEXT_TITLE;
  $this->description = MODULE_SHIPPING_AUSPOST_TEXT_DESCRIPTION;
	$this->icon = DIR_WS_ICONS . 'auspost.gif';

	/* MVS start
	$this->sort_order = MODULE_SHIPPING_AUSPOST_SORT_ORDER;
  $this->tax_class = MODULE_SHIPPING_AUSPOST_TAX_CLASS;
  $this->enabled = ((MODULE_SHIPPING_AUSPOST_STATUS == 'True') ? true : false);

  if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_AUSPOST_ZONE > 0) ) {
	$check_flag = false;
	$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_AUSPOST_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
	while ($check = tep_db_fetch_array($check_query)) {
	  if ($check['zone_id'] < 1) {
		$check_flag = true;
		break;
	  } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
		$check_flag = true;
		break;
	  }
	}

	if ($check_flag == false) {
	  $this->enabled = false;
	}
  }

  MVS end */
}
// MVS start
function sort_order($vendors_id='1') {
	if (defined (@constant ('MODULE_SHIPPING_AUSPOST_SORT_ORDER_' . $vendors_id))) {
		$this->sort_order = @constant('MODULE_SHIPPING_AUSPOST_SORT_ORDER_' . $vendors_id);
	} else {
		$this->sort_order = '0';
	}
	return $this->sort_order;
}

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

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

function zones($vendors_id='1') {
	if ( ($this->enabled == true) && ((int)constant('MODULE_SHIPPING_AUSPOST_ZONE_' . $vendors_id) > 0) ) {
		$check_flag = false;
		$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int)constant('MODULE_SHIPPING_AUSPOST_ZONE_' . $vendors_id) . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
		while ($check = tep_db_fetch_array($check_query)) {
			if ($check['zone_id'] < 1) {
				$check_flag = true;
			break;
			} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
				$check_flag = true;
				break;
			  } //if
		} //while

		if ($check_flag == false) {
			$this->enabled = false;
		}//if
	}//if
	return $this->enabled;
}//function	

// MVS end

// class methods
// MVS
// function quote($method = '') {
function quote($method = '', $module = '', $vendors_id = '1') {
  global $order,  $cart, $shipping_weight, $shipping_num_boxes, $total_weight;

  // AUS ONLY Other countries HIDE
	if ($order->delivery['country']['iso_code_2'] == 'AU') { 

	// ONLY SHOWN IF LESS OR EQUAL TO MAX WEIGHT  
		if ($shipping_weight <= constant('MODULE_SHIPPING_AUSPOST_MAX_WEIGHT_' . $vendors_id)) { 

			$frompcode = constant('MODULE_SHIPPING_AUSPOST_SPCODE_' . $vendors_id);
			$topcode = $order->delivery['postcode'];
			$sweight = $shipping_weight*1000;			
			$swidth = constant('MODULE_SHIPPING_AUSPOST_SWIDTH_' . $vendors_id);
			$sheight = constant('MODULE_SHIPPING_AUSPOST_SHEIGHT_' . $vendors_id);
			$slength = constant('MODULE_SHIPPING_AUSPOST_SDEPTH_' . $vendors_id);
			$error = false;

			//  If Insurance option selected - calculate insurance cost
			if (constant('MODULE_SHIPPING_AUSPOST_INS_STATUS_' . $vendors_id) == 'True') {
				// Start with Base Cost
				$insurance = constant('MODULE_SHIPPING_AUSPOST_INS_BASE_' . $vendors_id);
				if ($order->info['subtotal'] > constant('MODULE_SHIPPING_AUSPOST_INS_UNIT_' . $vendors_id)) {
					$how_often = ceil((($order->info['subtotal'] - constant('MODULE_SHIPPING_AUSPOST_INS_UNIT_' . $vendors_id))/constant('MODULE_SHIPPING_AUSPOST_INS_UNIT_' . $vendors_id)));
					$insurance =+ constant('MODULE_SHIPPING_AUSPOST_INS_BASE_' . $vendors_id) + ($how_often * constant('MODULE_SHIPPING_AUSPOST_INS_ADD_' . $vendors_id));
				}	 
			}
			//  End calculating Insurance

			$url = "http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=$frompcode&Destination_Postcode=$topcode&Country=AU&Weight=$sweight&Service_Type=STANDARD&Height=$sheight&Width=$swidth&Length=$slength&Quantity=$shipping_num_boxes";
			$myfile = file($url);

			$i=0;
			foreach($myfile as $vals)
			{
				$bits = split("=", $vals);
				$$bits[0] = $bits[1];
			}

			if ($charge <= 0) {
				$error = true;
			  } else {

				$handling = constant('MODULE_SHIPPING_AUSPOST_HANDLING_' . $vendors_id);
				  if ($handling >0) {
					$handling_details = " $" . constant('MODULE_SHIPPING_AUSPOST_HANDLING_' . $vendors_id) . " " .MODULE_SHIPPING_AUSPOST_TEXT_HANDLING;
				  } else {
					$handling_details = "";
				  }

				if ($insurance >0) {
					$insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_TEXT_INSURANCE;
				  } else {
					$insurance_details = "";
				  }

				if ($insurance == 0 && $handling  == 0) {
					$auspost_addons = "";
				} else {
					$auspost_addons = " (" . MODULE_SHIPPING_AUSPOST_TEXT_INCLUDE . $handling_details . $insurance_details . ") ";
				}

				$shipping_auspost_method = MODULE_SHIPPING_AUSPOST_TEXT_WAY. " <b>"  . $topcode . "</b> - " . $days . " " . MODULE_SHIPPING_AUSPOST_TEXT_SHIPPINGDAYS . ", " .$shipping_num_boxes . MODULE_SHIPPING_AUSPOST_TEXT_BOXES  . " " . $total_weight . MODULE_SHIPPING_AUSPOST_TEXT_UNITS . $auspost_addons;
				// MVS fudged this for tax - this might not be the best fix - $shipping_auspost_cost = (($charge/1.1)* $shipping_num_boxes);
				$shipping_auspost_cost = ($charge * $shipping_num_boxes);
			}

			// MVS start
			$vendors_data_query = tep_db_query("select handling_charge, 
											 	handling_per_box,
					 							vendor_country 
												  from " . TABLE_VENDORS . " 
												  where vendors_id = '" . (int)$vendors_id . "'"
												);
			$vendors_data = tep_db_fetch_array($vendors_data_query);
			$country_name = tep_get_countries($vendors_data['vendor_country'], true); 	

			$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;
			}
			  // MVS end
			$this->quotes = array('id' => $this->code,
								'module' => MODULE_SHIPPING_AUSPOST_TEXT_TITLE,
								'methods' => array(array('id' => $this->code,
														 'title' => $shipping_auspost_method,
														 // MVS start
														 // 'cost' => ($shipping_auspost_cost + MODULE_SHIPPING_AUSPOST_HANDLING) + $insurance)));
														'cost' => $shipping_auspost_cost + $handling)));
														// MVS end

			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_AUSPOST_TEXT_ERROR . " " . $total_weight . " " . $shipping_weight;
			return $this->quotes;
		}
	}
}

// MVS start
// MVS function check() {
function check($vendors_id='1') {
	if (!isset($this->_check)) {
	// $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_AUSPOST_STATUS'");
		$check_query = tep_db_query("select configuration_value from " . TABLE_VENDOR_CONFIGURATION . " where vendors_id = '". $vendors_id ."' and configuration_key = 'MODULE_SHIPPING_AUSPOST_STATUS_" . $vendors_id . "'");
		// MVS end
		$this->_check = tep_db_num_rows($check_query);
	}
	return $this->_check;
}

// MVS start
// function install() {
function install($vendors_id='1') {
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . "(configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) VALUES ('Enable auspost', 'MODULE_SHIPPING_AUSPOST_STATUS_" . $vendors_id . "','True', 'Do you want to offer auspost?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(),'" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) VALUES ('Dispatch Postcode', 'MODULE_SHIPPING_AUSPOST_SPCODE_" . $vendors_id . "', '2000', 'Dispatch Postcode?', '6', '0', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) VALUES ('Enable Insurance', 'MODULE_SHIPPING_AUSPOST_INS_STATUS_" . $vendors_id . "', 'True', 'Do you want to include insurance?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Insurance Base Cost', 'MODULE_SHIPPING_AUSPOST_INS_BASE_" . $vendors_id . "', '4.35', 'Cost for the first unit of insurance. Needs to be sent <b>Registered Mail</b> for Insurance.', '6', '0', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Insurance Addition Cost', 'MODULE_SHIPPING_AUSPOST_INS_ADD_" . $vendors_id . "', '1.15', 'Cost for each addition unit of insurance over Base Cost.', '6', '0', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Insurance Unit Size', 'MODULE_SHIPPING_AUSPOST_INS_UNIT_" . $vendors_id . "', '100', 'Insurance units are based on these increments - (size in Dollars).', '6', '0', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Handling Fee', 'MODULE_SHIPPING_AUSPOST_HANDLING_" . $vendors_id . "', '5.00', 'Handling Fee for this shipping method', '6', '0', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Maximum Weight (kg)', 'MODULE_SHIPPING_AUSPOST_MAX_WEIGHT_" . $vendors_id . "', '20', 'Maximum weight allowed by AustPost (in kg).  A packaging allowance of <b>3 kg</b> is allowed.  EG. 20 - 3 = 17.  17 becomes cutoff point for use.', '6', '0', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) VALUES ('Parcel Height (mm)', 'MODULE_SHIPPING_AUSPOST_SHEIGHT_" . $vendors_id . "', '100', 'Parcel Height (in mm)', '6', '0', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) VALUES ('Parcel Width (mm)', 'MODULE_SHIPPING_AUSPOST_SWIDTH_" . $vendors_id . "', '100', 'Parcel Width (in mm)', '6', '0', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) VALUES ('Parcel Depth (mm)', 'MODULE_SHIPPING_AUSPOST_SDEPTH_" . $vendors_id . "', '100', 'Parcel Depth (in mm)', '6', '0', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Shipping Zone', 'MODULE_SHIPPING_AUSPOST_ZONE_" . $vendors_id . "', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now(), '" . $vendors_id . "')");
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Tax Class', 'MODULE_SHIPPING_AUSPOST_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(), '" . $vendors_id . "')");	 
	tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Sort order of display.', 'MODULE_SHIPPING_AUSPOST_SORT_ORDER_" . $vendors_id . "', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now(), '" . $vendors_id . "')");
}

/* MVS start
function remove() {
  tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
MVS end */
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) {
	return array('MODULE_SHIPPING_AUSPOST_STATUS_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_SPCODE_' . $vendors_id,'MODULE_SHIPPING_AUSPOST_INS_STATUS_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_INS_BASE_' . $vendors_id,  'MODULE_SHIPPING_AUSPOST_INS_ADD_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_INS_UNIT_' . $vendors_id,  'MODULE_SHIPPING_AUSPOST_MAX_WEIGHT_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_HANDLING_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_SHEIGHT_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_SWIDTH_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_SDEPTH_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_ZONE_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_TAX_CLASS_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_SORT_ORDER_' . $vendors_id, );
}
}
?>

 

From memory, there are no other files to modify. I'm working on modifying the express module, but until then.. enjoy!

 

Max

Link to comment
Share on other sites

You forgot the changes to admin/includes/database_tables.php.

 

This is what I've got

 

define('TABLE_ZONES', 'zones');

//MVS Start

define('TABLE_HEADING_PRODUCTS_VENDOR', 'Vendor');

define('TABLE_HEADING_QUANTITY', 'Qty');

define('TABLE_HEADING_VENDORS_SHIP', 'Shipper');

define('TABLE_HEADING_SHIPPING_METHOD', 'Method');

define('TABLE_HEADING_SHIPPING_COST', 'Ship Cost');

define('VENDOR_ORDER_SENT', 'Order Sent to ');

//MVS End

?>

 

I'll take another look at admin/index as that is the only file i found where the instructions did not match the code at all. As mentioned, I can't find the code anywhere in that file, so I ignored it.

 

Any chance of a copy of what the file SHOULD look like when it is done?

 

Thanks

Link to comment
Share on other sites

[i'll take another look at admin/index as that is the only file i found where the instructions did not match the code at all. As mentioned, I can't find the code anywhere in that file, so I ignored it.

 

Any chance of a copy of what the file SHOULD look like when it is done?

 

Thanks

 

Wait a minute. I used the one from the installation package and now get this

 

1146 - Table 'thekenya_osc.TABLE_VENDOR_CONFIGURATION' doesn't exist

 

select configuration_key as cfgKey, configuration_value as cfgValue from TABLE_VENDOR_CONFIGURATION

 

[TEP STOP]

 

Do I need to start again?

Link to comment
Share on other sites

This is what I've got

 

define('TABLE_ZONES', 'zones');

//MVS Start

define('TABLE_HEADING_PRODUCTS_VENDOR', 'Vendor');

define('TABLE_HEADING_QUANTITY', 'Qty');

define('TABLE_HEADING_VENDORS_SHIP', 'Shipper');

define('TABLE_HEADING_SHIPPING_METHOD', 'Method');

define('TABLE_HEADING_SHIPPING_COST', 'Ship Cost');

define('VENDOR_ORDER_SENT', 'Order Sent to ');

//MVS End

?>

 

I'll take another look at admin/index as that is the only file i found where the instructions did not match the code at all. As mentioned, I can't find the code anywhere in that file, so I ignored it.

 

Any chance of a copy of what the file SHOULD look like when it is done?

 

Thanks

This is what it looks like in my copy of MVS 1.1:

  define('TABLE_ZONES', 'zones');
  //MVS start
 define('TABLE_VENDORS', 'vendors');
 define('TABLE_VENDORS_INFO', 'vendors_info');
 define('TABLE_VENDOR_CONFIGURATION', 'vendor_configuration');
 define('TABLE_ORDERS_SHIPPING', 'orders_shipping');
 define('TABLE_PACKAGING', 'packaging');
  //MVS end

 

Regards

Jim

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

Link to comment
Share on other sites

Join the conversation

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

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...