Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

I apologize if I wasn't supposed to post this question to this forum.

But I thought that it was an appropriate place. I'm just trying to get the MVS contribution to work with the Admin w/access levels contribution. If this is not the appropriate place for this type of question, could you please let me know where I can ask such a question.

Thanks very much.

The fact that your posts have not been deleted yet suggests the osC team is not concerned with your work with osC Max.

 

You understand what is wrong: the vendor files need to be added to the "files" database for the Admin Access system. The lines you added are correct, but by enabling the vendor box afterward you now have 2 entries, you should probably delete the lines from the database and add them via the "Admin" control system: click on the 'Vendors' box in the list, enable the box, then click "Store Files", from there you need to add each new file from MVS. Be sure to add ALL vendor related files. After this, you should be ok to get started with MVS.

 

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: webmaster@blucollarsales.com

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!

Share this post


Link to post
Share on other sites
...

You understand what is wrong: the vendor files need to be added to the "files" database for the Admin Access system. The lines you added are correct, but by enabling the vendor box afterward you now have 2 entries, you should probably delete the lines from the database and add them via the "Admin" control system: click on the 'Vendors' box in the list, enable the box, then click "Store Files", from there you need to add each new file from MVS. Be sure to add ALL vendor related files. After this, you should be ok to get started with MVS.

 

Good luck, Craig :)

 

Dear Craig,

Thanks so much for the help, and for building this great contribution!

I didn't notice the "Store Files" button over there. I have now enabled all the files from MVS, and I can access all of them.

 

Here's another question for you. I need to build some of my own shipping modules, just using some php code. I have one vendor where I charge $9 for shipping a case to Eastern states, and $16 for shipping a case to Western states, where I define the states. I saw your instructions about modifying an existing shipping module for MVS, but is there any place that just explains a shipping module's code, so I know where to start with this? For starters, perhaps I could define 2 tables in the database, one for eastern states and one for western states, and this would be accessed to determine which one applies. Any other guidance on understanding how to write a new shipping module?

 

Thanks very much!

Regards,

-Lori-

Share this post


Link to post
Share on other sites
Jim or Craig,

 

at /admin/index.php I have an x in a box shot that I don't have an image "admin/images/categories/vendors.ico" what image do I need?


Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Share this post


Link to post
Share on other sites
Jim or Craig,

 

at /admin/index.php I have an x in a box shot that I don't have an image "admin/images/categories/vendors.ico" what image do I need?

Wade: there is an icon included in MVS V1.1, place it in the same directory and it will show for you.

 

Dear Craig,

Thanks so much for the help, and for building this great contribution!

I didn't notice the "Store Files" button over there. I have now enabled all the files from MVS, and I can access all of them.

 

Here's another question for you. I need to build some of my own shipping modules, just using some php code. I have one vendor where I charge $9 for shipping a case to Eastern states, and $16 for shipping a case to Western states, where I define the states. I saw your instructions about modifying an existing shipping module for MVS, but is there any place that just explains a shipping module's code, so I know where to start with this? For starters, perhaps I could define 2 tables in the database, one for eastern states and one for western states, and this would be accessed to determine which one applies. Any other guidance on understanding how to write a new shipping module?

 

Thanks very much!

Regards,

-Lori-

Lori: your welcome

 

Writing a shipping module can be a bit difficult. I would suggest you start with modifying one that is already written for your needs. You may need the "Multi-Zone" capabilities, the "Regions" module might also be the one to work with. Keep in mind any module you work with will need to be modified for MVS to begin with. Then, with some patience, you should be able create the functionality you need. Play around with the code and you will learn quickly, I did(sort of, LOL).

 

I am not aware of any written instruction or the like for the structure of a standard shipping module.

 

Good luck to you both, 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: webmaster@blucollarsales.com

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!

Share this post


Link to post
Share on other sites

Craig I have uploaded the iso file and I am still getting an x box


Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Share this post


