Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

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?

<image snipped>

 

thanks a lot!

Gabstero

I have no idea what is going on in your site. I tested it with the exact string that you posted and it works fine. Something is not working properly in your installation. Check the total weight on the Shipping page for the correct value. From there, stick Print statements in the module to see how it is handling the values. Also, check the shopping_cart class for correct mods/data there.

 

Regards

Jim

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

Link to comment
Share on other sites

I have no idea what is going on in your site. I tested it with the exact string that you posted and it works fine. Something is not working properly in your installation. Check the total weight on the Shipping page for the correct value. From there, stick Print statements in the module to see how it is handling the values. Also, check the shopping_cart class for correct mods/data there.

 

Regards

Jim

 

 

Jim,

 

It might be because of the Individual Shipping Price module I have in there... Check the modded code tagged "//mod IndvShip" in this code in includes/classes/shopping_cart.php:

 

  function vendor_shipping() {

  if (!is_array($this->contents)) return 0;  //Cart is empty

  $this->vendor_shipping = array();  //Initialize the output array
  reset($this->contents);			//  and reset the input array
  foreach ($this->contents as $products_id => $value) {  //$value is never used
	$quantity = $this->contents[$products_id]['qty'];

//mod IndvShip, added products_ship_price
   $products_query = tep_db_query("select products_id, 
										   products_price,
										   products_ship_price,
										   products_tax_class_id, 
										   products_weight, 
										   vendors_id 
									from " . TABLE_PRODUCTS . " 
									where products_id = '" . (int)$products_id . "'"
								  );
	if ($products = tep_db_fetch_array($products_query)) {
	  $products_price = $products['products_price'];
	  //mod IndvShip
	  $products_ship_price = $products['products_ship_price'];
	  //mod IndvShip
	  $products_weight = $products['products_weight'];
	  $vendors_id = ($products['vendors_id'] <= 0) ? 1 : $products['vendors_id'];
	  $products_tax = tep_get_tax_rate($products['products_tax_class_id']);

	  //Find special prices (if any)
	  $specials_query = tep_db_query("select specials_new_products_price
									  from " . TABLE_SPECIALS . "
									  where products_id = '" . (int)$products_id . "'
										and status = '1'"
									);
	  if (tep_db_num_rows ($specials_query)) {
		$specials = tep_db_fetch_array($specials_query);
		$products_price = $specials['specials_new_products_price'];
	  }

	  //Add values to the output array
	  $this->vendor_shipping[$vendors_id]['weight'] += ($quantity * $products_weight);
	  $this->vendor_shipping[$vendors_id]['cost'] += tep_add_tax($products_price, $products_tax) * $quantity;
	  //mod IndvShip
	  $this->vendor_shipping[$vendors_id]['ship_cost'] += ($quantity * $products_ship_price);					
	  //mod IndvShip
	  $this->vendor_shipping[$vendors_id]['qty'] += $quantity;
	  $this->vendor_shipping[$vendors_id]['products_id'][] = $products_id; //There can be more than one product
	}

	// Add/subtract attributes prices (if any)
	if (isset($this->contents[$products_id]['attributes'])) {
	  reset($this->contents[$products_id]['attributes']);
	  foreach ($this->contents[$products_id]['attributes'] as $option => $value) {
		$attribute_price_query = tep_db_query("select options_values_price,
													  price_prefix
											   from " . TABLE_PRODUCTS_ATTRIBUTES . "
											   where products_id = '" . (int)$products_id . "'
												 and options_id = '" . (int)$option . "'
												 and options_values_id = '" . (int)$value . "'"
											 );
		$attribute_price = tep_db_fetch_array($attribute_price_query);
		if ($attribute_price['price_prefix'] == '+') {
		  $this->vendor_shipping[$vendors_id]['cost'] += $quantity * tep_add_tax($attribute_price['options_values_price'], $products_tax);
		} else {
		  $this->vendor_shipping[$vendors_id]['cost'] -= $quantity * tep_add_tax($attribute_price['options_values_price'], $products_tax);
		}
	  }
	}
  }

  return $this->vendor_shipping;
}
//MVS End

 

