Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

When you go into the manage vendor here is what it shows, and I'm pretty sure this is an error HAHA.

Tates, did you install the shipping modules? Even though they are included with the package, you still need to click on the Install button for each module you want to use with each vendor you have setup.

 

Good Luck

Rick Knight

Link to comment
Share on other sites

Did you upload the MVS version of includes/application_top.php? Look in that file for this code (line 73):

//MVS Start
// set the vendor shipping constants
 $vendor_configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_VENDOR_CONFIGURATION);
 while ($vendor_configuration = tep_db_fetch_array($vendor_configuration_query)) {
   define($vendor_configuration['cfgKey'], $vendor_configuration['cfgValue']);
 }
//MVS End

 

Similar code should be in admin/includes/application_top.php (line 195).

 

Regards

Jim

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

Link to comment
Share on other sites

YAY, thanks for the help guys I got all of it to work. Somehow I skipped the admin application_top file. (how I did that??) Well thanks for all of the help guys I can finally get my site rolling now!!!

Link to comment
Share on other sites

Did you upload the MVS version of includes/application_top.php? Look in that file for this code (line 73):

//MVS Start
// set the vendor shipping constants
?$vendor_configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_VENDOR_CONFIGURATION);
?while ($vendor_configuration = tep_db_fetch_array($vendor_configuration_query)) {
? ?define($vendor_configuration['cfgKey'], $vendor_configuration['cfgValue']);
?}
//MVS End

 

Similar code should be in admin/includes/application_top.php (line 195).

 

I have installed the MVS module from your link and have some questions. It appears that some downloaded files, in the Admin section if I recall, were already modified and did not need any changes, while other files did need to be modified. I think I made all the necessary changes but I might have missed something. I don't understand why some modified files were included while others needed modification.

 

I found the discussion about repressing the error message regarding the Shipping_Modules constants, modified the code, and no longer get error messages in the Vendors Shipping Modules.

 

Here is my problem. When I try to order a non-freight product, the UPS shipping method is chosen and weight indicated but no shipping prices are presented. I can now proceed with processing the order but without shipping prices. Hopefully this is just a configuration issue on my part.

 

What I want to do is have most items ship by UPS but certain items by freight only. For freight items, I would like to notify the customer at checkout that one or more items ship by freight and they will receive a freight quote by email.

 

I have set up two vendors, one "My Company" and the other "My Company-Freight" with indentical configuration, other than Vendor ID and no shipping method for My Company-Freight. What am I missing to provide shipping quotes for most and a freight message for freight items?

Link to comment
Share on other sites

All of the modified files should be included in the distribution. If you know of file(s) that are missing please let us know which ones. The modification instructions are for those who have already modified their files and cannot simply replace them.

 

Check to make certain that MVS is turned on: Admin > Configuration > My Store > Use vendor shipping? should be set to true. UPS should work properly if you have it set up correctly. You need to have both the module settings and the Vendor address settings correct.

 

For your freight shipping you will need to modify a module to provide your text output and a cost of $0. The Flat module would be the easiest to modify. Use the version in the distribution, as all of the modules have been modified to work with MVS.

 

Regards

Jim

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

Link to comment
Share on other sites

All of the modified files should be included in the distribution. If you know of file(s) that are missing please let us know which ones. The modification instructions are for those who have already modified their files and cannot simply replace them.

 

Check to make certain that MVS is turned on: Admin > Configuration > My Store > Use vendor shipping? should be set to true. UPS should work properly if you have it set up correctly. You need to have both the module settings and the Vendor address settings correct.

 

For your freight shipping you will need to modify a module to provide your text output and a cost of $0. The Flat module would be the easiest to modify. Use the version in the distribution, as all of the modules have been modified to work with MVS.

 

Thanks for the quick response.

 

In Admin > Configuration > Shipping/Packaging > Enable Vendor Shipping is set to true.

 

Shipping fees are not being presented. UPS Shipping Method is identified along with the weight.

 

If I set Enable Vendor Shipping to false, the shipping fees for UPS are shown, apparently using the original shipping files.

 

Am I still missing some configuration setting?

Link to comment
Share on other sites

Possibly. In Admin > Vendors > Vendor Manager > (vendor name), check the address details. I know that UPS uses the Zip code and Country from here. I don't remember if it uses the rest of the address.

 