Link to post
Share on other sites
Craig I have uploaded the iso file and I am still getting an x box

 

 

Nevermind I got it


Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Share this post


Link to post
Share on other sites

What I did on that is I convert from .ico to .gif file


Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Share this post


Link to post
Share on other sites

Craig and Jim-

 

I have been working on modifications to the checkout flow that would combine the shipping and payment pages into one. Somewhere along the way something has gone wrong with the MVS side of the things and the $shipping['vendor'] array is not being set properly. Specifically, when I get to checkout_confirmation.php no shipping information is displayed.

 

Where is the $shipping['vendor'] array set, and what would you look at if you had a problem like this?

 

Thanks

Stew


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
Craig and Jim-

 

I have been working on modifications to the checkout flow that would combine the shipping and payment pages into one. Somewhere along the way something has gone wrong with the MVS side of the things and the $shipping['vendor'] array is not being set properly. Specifically, when I get to checkout_confirmation.php no shipping information is displayed.

 

Where is the $shipping['vendor'] array set, and what would you look at if you had a problem like this?

 

Thanks

Stew

That array comes from checkout_shipping.php, approximately lines 81-135. That's the first place to start looking. If that code is working, then follow it back to the vendor_shipping class that generates the values to fill the array.

 

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
That array comes from checkout_shipping.php, approximately lines 81-135. That's the first place to start looking. If that code is working, then follow it back to the vendor_shipping class that generates the values to fill the array.

 

Regards

Jim

 

No- everything after

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

in that section doesn't work. For instance I tried the simple test of inserting $foo = 'bar'; directly below that line, then echoing $foo in the document and got nothing. Inserting $foo = 'bar'; directly above that line works fine.

 

So where is $HTTP_POST_VARS['action'] set, and what makes it = 'process'?


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
No- everything after
if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {

in that section doesn't work. For instance I tried the simple test of inserting $foo = 'bar'; directly below that line, then echoing $foo in the document and got nothing. Inserting $foo = 'bar'; directly above that line works fine.

 

So where is $HTTP_POST_VARS['action'] set, and what makes it = 'process'?

The action is set by the form on checkout_shipping.php, and executes when the customer clicks the Continue button. This page executes twice; The form submits to self and is then processed in the top part of the page. The code that you want is part of the code that executes the second time. This code checks and processes the data and forwards the customer to the checkout_payment page if everything has been completed correctly.

 

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
The action is set by the form on checkout_shipping.php, and executes when the customer clicks the Continue button. This page executes twice; The form submits to self and is then processed in the top part of the page. The code that you want is part of the code that executes the second time. This code checks and processes the data and forwards the customer to the checkout_payment page if everything has been completed correctly.

 

Regards

Jim

 

Ah yes, the form- I had somehow managed to lose the code that drew the form in the first place. In the end all sorts of weird things were happening. All is well now- on to the JavaScript.

 

Thanks for the help!

Stew


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

Next problem... it doesn't work :(

 

Now I get this:

 

Warning: reset(): Passed variable is not an array or object in /home/terramag/domains/terramaga.com/public_html/shop/includes/classes/vendor_shipping.php on line 48

 

Warning: Cannot modify header information - headers already sent by (output started at /home/terramag/domains/terramaga.com/public_html/shop/includes/classes/vendor_shipping.php:48) in /home/terramag/domains/terramaga.com/public_html/shop/includes/functions/general.php on line 33

 

anyone any ideas?

 

Thx!

Share this post


Link to post
Share on other sites

Considering upgrading from: mvs_0.9RC4.1+Roll-Up to mvs 1.1. Are the fixes/improvements signifigant? Is it worth the time?

 

If so any tips on upgrading would be appreciated.

 

Thanks.

Edited by digitalblue

Share this post


Link to post
Share on other sites
Next problem... it doesn't work :(

 

Now I get this:

 

Warning: reset(): Passed variable is not an array or object in /home/terramag/domains/terramaga.com/public_html/shop/includes/classes/vendor_shipping.php on line 48

 

Warning: Cannot modify header information - headers already sent by (output started at /home/terramag/domains/terramaga.com/public_html/shop/includes/classes/vendor_shipping.php:48) in /home/terramag/domains/terramaga.com/public_html/shop/includes/functions/general.php on line 33

 

anyone any ideas?

 

Thx!

The usual cause of this is not having at least one shipping module installed for every vendor.

 

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
Considering upgrading from: mvs_0.9RC4.1+Roll-Up to mvs 1.1. Are the fixes/improvements signifigant? Is it worth the time?

 

If so any tips on upgrading would be appreciated.

 

Thanks.

I would suggest holding off a bit, I am trying to get the next release finished which will have a number of updates that would be of interest to most users. I will try to do a better job with the instructions this time as well and hopefully include some instruction on upgrading an existing install.

 

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: webmaster@blucollarsales.com

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!

Share this post


Link to post
Share on other sites
...

Lori: your welcome

 

Writing a shipping module can be a bit difficult. I would suggest you start with modifying one that is already written for your needs. You may need the "Multi-Zone" capabilities, the "Regions" module might also be the one to work with. Keep in mind any module you work with will need to be modified for MVS to begin with. Then, with some patience, you should be able create the functionality you need. Play around with the code and you will learn quickly, I did(sort of, LOL).

 

I am not aware of any written instruction or the like for the structure of a standard shipping module.

 

Good luck to you both, Craig :)

 