I am going to try to comment that out and see if it makes any difference. If that will make it work is cool but... I would like the Individual Shipping Prices mod in there also...

 

thanks!

Gabstero

Link to comment
Share on other sites

Jim,

 

It might be because of the Individual Shipping Price module I have in there... <snip>

thanks!

Gabstero

That will definitely cause problems. The Individual Shipping mod is not compatible with MVS, at least without a lot of extra work.

 

Regards

Jim

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

Link to comment
Share on other sites

Jim,

 

I used the "Individual Shipping v1.2 for MVS v.1.1" package found in the MVS V1.0 page, thinking that it was already adapted as the title states. I will however try to remove it and see what happens...

 

Thanks for all your help!

 

Gabstero

Sorry, I thought you meant the unmodified version. The MVS modified version has been reported working, although I have not used it myself. If everything works without it, you may have made an error in adding that module, or there is an unreported bug.

 

Regards

Jim

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

Link to comment
Share on other sites

Sorry, I thought you meant the unmodified version. The MVS modified version has been reported working, although I have not used it myself. If everything works without it, you may have made an error in adding that module, or there is an unreported bug.

 

Regards

Jim

 

Hi Jim (again)!

 

I went and commented out step by step the Individual Shipping mod for MVS (starting with first uninstalling the module from a certain vendor, then uncommenting anything tagged "indvship" and lastly, deleting the two files called "indvship.php" from each locations), but ran into all sorts of errors on the checkout page as if the system was still looking for those "indvship.php" files.

I didn't however deleted the 'products_ship_price' in the 'products' table that was altered using their supplied sql query:

ALTER TABLE `products` ADD `products_ship_price` decimal(15,2) NOT NULL default '0.00';

 

Anyway, not important...

 

I really would like this Indv Ship for MVS working since it is a very helpful mod for me but without messing up the other Zones Table calculations as it does now.

So I would kindly ask you to take a look at these two files below where I suspect the bug hiding (named _INDMOD that were supplied by the Indv Ship Mod for MVS), and compare them to there respective files I have now live on my web page (named _LIVE). You might be able to catch something I am overlooking. I went very careful over them but I was not able to catch what I might be doing wrong (or what the Indvship mod might conflict):

 

The IndvMod for MVS supplied files:

shopping_cart_INDMOD.txt

vendor_shipping_INDMOD.txt

 

Their respective files I now have live:

shopping_cart_LIVE.txt

vendor_shipping_LIVE.txt

 

Your input would be VERY MUCH appreciated...

 

Thanks a LOT

GAbstero

Link to comment
Share on other sites

Hi,

 

Got a problem while I was testing my store during checkout. I have MVS installed with different "standard rates" for each different vendor. Problem is during checkout, I don't see the shipping method or the shipping costs or the weight of the item. It displays the product cost and I can checkout without any shipping costs added.

 

I have already installed "standard rates" under "vendor shipping modules" set "enabled zones method" to "true"

Under Configuration> Shipping/Packaging> Enable Vendor Shipping to "true"

 

Still no shipping rates are given during checkout.

 

However, when I enable Modules> Shipping> Zone Rates, it works fine. Shipping rates are shown during checkout. But this basically defeats the whole purpose of having Multi Vendor Shipping as this just sets a global rate for all vendors.

 

Can anyone point me in the right direction? Any help is greatly appreciated.

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

 

After you make this change you STILL need to go in the DB and make some changes.

 

The first thing you need to do is unselect all but one of the USPS shipping options in the admin panel under USPS located under the Manage section for each vendor. We unselected all but Parcel as an example for each vendor. We then went into the table 'vendor_configuration' and edited all rows that match 'Domestic Shipping Methods' in the field 'configuration_title' and also shows USPS somewhere in the field of configuration_key. Once you have those rows ready to be edited in phpMyAdmin or your editor of choice upper case the values for the 'configuration_value' that you deselected. For example we changed our 'configuration_value' to

 

