Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

By "worked at one time" I mean that it probably worked on osCommerce 2.2 MS2 running on PHP 4.4 and MySQL 3. Or something like that. Most of the code has had upgrades over the years, but it looks like that file was never updated to run on a modern server.

 

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

Thanks for the file. That gives me the exact same results. So at this point, my best guess is that there is some order id or vendor id that is being left out of the order table at the point of order creation. Can you please tell me which file controls the order being added to the database table? Is it checkout_process.php?

Share this post


Link to post
Share on other sites

Hey Jim,

 

It looks like I am getting somewhere here. I uncommented the 2 print orders query statements in the file that you sent me and one of them displayed the queries and listed 4 id's. That worked. The problem now is that the part where it's supposed to list the results and turn them into hyperlinks is still not working. I believe that is this section of code in the orders_by_vendor.php file:

    while ($vendors_orders = tep_db_fetch_array ($orders_query) ) {
      $date_purchased = $vendors_orders['date_purchased'];

?>
                  <tr class="dataTableRow">
                    <td class="dataTableContent" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $vendors_orders_data['orders_id'] . '&action=edit') . '" TARGET="_blank"><b>View this order</b></a>'; ?></td>
                    <td class="dataTableContent" align="left"><?php echo $vendors_orders['orders_id']; ?></td>
           <!--     <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=new_product&pID=' . $vendors_orders_data['v_products_id']) . '" TARGET="_blank"><b>' . $vendors_products_data['products_name'] . '</a>'; ?></td>  -->
                    <td class="dataTableContent"><?php echo ' from <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $vendors_orders['customers_id'] . '&action=edit') . '" TARGET="_blank"><b>' . $vendors_orders['customers_name'] . '</b></a>'; ?></td>
                    <td class="dataTableContent" align="left"><?php echo strip_tags($vendors_orders['order_total']); ?></td>
                    <td class="dataTableContent" align="left"><?php echo tep_date_short ($date_purchased); ?></td>
                    <td class="dataTableContent" align="left"><?php echo $vendors_orders['orders_status_name']; ?></td>
                    <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_VENDORS_EMAIL_SEND, '&vID=' . $vendors_id . '&oID=' . $vendors_orders_data['orders_id'] . '&vOS=' . $vendors_orders_data['vendor_order_sent']) . '"><b>' . $vendors_orders_data['vendor_order_sent'] . '</a></b>'; ?></td>
                  </tr>
<?php

​Does any of that look incorrect? I am not sure how to print out individual results from each line to see where the problem is.

 

Thanks,

Randy

Edited by randyroy

Share this post


Link to post
Share on other sites

Yes, checkout_process.php is where all of the order data is saved to the database.

 

