Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

I'll keep working on it but my PHP knowledge is below basic, in fact all I know is that every line seems to have to end with a ; or { and I'm not sure why.

 

I guess I should try and find myself a PHP for Dummies book. :D

That's great. To be honest, that's pretty much what I did several years ago when I started playing OSC. Bought a book on php, and messed around a lot with the code. It's been a great learning process and certainly has enabled me to get things done I would not have had available before.

 

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

That's great. To be honest, that's pretty much what I did several years ago when I started playing OSC. Bought a book on php, and messed around a lot with the code. It's been a great learning process and certainly has enabled me to get things done I would not have had available before.

 

Good luck, Craig :)

 

 

What book?

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.

Link to comment
Share on other sites

Andrew: The only change that I can see in that code is the last line:

 'cost' => (SHIPPING_HANDLING + $cost));

should change to

   'cost' => $handling + $cost));

That looks like a complex module, so there may be more changes that aren't detailed out in the instructions. Post here if you need help with those. Oh, and please post code in code blocks (the # button above the input box.) It makes code easier to read.

 

As to PHP syntax, that's a complex subject. Basically, every line of code needs to end with a semicolon. The interpreter ignores line endings otherwise, so a "line" of code can span many lines of text in the file. It's often easier to read if you spread things out a bit, especially complex code like arrays and SQL commands. The braces {} surround the code that is executed by a conditional or loop (If, While, For, etc.) There should be a semicolon after the closing brace, but PHP doesn't care if you leave it off so most of us ignore it.

 

I can't give you any recommendations on books because I don't learn code that way. Just give me the reference manual and some code to play with and I'll figure it out. I learned what I know of PHP by looking at osCommerce and other open source code and looking things up in the reference. It all depends on how each person learns best: some need classes, some get it from a book, and a few of us learn best by just doing it.

 

Regards

Jim

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

Link to comment
Share on other sites

What book?

This is the one I started with:

PHP and MySql Web Developement I bought a used one for like $15 from somewhere. It was a great starter for me. I read through the first several chapters and then started playing with things using it as a reference when I got stumped. I also did a lot of searching on the web for specific code problems, very useful. There are a lot of reference and code tutorials on PHP and MySql out there. Just make backups of your files and play around with it, figure it out. Jim and I seem to have come by our knowledge much the same way, but Jim seems to have a better natural understanding of some of the more complex stuff than I do. He has helped me several times.

 

Just keep messing around with it and you'll be surprised what you can do.

 

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

Andrew: The only change that I can see in that code is the last line:
 'cost' => (SHIPPING_HANDLING + $cost));

should change to

   'cost' => $handling + $cost));

That looks like a complex module, so there may be more changes that aren't detailed out in the instructions. Post here if you need help with those. Oh, and please post code in code blocks (the # button above the input box.) It makes code easier to read.

 

As to PHP syntax, that's a complex subject. Basically, every line of code needs to end with a semicolon. The interpreter ignores line endings otherwise, so a "line" of code can span many lines of text in the file. It's often easier to read if you spread things out a bit, especially complex code like arrays and SQL commands. The braces {} surround the code that is executed by a conditional or loop (If, While, For, etc.) There should be a semicolon after the closing brace, but PHP doesn't care if you leave it off so most of us ignore it.

 

I can't give you any recommendations on books because I don't learn code that way. Just give me the reference manual and some code to play with and I'll figure it out. I learned what I know of PHP by looking at osCommerce and other open source code and looking things up in the reference. It all depends on how each person learns best: some need classes, some get it from a book, and a few of us learn best by just doing it.

 

Regards

Jim

 

Thanks Jim, I'll keep that # sign feature in mind for future code postings. I kind of figured that all I would have to change was what you mention but coming so something that different from what is in the instructions kind of through me back.

 