Then click the Manage button for that vendor and check that all of the information installed with the UPS module is correct. Try turning on all of the shipping methods at the bottom of the UPS edit menu. If you still don't get a quote, find this line in includes/modules/vendors_shipping/ups.php (line 352):

/*
   mail('[email protected]','UPS response',$body,'From: <[email protected]>');
*/

Now remove the comment marks and change the email addresses to yours. Request another quote and you should get an email with all of the information sent to UPS. That may give a hint as to what's missing.

 

Regards

Jim

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

Link to comment
Share on other sites

Possibly. In Admin > Vendors > Vendor Manager > (vendor name), check the address details. I know that UPS uses the Zip code and Country from here. I don't remember if it uses the rest of the address.

 

Then click the Manage button for that vendor and check that all of the information installed with the UPS module is correct. Try turning on all of the shipping methods at the bottom of the UPS edit menu. If you still don't get a quote, find this line in includes/modules/vendors_shipping/ups.php (line 352):

/*
? ?mail('[email protected]','UPS response',$body,'From: <[email protected]>');
*/

Now remove the comment marks and change the email addresses to yours. Request another quote and you should get an email with all of the information sent to UPS. That may give a hint as to what's missing.

 

 

That did it. I carefully checked the addresses and then turned on all of the shipping methods at the bottom of the UPS edit page. I could even turn all those options back off again and it still works.

 

Incidently, the label for those options within the UPS edit page is the following:

 

Shipping Methods

Select the USPS services to be offered.

 

Shouldn't that label be UPS?

 

Tomorrow I'll tackle the email for freight. Thanks again.

Link to comment
Share on other sites

Yes it should be UPS. The change can be made in the vendor_configuration table in the database. Thanks for noticing that; we'll get the fix in the next release.

 

Regards

Jim

Edited by kymation

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

Link to comment
Share on other sites

Hello,

 

From the notes here, It looks like this contrib may be ready for somewhat less experienced developers. Is that true? Would that be a true statement? Can anyone verify that this contrib would allow many vendors to share a website and payment processing, with each vendor receiving notification of the sales that they must ship? If this is the case, how does the money exchange hands?

Link to comment
Share on other sites

Yes it should be UPS. The change can be made in the vendor_configuration table in the database. Thanks for noticing that; we'll get the fix in the next release.

 

Regards

Jim

 

I've got everything working in MVS for both non-freight and freight items. I modified the Flat Rate file and my message appears informing the customer that shipping charges for freight items will be emailed.

 

But how do I remove "Best Way" for shipping when a freight item is showing my custom message? I could not find the file that contains Best Way.

Link to comment
Share on other sites

Has anyone else verified the bug in MVS where you can checkout without any shipping charges? I have verified it on the MVS test site. I have not seen any posts about it since I first posted it.

 

To verify that it exists all you have to do is go to checkout click continue on the shipping page and then if you go back to the shipping page no default shipping method is selected and you can then checkout without shipping charges applied.

 

I have tried ideas to fix it, but I am not a coder so I was not able to fix it. This is the one bug that is keeping me from using MVS on my production site. Any help is welcome.

 

Sean Hawkes

Link to comment
Share on other sites

Has anyone else verified the bug in MVS where you can checkout without any shipping charges? I have verified it on the MVS test site. I have not seen any posts about it since I first posted it.

 

To verify that it exists all you have to do is go to checkout click continue on the shipping page and then if you go back to the shipping page no default shipping method is selected and you can then checkout without shipping charges applied.

 

I have tried ideas to fix it, but I am not a coder so I was not able to fix it. This is the one bug that is keeping me from using MVS on my production site. Any help is welcome.

 

Sean Hawkes

 

Yes, I was about to report this same behavior today but the circumstances are difficult to duplicate. Once you select, for example Ground for UPS, that option will usually be selected by default on all following orders. In my case, I am using only UPS for most products/Vendor A and my modified Flat Rate for freight items/Vendor B.

 

I also confirmed this behavior when MVS is set to false but it seems that osC will catch the lack of a shipping selection and not proceed to the Payment section until you select a shipping charge radio button. With MVS enabled, it does not stop and will proceed with the order without any shipping charge. When I'm using my custom Flat Rate with MVS for items where freight charges will be sent via email to the customer, that behavior is desirable.

 

It appears to me that perhaps a variable is being set the first time a shipping charge is designated. From that point on, the same radio button as the previous order is selected by default. At least that is how it usually works.

 