EXPRESS, PRIORITY, FIRST CLASS, Parcel

 

and make the same change to 'set_function' such as:

 

tep_cfg_select_multioption(array('EXPRESS', 'PRIORITY', 'FIRST CLASS', 'Parcel'),

 

Once these changes are made go back and enable the methods you just disabled and disable the method you left on. Now go back to your DB editor and change the final lower case term (Parcel in our example above) to upper case as we had done to the first the classes listed above.

Link to comment
Share on other sites

Jared,

Thanks for your fix. I called USPS and they claim that they are still sending responses out in lowercase. They say that this was an OSC problem, we are converting it to UPPERCASE. Gee I don't know I didn't change anything prior to my customers being unwittingly duped into a higher priced service. IMHO they had to change something.

 

Does anyone know how to verify (prove) if it is USPS or OSC? I'm giving refunds to my customers. Ouch!

 

Sorry if this is a little off MVS topic.

Kendall

Brooklyn, New York USA

Link to comment
Share on other sites

I just installed the FedEx Freight for MVS and I get the following error:

 

Warning: Missing argument 1 for keys() in /home/hsphere/local/home/esilk/naturalhomesource.com/store/includes/modules/shipping/fxfreight.php on line 274

 

This is related to the following code, and it appears that the keys function is not picking up the vendor id variable:

 

    function keys($vendors_id) {
     return array('MODULE_SHIPPING_FXFREIGHT_STATUS_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_SHIP_TERMS_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_SHIP_ZIP_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_SHIP_COUNTRY_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_ACCT_NUM_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_DECLARE_VALUE_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_RES_PICKUP_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_LIFT_GATE_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_ERROR_ACTION_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_HANDLING_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_TAX_CLASS_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_ZONE_' . $vendors_id,
                  'MODULE_SHIPPING_FXFREIGHT_SORT_ORDER_' . $vendors_id);
   }

 

Any idea how to get this to work?

 

Thanks.

Randy

Edited by esilk
Link to comment
Share on other sites

Hello,

 

I have a site where shipping taxes are not being shown for any vendor shipping modules. If I turn off vendor shipping and install a standard flat rate module set to 5.00 and set it taxable then I get the correct 5 + tax. Taxes are shown fine in the rest of the site.

 

Does anyone else have tax applied to their vendor shipping modules, with it working?

 

Any ideas on a fix?

Link to comment
Share on other sites

  • 2 weeks later...
Jared,

Thanks for your fix. I called USPS and they claim that they are still sending responses out in lowercase. They say that this was an OSC problem, we are converting it to UPPERCASE. Gee I don't know I didn't change anything prior to my customers being unwittingly duped into a higher priced service. IMHO they had to change something.

 

Does anyone know how to verify (prove) if it is USPS or OSC? I'm giving refunds to my customers. Ouch!

 

Sorry if this is a little off MVS topic.

 

USPS development was supposed to call us back on Nov 19, 2007. They finally called back on Nov 30, 2007. We told them they had changed their code to upper case for domestic and that this seemingly simple change would have broken thousands of websites and surely bogged down their support and dramatically damaged many websites either unaware of the change or lacking the skills the make the change. We then asked why they would have changed the code only for domestic without notification and if they planned to change it back. Here are the answers:

 

Q - Was there any notification of this change, can we be notified of similar changes in the future?

A - Development did not notify support or anyone else and we would not be able to notify web developers as a result.

 

Q - Is this change a mistake? Is it merely a temporary change or mistake that will be changed back or fixed?

A - As far as we know, it is a permanent change.

 

Q - Why did this change take place? It seems both unnecessary and specifically damaging to US online vendors without any cause.

A - We have not been notified of any reason for the change

 

Q - Why did only domestic change and not International?

A - We don't know.

 

Q - This surely would have broke thousands of websites, perhaps more, and it has take 11 days to get back to us, is this a catastrophic issue for support that seems to have been a small code change by someone lacking the understanding of the consequences?

A - We have been overloaded because of the change, we don't know why the developers chose to do this.

 

All I have to say is, Brilliant. Check your websites people, make sure your code works!

Link to comment
Share on other sites

Thank you SO MUCH iofast!! I worked all day to resolve this issue and came up with nothing but errors until I filally found your post here. I can't thank you enough for posting this fix. It is the only one that worked for me.

 

 

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

 

After you make this change you STILL need to go in the DB and make some changes.

 

The first thing you need to do is unselect all but one of the USPS shipping options in the admin panel under USPS located under the Manage section for each vendor. We unselected all but Parcel as an example for each vendor. We then went into the table 'vendor_configuration' and edited all rows that match 'Domestic Shipping Methods' in the field 'configuration_title' and also shows USPS somewhere in the field of configuration_key. Once you have those rows ready to be edited in phpMyAdmin or your editor of choice upper case the values for the 'configuration_value' that you deselected. For example we changed our 'configuration_value' to

 

EXPRESS, PRIORITY, FIRST CLASS, Parcel

 

and make the same change to 'set_function' such as:

 

tep_cfg_select_multioption(array('EXPRESS', 'PRIORITY', 'FIRST CLASS', 'Parcel'),

 

Once these changes are made go back and enable the methods you just disabled and disable the method you left on. Now go back to your DB editor and change the final lower case term (Parcel in our example above) to upper case as we had done to the first the classes listed above.

Link to comment
Share on other sites

Thank you SO MUCH iofast!! I worked all day to resolve this issue and came up with nothing but errors until I filally found your post here. I can't thank you enough for posting this fix. It is the only one that worked for me.

 

No problem, this will likely be a pervasive problem that may not be a permanent one. As such, I posted a contribution on the MVS contrib page so that people can find it easily.

Link to comment
Share on other sites

Hi,

 

Great contribution! One question - my client sells stationery from a variety of different vendors across the US. If someone orders say - 4 items - each from a different vendor - than that's four lots of shipping - which is extremely expensive! My client is concerned that this is going to put people off (and to be honest I can see her point...). Is there any way to combine shipping costs of orders shipped from different vendors so the amount is not so high?

 

thanks

 

Jason

Link to comment
Share on other sites

I got this mod so that I could keep from undercharging or overcharging. I don't think there is a way to keep from people getting turned off from high shipping cost unless you seperate those items into different stores but then why use this modification then.

 

Ok here is my problem and hope that someone can answer pretty fast. I am using bts mod on oscommerce and adding mvs to that.

I got the admin side of this mod working (despite having admin levels, I just allowed access to those files through store files button)

Now when it came to the catalog, I found all the code that was refered to the instructions. Most was in the files that were mention and others had been moved to the tpl version of those files. My problem is arising from an unexpected $ on 219 in checkout_shipping.php. I don't have a line 219 so I am figuring it is refering to something in the checkout_shipping.tpl.php .

If anyone can help that would be wonderful.

Edited by zorainic
Link to comment
Share on other sites

Great contribution! One question - my client sells stationery from a variety of different vendors across the US. If someone orders say - 4 items - each from a different vendor - than that's four lots of shipping - which is extremely expensive! My client is concerned that this is going to put people off (and to be honest I can see her point...). Is there any way to combine shipping costs of orders shipped from different vendors so the amount is not so high?

Anyone.....?

Link to comment
Share on other sites

The problem was a missing } at the end of the 1st mvs edit. Now I run into the problem of my purchase without account not working with this mod. Again, any help would be much appreciated.

Link to comment
Share on other sites

Hi,

 

Great contribution! One question - my client sells stationery from a variety of different vendors across the US. If someone orders say - 4 items - each from a different vendor - than that's four lots of shipping - which is extremely expensive! My client is concerned that this is going to put people off (and to be honest I can see her point...). Is there any way to combine shipping costs of orders shipped from different vendors so the amount is not so high?

 

thanks

 

Jason

As far as I know Jason, noone has done this though we have seen a number of other users request the same feature. It is on my "wish list" for MVS, but I have not had the time to get it done. It would require a fair amount of work. It would also have many dependent factors to be dealt with, making things more difficult.

 

The simple answer for you at this point though, no, it cannot be done.

 

Sorry and good luck, Craig :)

 