Craig or Jim,

I'm trying to either write a new shipping module for MVS or modify an existing one.

I have one vendor with 2 products: a case of juice, and a trial pack of juice.

For the case of juice, the shipping cost is $9 or $16 per case, depending on the region.

For the trial pack, it is $5.50 or $7 per trial pack, depending on the region. There are 2 regions for this vendor, each consisting of a list of states.

I found a contribution that might work, but it's not as flexible as I want it to be. It is the pips (per item per state) shipping module, and it would let you have a single shipping cost per item, for each region. It just multiplies the number of items by the regional shipping cost to get the total shipping cost. This is a straight-forward one to modify for MVS. But, in my example, I would need to associate my 2 different products with 2 different vendors, since there are 2 different sets of regional shipping costs for the 2 different products.

 

What I'd like to do is associate the regional shipping costs with each product. So, the case of juice would have 2 different shipping costs associated with it and the trial pack would also have 2 different products associated with it.

(Allowing 5 possible regions, I would have 5 extra fields in the PRODUCT table. Is that too inefficient??)

This second method seems much more difficult to write. It is sort of a cross between the pips shipping module and the indvship module, which lets you associate a single shipping cost with each product.

But, this second method seems much more elegant and flexible. I plan to add another product to this vendor, and I don't want to have to create 3 different vendors to represent 1 real vendor, because the shipping costs are different.

 

If I do choose the second route, I'd really appreciate a little help. I've gotten a lot of it written, but I'm having trouble with the "quote" function. For the indvship module, the work from the quote function, where the shipping cost gets calculated, is done in shopping_cart.php, in the "calculate" function.

But, the shopping cart is not divided up by vendor, and the regions are associated with the vendors, so I don't know if this is where the work should get done.

In most of the shipping modules, the work of the quote function is done in the actual shipping module.

But, in this case, you really have to look at each product in the shopping cart that is associated with this vendor, since the regional shipping costs would be stored on the product.

 

I also found the vendor_shipping function in shopping_cart.php -- perhaps this could be used in the quote function? But it doesn't currently calculate the shipping cost. But it does divide up the shopping cart by vendor. So I could add to the vendor_shipping function to calculate the shipping cost. And I could call it from the quote function in my new module. Is that the right way to go??

 

Please help give me some direction in how to write this module. Am I on the right track? Any suggestions on how to write the quote function for this shipping module?

 

Thanks very much for any help with this.

 

Regards,

-Lori-