I've also been trying a bit to understand the different PHP commands while running a personal website using PHP Nuke but I do need to get myself a nice simple book for reference. I've checked my local library but those books which are not lost are written as if the reader is already above the basic learning level.

 

I'll keep working at the script and see how far I can get with it. :)

Link to comment
Share on other sites

Okay, I have finished doing all the edits and I'm receiving an error in Admin when trying to visit the categories section.

 

The error is a parse error, unexpected $ in admin/categories.php on line 1189 but when I checked the file, there is no line 1189. Total number of line is 1188.

 

Any thoughts?

Link to comment
Share on other sites

Okay, I have finished doing all the edits and I'm receiving an error in Admin when trying to visit the categories section.

 

The error is a parse error, unexpected $ in admin/categories.php on line 1189 but when I checked the file, there is no line 1189. Total number of line is 1188.

 

Any thoughts?

When this happens, it usually means that there is a line that shouldn't be there, a return, some spaces, something of that nature. Sometimes it can also be a missing closing tag earlier in code. Check to make sure all of these { has on of these } to match, all tags must close.

 

You've gotten this far, you'll get it.

 

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

When this happens, it usually means that there is a line that shouldn't be there, a return, some spaces, something of that nature. Sometimes it can also be a missing closing tag earlier in code. Check to make sure all of these { has on of these } to match, all tags must close.

 

You've gotten this far, you'll get it.

 

Craig :)

 

 

Ok, I counted all the { and } and found 1 } missing so I went and applied it near the end of the file because I don't know where to put it and I've notice that there can be a few { before coming to any }.

 

There error is now gone but categories is no longer displayed properly and the products are not being listed. Below is a screen shot of how the category menu is now coming up.

 

categoryscreenshot.gif

 

Andrew

Link to comment
Share on other sites

Ok, I counted all the { and } and found 1 } missing so I went and applied it near the end of the file because I don't know where to put it and I've notice that there can be a few { before coming to any }.

 

There error is now gone but categories is no longer displayed properly and the products are not being listed. Below is a screen shot of how the category menu is now coming up.

 

categoryscreenshot.gif

 

Andrew

 

Andrew,

 

Not sure what program you are using to edit your PHP with, but the program I use will highlight the opening and closing braces pair when you select one of the braces. This is a HUGE help in finding where the missing one might be at. As you have noticed there can be many nested brace pairs, and placing one in the wrong place will create all sorts of havac! I can vouch for this, as I too was once in your shoes - didn't know a lick about PHP. But over the past two months of installing contributions, understanding how things are put together, and a bunch of help from the wonderful osCommerce community on these forums, I have successfully installed over 70 contributions on my site (including multi-vendor shipping) and have it all (hopefully ;) ) working.

 

If your editor highlights the braces, I usually start with the last closing brace in a section of code, and see if the corresponding open brace is where it should be (this takes some practice of knowing where it should be) - usually after an IF statement or the like. Then I work my way up through the closing braces until they are all accounted for in the section of code. Typically when I have had a problem, I highlight the last brace, and there is no opening brace highlighted. That means there is one missing above it somewhere.

 

It can be very frustrating sometimes (spent hours trying to find the problem), but when it all works you will be pleased with your accomplishment.

 

Hang in there! :thumbsup:

 

John

Link to comment
Share on other sites

Hello all,

 

I've been reading through some of the posts in this thread and it looks like what I'm after, before installing it would someone mind answering some quick questions:

 

Is the module near enough complete now? I see it stills says alpha release but I've read elsewhere on these forums that it's almost release candidate now. Is this the case?

 

Also, what I'm trying to achieve I will try and describe below, can somone tell me if this module covers what I'm looking for... I tried to use the "individual product shipping" prices contribution but I'm struggling to make it work properly.

 

We use one courier service but charge 3 different rates per product, ie:

 

Normal everday items have a per item shipping charge when delivered to UK mainland

Items in our Christmas range have a flat rate shipping charge no matter how many you order for uk mainland delivery .