The problem was a missing } at the end of the 1st mvs edit. Now I run into the problem of my purchase without account not working with this mod. Again, any help would be much appreciated.

Chances are you have simply messed up some code from PWA during MVS installation. MVS doesn't actually change anything involved in the customer's account creation or management, so MVS didn't break PWA, you will simply need to go back through each file and double check that you didn't undo any of the changes for PWA during MVS installation.

 

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

As far as I know Jason, noone has done this though we have seen a number of other users request the same feature. It is on my "wish list" for MVS, but I have not had the time to get it done. It would require a fair amount of work. It would also have many dependent factors to be dealt with, making things more difficult.

 

The simple answer for you at this point though, no, it cannot be done.

 

Sorry and good luck, Craig :)

Chances are you have simply messed up some code from PWA during MVS installation. MVS doesn't actually change anything involved in the customer's account creation or management, so MVS didn't break PWA, you will simply need to go back through each file and double check that you didn't undo any of the changes for PWA during MVS installation.

 

Good luck, Craig :)

Craig,

I would have believe that any other time but I disabled the mvs mod through the admin panel and the pwa showed up on the catalog like it was supposed to. I also agree that it does not affect account creation but it may call up a different login or the default login some how. I have checked breifly and there are some calls to login in the vendor files. In my includes/, I have a login_pwa and a login_acc so that means there is a chance that it may be calling up a different one in mvs. I will continue my research to find out where the call is made in mvs and I sure I can provide a fix for the problem since I know where it is. Thanks for the advice Craig. I will still double check my code just in case.

 