In trying to test this just now, I tried a dozen or more times and could not repeat the behavior of no shipping charge radio button selected by default. I kept toggling MVS shipping from True to False and placing orders. Then for some strange reason, the behavior appeared and remained in effect for 6 or so consecutive orders with no server reboot.

 

All would be fine if MVS would not proceed with the order with no shipping charges designated for UPS, or Fed Ex, etc. Or if it selected the cheapest shipping radio button by default. But I need my custom Flat Rate to continue processing as it does now.

Link to comment
Share on other sites

I did see this behaviour a couple of times when I was woking on the early development software, but I haven't seen it in the last couple of versions. I had assumed that it was a configuration error, or an early bug that had already been fixed. Apparently I was wrong.

 

osCommerce passes a large number of variables between pages with a variety of methods. I believe that all of the original variables are still passed. MVS adds a new method to the shopping_cart class that passes several variables, and there are some other modifications that pass additional data. It is possible that one of the modifications to the code interferes with one of the original variables. If no shipping method is selected, the code should automatically default to the cheapest available shipping method. That would solve the problem of having no shipping at all, but apparently this is not working as well.

 

Since the described behaviour does not occur every time, it would appear that the bug is in code that is not executed every time. It may be in one of the shipping modules. For those of you who see this happening, please post which module or modules are being used when this happens. I'll try to get my test site to reproduce this bug. If I can get it to repeat, I can track it down.

 

Regards

Jim

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

Link to comment
Share on other sites

I did see this behaviour a couple of times when I was woking on the early development software, but I haven't seen it in the last couple of versions. I had assumed that it was a configuration error, or an early bug that had already been fixed. Apparently I was wrong.

 

osCommerce passes a large number of variables between pages with a variety of methods. I believe that all of the original variables are still passed. MVS adds a new method to the shopping_cart class that passes several variables, and there are some other modifications that pass additional data. It is possible that one of the modifications to the code interferes with one of the original variables. If no shipping method is selected, the code should automatically default to the cheapest available shipping method. That would solve the problem of having no shipping at all, but apparently this is not working as well.

 

Since the described behaviour does not occur every time, it would appear that the bug is in code that is not executed every time. It may be in one of the shipping modules. For those of you who see this happening, please post which module or modules are being used when this happens. I'll try to get my test site to reproduce this bug. If I can get it to repeat, I can track it down.

 

Regards

Jim

On the MVS demo site and on my test site I can make it happen every time.

 

Sean

Link to comment
Share on other sites

I think I may need to clarify the problem. If you go to checkout the cheapest method is selected by default. If you continue to the payment page or confirmation page but don't complete the order and go back to the shipping page that is when the problem occurs. If you log out and close your browser then go back it is ok until you pass the shipping page again, then the problem is there again.

 

Sean

Link to comment
Share on other sites

I think I may need to clarify the problem. If you go to checkout the cheapest method is selected by default. If you continue to the payment page or confirmation page but don't complete the order and go back to the shipping page that is when the problem occurs. If you log out and close your browser then go back it is ok until you pass the shipping page again, then the problem is there again.

 

Sean

 

Yes, I can duplicate this every time as you describe. With MVS enabled and a shipping radio button active, if you proceed to the Payment page but then click on the Check Out link in the upper right, clicking on the Check Out button erases the radio button selection. Then when you click Continue, you proceed to the Payment page with no shipping charges.

 

Again, if MVS is not enabled and no shipping radio button is selected, clicking the Continue button causes the cheapest radio button to activate. You must click again to proceed but shipping charges are then in effect. This would be fine if it behaved this way in MVS.

Link to comment
Share on other sites

I finally stole some time to look at this. I think that I have it fixed, but I need some help testing. If you can, please test and let us know if it works for you.

 

All changes are in includes/modules/vendor_shipping.php. First, find this code (line 84):

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

and replace it with:

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

Next, find this code (line 186):

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

and replace it with:

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

 

Regards

Jim

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

Link to comment
Share on other sites

I finally stole some time to look at this. I think that I have it fixed, but I need some help testing. If you can, please test and let us know if it works for you.

 

All changes are in includes/modules/vendor_shipping.php. First, find this code (line 84):

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

and replace it with:

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

Next, find this code (line 186):

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

and replace it with:

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

 

Regards

Jim

So far it looks like you got it. I will continue to try and break it, but it looks good.

 

Sean