Delivery for off shore items can have a price calculated depending on weight once they go through the checkout proceedure.

 

If someone orders a regular item and a christmas item I'd want the two item postage charges added together and presented to them.

 

I wouldn't want them to have to select a postage cost - as I'd end up getting people trying to pay the mainland delivery rate for items delivered offshore etc etc

 

Will this module do what I require? and does it work in conjunction with the individual shipping rate module or should I uninstall this first?

 

Thanks in advance everyone! I'm quite impressed with the features of this module... wish I was good enough to code it myself!

 

Sam

Link to comment
Share on other sites

Andrew,

 

Not sure what program you are using to edit your PHP with, but the program I use will highlight the opening and closing braces pair when you select one of the braces. This is a HUGE help in finding where the missing one might be at. As you have noticed there can be many nested brace pairs, and placing one in the wrong place will create all sorts of havac! I can vouch for this, as I too was once in your shoes - didn't know a lick about PHP. But over the past two months of installing contributions, understanding how things are put together, and a bunch of help from the wonderful osCommerce community on these forums, I have successfully installed over 70 contributions on my site (including multi-vendor shipping) and have it all (hopefully ;) ) working.

 

If your editor highlights the braces, I usually start with the last closing brace in a section of code, and see if the corresponding open brace is where it should be (this takes some practice of knowing where it should be) - usually after an IF statement or the like. Then I work my way up through the closing braces until they are all accounted for in the section of code. Typically when I have had a problem, I highlight the last brace, and there is no opening brace highlighted. That means there is one missing above it somewhere.

 

It can be very frustrating sometimes (spent hours trying to find the problem), but when it all works you will be pleased with your accomplishment.

 

Hang in there! :thumbsup:

 

John

 

Hi John, the program I use is called Programmers File Editor. I did some searching in the help and it does do something similar to what you describe only it doesn't highlight but rather takes your cursor to the other end of the code.

 

Not sure if this will work but I thought I would // each line I was instructed to input and then remove the // from each section to find out which add-in is now causing what you see in the image above.

 

Andrew

Link to comment
Share on other sites

Ok, I counted all the { and } and found 1 } missing so I went and applied it near the end of the file because I don't know where to put it and I've notice that there can be a few { before coming to any }.

 

There error is now gone but categories is no longer displayed properly and the products are not being listed. Below is a screen shot of how the category menu is now coming up.

 

categoryscreenshot.gif

 

Andrew

Looking at your picture Andrew, I would suggest dumping this file and starting again. You seem to have more than just a bracket out of place. Your HTML tables are messed up as well.

 

Are you working with a file comparison tool as well? I have found it critical to my work. I use Winmerge, there are links in the MVS instructions I think, and it is free and very powerful. It may help with the modifications you need. It can also be valuable as a troubleshooting tool. Comparing the modified file with the original version can often lead right to the culprit.

 

Keep at it, 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

Looking at your picture Andrew, I would suggest dumping this file and starting again. You seem to have more than just a bracket out of place. Your HTML tables are messed up as well.

 

Are you working with a file comparison tool as well? I have found it critical to my work. I use Winmerge, there are links in the MVS instructions I think, and it is free and very powerful. It may help with the modifications you need. It can also be valuable as a troubleshooting tool. Comparing the modified file with the original version can often lead right to the culprit.

 

Keep at it, Craig :)

 

My categories.php is not the standard file because part of the Canada Post add-on is to modify this file so when adding the MVS entries, I made sure not to remove the lines of code for the Canada Post module.

 

Andrew

Link to comment
Share on other sites

Hello again, I seem to have almost everything working now except when I click on "Manage" in the Venor Manager admin menu.

 

I get the the error:

 

Fatal error: Cannot redeclare class in includes/modules/vendors_shipping/canadapost.php on line 20

 

That code is:

 