Mike

Edited by zorainic
Link to comment
Share on other sites

I hate doubling posting and even more so when I do it but the edit function was not available anymore on my previous post. I decided after trying the pwa original code and still getting the same results that I would look at other solutions so I tried to create a test account. I tried to login and cycled back through and never logged on. I guess only one thing left to do. Go through the code and find out where I broke it.

Link to comment
Share on other sites

Don't worry about my problem anymore unless you want the knowledge so you can help others. My partner decided we would axe the use of this mod for now. We think it is a wonderful modification for what it does though. Guess we are going with multistores mod for the different vendors.

Link to comment
Share on other sites

Hello

 

I've installed MVS recently to my Shop. Now i can define shipping methods for groups of products (but not for each product as said?). Anyway I've added the Shipping costs in the Admin without Tax. Tax class was choosen. But when i'm doing a test and buy some things in the Shop no Tax is added to the shipping costs but only to the products price - so there it works.

 

This is what i've entered:

 

Versandkosten nach Zonen

 

Enable Zones Method

True

 

Tax Class

Mehrwertsteuer

 

Sort Order

2

 

Zone 1 Countries

DE

 

Zone 1 Shipping Table

10:5.88,20:8.40,30:25.97,50:31.09,100:35.71,200:47.90,300:63.44537815,400:79.831

93277,500:96.63865546,600:109.2436975,700:126.0504202,800:149.5798319,900:161.344

5378,1000:168.0672269,

 

Zone 1 Handling Fee

0

 

Zone 2 Countries

 

 

Zone 2 Shipping Table

3:8.50,7:10.50,99:20.00

 

Zone 2 Handling Fee

0

 

Zone 3 Countries

 

 

Zone 3 Shipping Table

3:8.50,7:10.50,99:20.00

 

Zone 3 Handling Fee

0

 

 

Anyone can help me to get the Tax also added to the shipping costs?

Thanks

Edited by woodde
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...