Share this post


Link to post
Share on other sites
Craig or Jim,

I'm trying to either write a new shipping module for MVS or modify an existing one.

I have one vendor with 2 products: a case of juice, and a trial pack of juice.

For the case of juice, the shipping cost is $9 or $16 per case, depending on the region.

For the trial pack, it is $5.50 or $7 per trial pack, depending on the region. There are 2 regions for this vendor, each consisting of a list of states.

I found a contribution that might work, but it's not as flexible as I want it to be. It is the pips (per item per state) shipping module, and it would let you have a single shipping cost per item, for each region. It just multiplies the number of items by the regional shipping cost to get the total shipping cost. This is a straight-forward one to modify for MVS. But, in my example, I would need to associate my 2 different products with 2 different vendors, since there are 2 different sets of regional shipping costs for the 2 different products.

 

What I'd like to do is associate the regional shipping costs with each product. So, the case of juice would have 2 different shipping costs associated with it and the trial pack would also have 2 different products associated with it.

(Allowing 5 possible regions, I would have 5 extra fields in the PRODUCT table. Is that too inefficient??)

<snip>

I would keep the calculation of the shipping costs in the quote method of your new shipping module. You can get data from other classes if you need to, but the work should be done in the module.

 

Since it appears that you would be using this for a relatively small number of products, I would put the shipping costs in a separate database table, linked to the Products table by the products_id. You could have a column for each zone, with a few spares for future zones. The module could then determine the zone from the customer's address and retrieve the correct shipping cost from this new table. You can copy part of the pips design for this.

 

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 would keep the calculation of the shipping costs in the quote method of your new shipping module. You can get data from other classes if you need to, but the work should be done in the module.

 

Since it appears that you would be using this for a relatively small number of products, I would put the shipping costs in a separate database table, linked to the Products table by the products_id. You could have a column for each zone, with a few spares for future zones. The module could then determine the zone from the customer's address and retrieve the correct shipping cost from this new table. You can copy part of the pips design for this.

 

Regards

Jim

Thanks very much, Jim!

A couple of questions:

- To calculate the shipping costs from within the new shipping module, would I just iterate through each product in $cart, check to see if it is associated with this vendor, and if so, get the shipping cost for this region and multiply by the quantity?

- And, in addition to adding the new shipping module file and language file, the only other changes needed would be:

-- modify admin/categories.php, where I would need to do some selects and inserts, and add to the input form so the values can be entered for a new product

-- write sql to create the new product shipping cost table

Is that correct? Any other changes I'd need to make?

 

Thanks so much for your help! I'm a real newbie at this, and I just want to make sure I don't go off in a totally wrong direction.

 

Regards,

-Lori-

Share this post


Link to post
Share on other sites
Thanks very much, Jim!

A couple of questions:

- To calculate the shipping costs from within the new shipping module, would I just iterate through each product in $cart, check to see if it is associated with this vendor, and if so, get the shipping cost for this region and multiply by the quantity?

- And, in addition to adding the new shipping module file and language file, the only other changes needed would be:

-- modify admin/categories.php, where I would need to do some selects and inserts, and add to the input form so the values can be entered for a new product

-- write sql to create the new product shipping cost table

Is that correct? Any other changes I'd need to make?

 

Thanks so much for your help! I'm a real newbie at this, and I just want to make sure I don't go off in a totally wrong direction.

 

Regards,

-Lori-

The module will only get called for products assigned to its vendor, so you can assume that all of the products it sees will use that module. You can get the products_id for each product from the vendor_shipping() method of the shopping_cart class ($cart). You can get the quantity for each product from the get_quantity() method in the same class. Then you just need to pull your shipping costs from your new database table and do the calculations.

 

You are correct in modifying admin/categories.php to allow the new values to be added. That's probably going to be the hardest part of the whole job. You can write SQL to add the new table or do it manually through phpMyAdmin.

 