Link to comment
Share on other sites

I finally stole some time to look at this. I think that I have it fixed, but I need some help testing. If you can, please test and let us know if it works for you.

 

All changes are in includes/modules/vendor_shipping.php. First, find this code (line 84):

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

and replace it with:

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

Next, find this code (line 186):

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

and replace it with:

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

 

Regards

Jim

 

It looks like one thing has been fixed. If you interrupt the check out process and then continue to check out again, the shipping radio button remains chosen.

 

But the first time one logs in there is no default shipping charge and one can continue to the Payment page without any shipping radio button enabled. Then you can log out and back in again and repeat the process where there is no default shipping and none required when you continue.

 

If MVS is set to false and one attempts to continue with no shipping charges, the cheapest shipping is selected before advancing to the Payment page.

Link to comment
Share on other sites

Oops, missed one. That first change (line 84 of includes/modules/vendor_shipping.php) should be:

    if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) ) )  $shipping['vendor'][$vendor_id] = $shipping_modules->cheapest($vendor_id);

 

Regards

Jim

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

Link to comment
Share on other sites

Oops, missed one. That first change (line 84 of includes/modules/vendor_shipping.php) should be:

 ? ?if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) ) ) ?$shipping['vendor'][$vendor_id] = $shipping_modules->cheapest($vendor_id);

 

Regards

Jim

 

If there is no default shipping charge, one can still proceed to the Payment page without adding a shipping charge. I have discovered the sequence which will present UPS shipping with no radio button selected. This sequence will likely erase a shipping variable or similar:

 

1) Order an item with no shipping charge/freight (uses modified flat.php)

2) Proceed with check out to Payment page.

3) Go back and add another product which normally has shipping.

 

This will present a set of shipping radio buttons with none selected. One can continue to Payments and not have any shipping charges assigned. This only happens if the freight item is the first product which is processed to the Payment page and then another non-freight product is added.

 

Everything works fine if a freight item is added to the cart (without proceeding to the Payment page) and then other, non-freight items are added to the cart. But if default shipping is erased, it remains in effect unless the customer chooses a shipping radio button or one logs out and back in again.

 

Here is my modified (MVS version) flat.php code with the changes starting around line 119:

 

 $this->quotes = array('id' => $this->code,
? ? ? ? ? ? ? ? ? ? ? ? ? ?//'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
? ? ? ? ? ? ? ? ? ? ? ? ? ?'module' => 'Shipping charges for freight items will be emailed to you.',
? ? ? ? ? ? ? ? ? ? ? ? ? ?'methods' => array(array('id' => $this->code,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'title' => '',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'cost' => $shipping)));

Edited by BlueLaredo
Link to comment
Share on other sites

If there is no default shipping charge, one can still proceed to the Payment page without adding a shipping charge. I have discovered the sequence which will present UPS shipping with no radio button selected. This sequence will likely erase a shipping variable or similar:

 

1)  Order an item with no shipping charge/freight (uses modified flat.php)

2)  Proceed with check out to Payment page.

3)  Go back and add another product which normally has shipping.

 

This will present a set of shipping radio buttons with none selected. One can continue to Payments and not have any shipping charges assigned. This only happens if the freight item is the first product which is processed to the Payment page and then another non-freight product is added.

 

Everything works fine if a freight item is added to the cart (without proceeding to the Payment page) and then other, non-freight items are added to the cart. But if default shipping is erased, it remains in effect unless the customer chooses a shipping radio button or one logs out and back in again.

 

Here is my modified (MVS version) flat.php code with the changes starting around line 119:

 

 $this->quotes = array('id' => $this->code,
                           //'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
                           'module' => 'Shipping charges for freight items will be emailed to you.',
                           'methods' => array(array('id' => $this->code,
                                                    //'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
                                                    'title' => '',
                                                    'cost' => $shipping)));

I can get it to happen in my test shop also. I have two test vendors, one uses USPS only the other USPS and UPS. If I start to checkout with products from just one vendor it is ok, but if I go back and add a product from the second vendor the second vendors shipping options has none preselected.

 

Sean

Link to comment
Share on other sites

One more special case -- replace the same code as above with this:

    if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ( $shipping == false || ( !isset($shipping['vendor'][$vendor_id]) ) ) ) )  $shipping['vendor'][$vendor_id] = $shipping_modules->cheapest($vendor_id);

Let's see how many people can break it this time.

 

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