I suggest that you use your host's database management tool to look at the orders table in your database. Look for columns that have no data, especially vendors_id and status. You can also try taking one of the queries that the query test statements printed out and plug that into the SQL box. A blank result would confirm that the problem is in the database.

 

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 have data in all fields in the orders table except the 4 cc credit card fields, and the suburb fields. (I would guess this is correct since those aren't used in this store.) The only other field in question is the orders_date_finished field which has NULL for all 6 orders in the store currently.

 

Also, the queries use variables for languages_id and vendor_orders_data['orders_id']. I am not sure how to rewrite the query for running it directly in phpMyAdmin.

 

Thanks,

Randy

Share this post


Link to post
Share on other sites

Uncomment the two query print lines like you mentioned above. Then view the page, and select one of the queries that it prints out.

 

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

Correction. I don't have a vendors_id field in the orders table. But looking back through the code, I don't see where it pulls that value directly from the orders table. I do have an orders_status field and there is data for each order in this field. The same is true for the orders_id fields.

Share this post


Link to post
Share on other sites

The vendors_id is used in the $vendors_orders_data_query to select the orders that pertain to that vendor. That information is then used in the orders query to retrieve the information on those orders.

 

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

Ok. I think I see the problem. I looked at the orders_products table and all of the products in all of the orders have a vendors_id of 1. So whenever an order is placed in the store, the vendors_id is set to 1. Can you please tell me which file is responsible for setting the vendors_id in the orders_products table when the order is entered? I would bet there is a static entry in that file that was changed at some point for testing.

 

Thanks,

Randy

Share this post


Link to post
Share on other sites

All of the data is saved in checkout_process.php. $vendors_id is extracted around line 154, at the start of the MVS section.

 

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

Hello,

 

I'm looking for an addon to add multi vendors, each vendor have his own access, catalog, reports, etc..

 

goes this addon help ? or it is just for multiple shipping ?

 

demo links broken.

Edited by Psytanium

Share this post


Link to post
Share on other sites

This addon handles shipping only. I don't know of one that does what you want.

 

The demo pages were for the original version of MVS that ran on osCommerce 2.2, so they would be useless anyway.

 

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

Hello it seems that there is still a huge community behind the mvs - thats great!

 

I have a integrated MVS into OsCommerce 2.3 and my hosting is going to upgrade my php Version to 5.4. Now I'm getting an error during the checkout:

 

Warning: Illegal string offset 'id' in xxx/includes/classes/vendor_shipping.php on line 48

Warning: Illegal string offset 'id' in xxx/includes/classes/vendor_shipping.php on line 48

Warning: Cannot modify header information - headers already sent by (output started at /is/htdocs/wp11108156_NTRJ7UJ9SV/librumstore/includes/classes/vendor_shipping.php:48) in xxx/librumstore/includes/functions/general.php on line 50

 

Here is my vendor_shipping.php script starting at line 48:

 if ( (is_string($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $modules_array)) ) {
		  
		  
        $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')),
                                   'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));
      } else {
        reset($installed_modules_array);
                foreach ($installed_modules_array as $value) {
                  $class = substr($value, 0, strrpos($value, '.'));
                  $include_modules[] = array('class' => $class, 

Is this a ovious problem? Is there a solution you can give?

Share this post


Link to post
Share on other sites

MVS has never had a huge following. There are a few dedicated users , but that's it.

 

Anyway, change that line 48 to this and your error should go away:

      if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $modules_array)) ) {

You may find other errors as well. If you do, try comparing your files to the latest version of MVS, as it seems to run on PHP 5.5.

 

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 don't know, you'll have to ask @@burt. I haven't seen any progress reports recently.

 

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

All,

A question, I have a site where someone else installed MVS. It works and operates without issue.

We want to invoke free shipping for a specific minimal “total” order dollar amount regardless of the vendor. At first, attempted to setup free shipping with each vendor from within Vendor Management in MVS, it worked however, it was calculated on the dollar amount for that vendor and not total order dollar amount. For example; set all vendors free shipping be to $100 minimal. A customer has 150.00 total order. $101.00 comes from vendor A and $49.00 from vendor B. The shipping checkout would show free shipping for vendor A but calculated or charges for shipping for vendor b because the total for that vendor is less than $100.00. Then we attempted to go into normal OSC shipping and setup free shipping there (and left MVS running) and and turned on its free shipping with at $100.00. Now, this seem to work perfect. The shipping check out page would properly display free shipping for each group of vendor products if the order was over $100.00 and if the total order amount as below $100.00 if would show a break for shipping by vendor. However, there was an issue that set the checkout process into an endless loop. At the final page of checkout. There was an error to the user stating they “have not selected a shipping method” and will take them back to the checkout shipping page.

I am assuming that I am missing how to configure free shipping based on a total order amount with MVS. Can someone advise me on the proper configuration to setup MVS with free shipping but based on the total order amount and the not the total amount by vendor?

Also, one other issue I noticed is that the final checkout page does not display the total shipping amount in the cost line items. The total is correct but just prior to a user entering their CC info and finalizing the transaction it is missing the total shipping amounts from MVS.

Thanks for your assistance!

Share this post


Link to post
Share on other sites

Due to the way MVS calculates shipping by vendor, I don't believe that it is possible to set free shipping based on the total across all vendors. It should be possible to change the stock osCommerce free shipping code to have an associated vendor, which would get it past the checks for a selected shipping method, but that would require some core code changes.

 

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

Jim,

Could you explain a bit more by what you mean by:

    It should be possible to change the stock osCommerce free shipping code to have an associated vendor

 

If it is assocated to a vendor, is that not the same as the free shipping within MVS? Sorry, just attempting to understand.

 

Thanks,

Edited by nbkvh1i

Share this post


Link to post
Share on other sites

MVS looks for shipping modules that have been selected by the customer, and it does this by vendor. The stock osCommerce free shipping code does not have a vendor associated, so is not found in the checkout process, and the customer is bounced back to the shipping page to select an MVS module.

 

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

Jim,

Where does this check take place (which PHP file)? I am thinking if I can get an understanding of the check logic I maybe able to do what you're suggesting.

 

Also, I would assume we have this same issue for some type of logic around a coupon code for discount or free shipping? Is that correct?

 

Thanks for all your help!

Ed

Share this post


Link to post
Share on other sites

The check is in the top of checkout_payment.php, lines 21 - 25. The array is set in the vendor_shipping.php shipping class.

 

Yes, anything that changes the shipping need to be modified to work with MVS.

 

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

Hate to keep asking but a thought came to mind. What if I wrapped the check in checkout_payment with logic that follows something like; If OSC's  Free Shipping is enabled and total order amount is greater than then min amount set in OSC's value in free shipping module/table? That way if OSC free ship is enable and the order is over the amount the check is not needed and thus we skip it. But, it not then check for a select shipping method is required and send the user/customer back to the shipping checkout page. Would there be any other issues that you can think of? Just asking because that may be simipler than try to retro fit the OSC Free Shipping to MVS.

Share this post


Link to post
Share on other sites

I don't believe that the order total is available at that point, but it has already been used to determine if the order qualifies for free shipping so it shouldn't be needed. Just check for the stock free shipping and bypass the check code if it is set.

 

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

×