That's all of the changes that I can think of.

 

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
The module will only get called for products assigned to its vendor, so you can assume that all of the products it sees will use that module. You can get the products_id for each product from the vendor_shipping() method of the shopping_cart class ($cart). You can get the quantity for each product from the get_quantity() method in the same class. Then you just need to pull your shipping costs from your new database table and do the calculations.

 

You are correct in modifying admin/categories.php to allow the new values to be added. That's probably going to be the hardest part of the whole job. You can write SQL to add the new table or do it manually through phpMyAdmin.

 

That's all of the changes that I can think of.

 

Regards

Jim

Jim,

Thanks so much for all the help! I'll let you know how it goes.

 

Regards,

-Lori-

Share this post


Link to post
Share on other sites

Hello Guys & Gals,

I am new to OsCommerce. I'm having a little issue with the vendor order list page when I use the MVS contrib. When you initially install MVS 1.1 and make an order, is the information automatically added into those fileds in the Orders by Vendor list? I'm not seeing anything show up. Am I missing some code? Also the link in that same page that says "Click To Send Email" is not a link at all. What am I missing?. Can anyone help?

 

Thanks.

Share this post


Link to post
Share on other sites
Hello Guys & Gals,

I am new to OsCommerce. I'm having a little issue with the vendor order list page when I use the MVS contrib. When you initially install MVS 1.1 and make an order, is the information automatically added into those fileds in the Orders by Vendor list? I'm not seeing anything show up. Am I missing some code? Also the link in that same page that says "Click To Send Email" is not a link at all. What am I missing?. Can anyone help?

 

Thanks.

 

I also have Downloads Controller Installed. Can some code be missing? Or something is not being referenced right? I am not seeing any orders show up in the Orders By Vendor page.

Share this post


Link to post
Share on other sites
The module will only get called for products assigned to its vendor, so you can assume that all of the products it sees will use that module. You can get the products_id for each product from the vendor_shipping() method of the shopping_cart class ($cart). You can get the quantity for each product from the get_quantity() method in the same class. Then you just need to pull your shipping costs from your new database table and do the calculations.

 

You are correct in modifying admin/categories.php to allow the new values to be added. That's probably going to be the hardest part of the whole job. You can write SQL to add the new table or do it manually through phpMyAdmin.

 

That's all of the changes that I can think of.

 

Regards

Jim

I've written a new module to work with MVS. I'm calling it pips2 (per item per state), where it lets you store a shipping cost for each region, for a product. I've gotten the admin pages to work so far, so that you can install the module, it will let you enter the regional shipping costs for a product, modify them, and remove them. I'm storing this info in a separate table in the db, as Jim suggested.

 

My problem comes in when I try to place an order for one of the products that has a vendor which uses this module.

When I get to checkout_shipping.php, it says:

"This is currently the only shipping method available to use on this order."

and it doesn't list any shipping methods.

If I click "continue", it just takes me back to the same page.

 

I tried tracing through some of the code with debugging statements.

In checkout_shipping.php, SELECT_VENDOR_SHIPPING is true, as expected.

$HTTP_POST_VARS['action'] does not have a value, so the section of code under

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

does not get executed. (I'm not sure if that is expected or not.)

 

In includes/classes/vendor_shipping.php:

In the shipping constructor,

pips2.php does show up as one of the modules.

 

Do you have any ideas about what might be wrong? Any suggestions on where I should look for problems?

 

Thanks very much for your help!

Regards,

-Lori-

Share this post


Link to post
Share on other sites
<snip>Can some code be missing? Or something is not being referenced right? I am not seeing any orders show up in the Orders By Vendor page.

This page gets its data from the database, so that's the first place to check. Look at the orders_shipping table. Are all of the columns populated for your test orders? You can use the orders_id to reference specific orders. The shipping_tax may be zero, but the others should contain something other than the default value. Are the values there? If not, you have missed some of the code that populates this table. Try checking checkout_process.php for missing edits.

 

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

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

×