class canadapost {

 

I compared the canadapost file I did per instructions from module.txt to fedex1.php and it had basically the exact same line only instead of canadapost it's fedex1.

 

Andrew

Link to comment
Share on other sites

Hello again, I seem to have almost everything working now except when I click on "Manage" in the Venor Manager admin menu.

 

I get the the error:

 

Fatal error: Cannot redeclare class in includes/modules/vendors_shipping/canadapost.php on line 20

 

That code is:

 

class canadapost {

 

I compared the canadapost file I did per instructions from module.txt to fedex1.php and it had basically the exact same line only instead of canadapost it's fedex1.

 

Andrew

Well this SHOULD be fairly simple, that line is repeated somewhere above it. If it is not, not so simple anymore, that would mean that for some reason when the code is trying to look up the shipping modules, something is causing it to load that page twice.

 

Check the repeating possibility first and see what you find, 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

Well this SHOULD be fairly simple, that line is repeated somewhere above it. If it is not, not so simple anymore, that would mean that for some reason when the code is trying to look up the shipping modules, something is causing it to load that page twice.

 

Check the repeating possibility first and see what you find, Craig :)

 

There is no repeat HOWEVER I did go back and re-read the module.txt file just in case I had missed something...I did. After making this file I went a head and put a copy of it both under includes/modules/vendor_shipping and includes/lanuages/english/modules/vendor_shipping when I only needed to have it in the first while having the original in the second.

 

After putting the original under the languages folder I now see the entire list of shipping options but with Warnings messages.

 

At the very top of the list I receive;

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_CANADAPOST_ZONE_1 in /includes/modules/vendors_shipping/canadapost.php on line 85

 

The other warnings are listed next to each shipping option twice but goes away when I click on the install button to the right;

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_FEDEX1_SORT_ORDER_1 in /includes/modules/vendors_shipping/fedex1.php on line 120

 

Again, I have compared line 85 in the canadapost.php to the fedex1.php and again, do not see anything out of place.

 

Should I maybe post the canadapost.php file I put together using the instructions in module.txt in case someone following this thread is able to see an error?

 

I did get myself a book on PHP but it really isn't helping.

 

Andrew

Link to comment
Share on other sites

wow, i just spent the better part of 4 hours reading this thread, and it looks like this is what i need.

 

i'm going to attempt to install this contribution. i hope it goes well, and works...

 

i'll be sure to check back with updates on my install...

 

thanks in advance to all involved!

Link to comment
Share on other sites

While digging around the UPS XML I found some interesting stuff such as:

 

1. A packing algorithm that will fill up a box with goods, then move on to the next box, etc. I've been looking for this for a while, but it doesn't work- an error comes back on the shipping page saying a table is missing. The stock osC UPS XML contribution includes instructions for adding dimensional support to an osC store. I've seen some discussion on this topic on the MVS thread but haven't found any success stories. Has anyone gotten this working with MVS?

 

2. An option to have Time in Transit data displayed to the customer as (Integer) Business Days. This would get me closer, I would think, to being able to display ground to only certain customers, but Ground still comes back with the standard date format. Is this something hard coded into the module, or something on UPS' end? And more importantly, does it really matter? I'm looking for where the number of days in transit is returned for Ground shipments, and in what format, so I can try to come up with this check.

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.

Link to comment
Share on other sites

Hello All,

 

I've finally got round to checking through everything to do with this module and it seems to be exactly what I need. One question though.

 

Will it work with the individual product shipping price contribution (the one that adds an additional field to the product database).

 

This one:

http://www.oscommerce.com/community/contri...shipping+prices

 

Thanks in advance.

 

Sam

Link to comment
Share on other sites

Will it work with the individual product shipping price contribution (the one that adds an additional field to the product database).

 

Sam

It should, with one caveat: Since that contribution installs another shipping module, that module will have to be modified to work with MVS. There are modification instructions in the MVS distribution.

 

Regards

Jim

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

Link to comment
Share on other sites

ok, first set of problems, and i did a search, but didn't come up with anything, and don't remember seeing anything about these errors. it's most likely something in my install...

 

i set up two vendors, and in the store, put one item from each vendor in the cart, and hit checkout, and got the following errors...

 

Warning: shipping(includes/languages/english/modules/shipping/mltship.php): failed to open stream: No such file or directory in /home/xxx/public_html/shop/catalog/includes/classes/shipping.php on line 36

 

Warning: shipping(includes/languages/english/modules/shipping/mltship.php): failed to open stream: No such file or directory in /home/xxx/public_html/shop/catalog/includes/classes/shipping.php on line 36

 

Warning: shipping(): Failed opening 'includes/languages/english/modules/shipping/mltship.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/xxx/public_html/shop/catalog/includes/classes/shipping.php on line 36

 

Warning: shipping(includes/modules/shipping/mltship.php): failed to open stream: No such file or directory in /home/xxx/public_html/shop/catalog/includes/classes/shipping.php on line 37

 

Warning: shipping(includes/modules/shipping/mltship.php): failed to open stream: No such file or directory in /home/xxx/public_html/shop/catalog/includes/classes/shipping.php on line 37

 

Warning: shipping(): Failed opening 'includes/modules/shipping/mltship.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/xxx/public_html/shop/catalog/includes/classes/shipping.php on line 37

 

Fatal error: Cannot instantiate non-existent class: mltship in /home/xxx/public_html/shop/catalog/includes/classes/shipping.php on line 39

 

i have some other issues on the admin side, but i'm going thru this thread, and incorporating changes that were posted, so i'll see what happens with that once i get thru everything...

 

 

 

ok, first set of problems, and i did a search, but didn't come up with anything, and don't remember seeing anything about these errors. it's most likely something in my install...

 

i set up two vendors, and in the store, put one item from each vendor in the cart, and hit checkout, and got the following errors...

i have some other issues on the admin side, but i'm going thru this thread, and incorporating changes that were posted, so i'll see what happens with that once i get thru everything...

well, i don't know what i did, but i made another change to a file, and all those errors are gone... :)

 

i'll keep up to date with things...thanks again!

Edited by trustco
Link to comment
Share on other sites

ok, i'm getting the same error as posted above...

 

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_FEDEX1_SORT_ORDER_3 in /home/ultimate/public_html/shop/catalog/includes/modules/vendors_shipping/fedex1.php on line 120

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_FEDEX1_SORT_ORDER_3 in /home/ultimate/public_html/shop/catalog/includes/modules/vendors_shipping/fedex1.php on line 120

 

 

 

once i click "install" it goes away, and appears normal.

 

any suggestions?

Link to comment
Share on other sites

ok, it appears that i have the UPS rates working correctly, and such.

 

has anybody figured out how to get the USPS to work? i use USPS for almost all of my orders that i personally ship out, and that is a majority of my orders, so i really need this to work.

 

i have USPSmethods_v2.7 installed. i'm gonna go thru the module modification now, after a make a backup copy of the store, since it SEEMS to be working...

Link to comment
Share on other sites

another issue i have come across.

 

in the admin interface, under "Vendors Orders List", there is a column labelled "Email Sent?" and underneath, it shows "no" however, i do have automaticly send emails to vendors, which is not working. if i click "no" where shown above, i get the following error:

 

Parse error: parse error, unexpected '=' in /home/xxx/public_html/shop/catalog/admin/vendor_email_send.php on line 245

 

 

lines 244 thru 246 are as follows:

 

	  <?php } else { ?>
  <tr><?php echo tep_draw_form('mail', FILENAME_VENDORS_EMAIL_SEND,' . '&vID=' . $vendors_id . '&oID=' . $oID . '&vOS=' . $vOS); ?>
		<td><table border="0" width="100%" cellpadding="0" cellspacing="2">

 

any ideas?

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