Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

Going to start over from scratch. Did the catalog side today using compare and merge. Saw no diffs except for possible differencies in 2.3x and 2.33. Must be on the admin side.

 

What version is the alpha version based?

 

thanks!!

Link to comment
Share on other sites

That was done on a heavily modified 2.3.1. I haven't had the time to clean it up and port it to 2.3.3. There should not be that many differences with 2.3.3, and probably none inside the MVS change blocks.

 

Regards

Jim

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

Link to comment
Share on other sites

That was done on a heavily modified 2.3.1. I haven't had the time to clean it up and port it to 2.3.3. There should not be that many differences with 2.3.3, and probably none inside the MVS change blocks.

 

Regards

Jim

 

I didn't find any diffs in the MVS sections. The hardest is the admin/category file. MVS, Header Tags, SEO URLS and Add More Fields like being in the same places. If you look at the checkout_ files and compare them from the files in 2.3.3 you can see some changes, but I doubt that's what's causing the problem since I have tried using the files from the mvs package and still get the same errors.

 

Pretty sure its on the admin side.

Link to comment
Share on other sites

  • 1 month later...

Merry 1st day back to work after Christmas, fellow MVS-ers!

 

I seem to have lost track of how vendors_prod_comments is ever displayed to the customer. I've been digging through old files and old downloads of MVS but I can't figure it out.

 

Am I mistaken? What is this field used for and where does it show on the customers side?

 

Thanks in advance for any insight.

 

~Motorcity

Link to comment
Share on other sites

I haven't ever used this field, but I think it was intended to only show on the Admin side. You could make it show on the store side if you wanted to add some code to do that.

 

Regards

Jim

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

Link to comment
Share on other sites

I haven't ever used this field, but I think it was intended to only show on the Admin side. You could make it show on the store side if you wanted to add some code to do that.

 

Regards

Jim

 

Thanks Jim,

No wonder I couldn't find it!

Link to comment
Share on other sites

I have a photography website that I made using iWeb on my macbook. I am now trying to get to the point where I can set things up to sell prints, canvas prints, and photo books on my site. My host provider has oscommerce as one of the options to utilize.

I think I have the products portion okay, but am having difficulty understanding the shipping portion. My plan is to utilize the same shipping methods and rates that my online lab utilizes. Those are USPS, UPS 2nd day, and UPS overnight. Each seem to be set up with a basic rate for one item and additional per unit above that. I would like to have my customers place the order on my site, pay, hopefully using the paypal system (which I still need to add onto my site), and I will place the order through my 'lab' with the products being directly shipped to the customer.

Is this all possible, and, if so, can anyone please help me get there? As I read through the forum topics and discussions, I very quickly get lost with the codes, modules, add ons, etc. I really am green to all this and don't have much of a clue where to go from here.

Any help would be greatly appreciated.

Link to comment
Share on other sites

1. Do you need different shipping methods for different groups of products, or do you want to offer all three for all products? The former requires MVS, while the latter is stock osCommerce.

 

2. Do you want live quotes from USPS and UPS with the latest rates, or do you want fixed rates that you have to update yourself? Your current system seems to use the latter.

 

Regards

Jim

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

Link to comment
Share on other sites

You can do that without MVS. Look in the Addons section for the Multi-Zone Multi-Table (MZMT) module. There are setup instructions included, and I believe that it has a support thread in this forum.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

Is anyone else getting this message on their checkout_shipping page?

 

Warning: usort() expects parameter 2 to be a valid callback, class 'upsxml' does not have a method 'rate_sort_func' in /home/protecom/public_html/includes/modules/vendors_shipping/upsxml.php on line 420

 

I did a seach and came up with nothing

Edited by lyonsperf
Link to comment
Share on other sites

That method was supposedly added to sort the returned rates by cost. It's on line 1176 of my copy of upsxml.php. The method looks like this:

 

// Next function used for sorting the shipping quotes on rate: low to high is default.
 function rate_sort_func ($a, $B) {

  $av = array_values($a);
  $av = $av[0];
  $bv = array_values($B);
  $bv = $bv[0];

//  return ($av == $bv) ? 0 : (($av < $bv) ? 1 : -1); // for having the high rates first
 return ($av == $bv) ? 0 : (($av > $bv) ? 1 : -1); // low rates first

 }

 

If you don't need to sort the returned rates, you could just comment out the line with the error. If you do want to sort, add that code somewhere in the class.

 

Regards

Jim

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

Link to comment
Share on other sites

Thanks Jim that worked great!

 

Heres another for you. I activated the free shipping module in mvs and it works fine until the customer gets to the checkout shipping page. The system is looking for the customer to select the shipping method for the order, which would be free shipping when the order is over the minimum. But there is no button or box for the customer to select. If you click continue the page reloads with a warning to please select a shipping method.

 

Any ideas?

Thanks

Matt

Link to comment
Share on other sites

I don't know why that is not working. It should be possible to select the method, in fact it should be selected by default. Try adding another module (such as Flat) to that vendor and see what happens.

 

Regards

Jim

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

Link to comment
Share on other sites

You can just use the flat rate module and set the cost to 0. Change the title to Free Shipping and you're done.

 

I have no idea why the free shipping module doesn't work.

 

Regards

Jim

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

Link to comment
Share on other sites

Here's the code I have

<?php
/*
 $Id$ freeamount.php 2
 Modified for MVS_1.2.3 2010/03/03 Motorcity
 Modified for MVS V1.0 2006/03/25 JCK/CWG
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2006 osCommerce
 Released under the GNU General Public License
 ----------------------------------------------
 ane - 06/02/02 - modified freecount.php to
 allow for freeshipping on minimum order amount
 originally written by dwatkins 1/24/02
 Modified BearHappy 09/04/04
 ----------------------------------------------
*/

 class freeamount {
   var $code, $title, $description, $icon, $enabled;
// class constructor
   function freeamount() {
  global $order, $vendors_id;

  $this->code = 'freeamount';
  $this->title = MODULE_SHIPPING_FREEAMOUNT_TEXT_TITLE;
  $this->description = MODULE_SHIPPING_FREEAMOUNT_TEXT_DESCRIPTION;
  $this->icon ='';
  $this->delivery_country_id = $order->delivery['country']['id'];
  $this->delivery_zone_id = $order->delivery['zone_id'];
   }

   //MVS start
   function sort_order($vendors_id = '1') {
  if (defined(@ constant('MODULE_SHIPPING_FREEAMOUNT_SORT_ORDER_' . $vendors_id))) {
    $this->sort_order = @ constant('MODULE_SHIPPING_FREEAMOUNT_SORT_ORDER_' . $vendors_id);
  } else {
    $this->sort_order = '-';
  }
  return $this->sort_order;
  }
   function tax_class($vendors_id='1') {
  $this->tax_class = constant('MODULE_SHIPPING_FREEAMOUNT_TAX_CLASS_' . $vendors_id);
  return $this->tax_class;
   }
   function enabled($vendors_id='1') {
  $this->enabled = false;
  $status = @ constant('MODULE_SHIPPING_FREEAMOUNT_STATUS_' . $vendors_id);
  if (isset ($status) && $status != '') {
    $this->enabled = (($status == 'True') ? true : false);
  }
  if (($this->enabled == true) && ((int) constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vendors_id) > 0)) {
    $check_flag = false;
    $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int) constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vendors_id) . "' and zone_country_id = '" . $this->delivery_country_id . "' order by zone_id");
    while ($check = tep_db_fetch_array($check_query)) {
	  if ($check['zone_id'] < 1) {
	    $check_flag = true;
	    break;
	  }
	  elseif ($check['zone_id'] == $this->delivery_zone_id) {
	    $check_flag = true;
	    break;
	  }
    }
    if ($check_flag == false) {
	  $this->enabled = false;
    } //if
  } //if
  return $this->enabled;
   }
   function zones($vendors_id = '1') {
  if (($this->enabled == true) && ((int) constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vendors_id) > 0)) {
    $check_flag = false;
    $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int) constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vendors_id) . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
    while ($check = tep_db_fetch_array($check_query)) {
	  if ($check['zone_id'] < 1) {
	    $check_flag = true;
	    break;
	  }
	  elseif ($check['zone_id'] == $order->delivery['zone_id']) {
	    $check_flag = true;
	    break;
	  } //if
    } //while
    if ($check_flag == false) {
	  $this->enabled = false;
    } //if
  } //if
  return $this->enabled;
   } //function
   //MVS End
// class methods
   function quote($method = '', $module = '', $vendors_id = '1') {
  global $_POST, $order, $cart, $total_count, $shipping_weight, $shipping_num_boxes;
  //MVS Start
  $vendors_data_query = tep_db_query("select handling_charge,
											 handling_per_box,
											 vendor_country,
											 vendors_zipcode
									  from " . TABLE_VENDORS . "
									  where vendors_id = '" . (int) $vendors_id . "'");
  $vendors_data = tep_db_fetch_array($vendors_data_query);
  $country_name = tep_get_countries($vendors_data['vendor_country'], true);
  $get_total = false;
  $get_weight = false;
  $handling_charge = $vendors_data['handling_charge'];
  $handling_per_box = $vendors_data['handling_per_box'];
  if ($handling_charge > $handling_per_box * $shipping_num_boxes) {
    $handling = $handling_charge;
  } else {
    $handling = $handling_per_box * $shipping_num_boxes;
  }
  $shipping = @[member='constant']('MODULE_SHIPPING_FREEAMOUNT_COST_' . $vendors_id) + $handling;
  //MVS End

  if ($shipping_weight > @[member='constant']('MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX_' . $vendors_id)) {
    if (@[member='constant']('MODULE_SHIPPING_FREEAMOUNT_DISPLAY_' . $vendors_id) == 'False') return;
// This next line might be used by some sites, but most wouldn't want it by default. 
//    $this->quotes['error'] = MODULE_SHIPPING_FREEAMOUNT_TEXT_TOO_HEAVY . ' (' . $shipping_weight . ') ' . MODULE_SHIPPING_FREEAMOUNT_TEXT_UNIT;
 $get_weight = false;
  } else {
   $get_weight = true;
  }
  if ($cart->show_total() < @[member='constant']('MODULE_SHIPPING_FREEAMOUNT_AMOUNT_' . $vendors_id)) {
    if (@[member='constant']('MODULE_SHIPPING_FREEAMOUNT_DISPLAY_' . $vendors_id) == 'False') return;
   $this->quotes['error'] = MODULE_SHIPPING_FREEAMOUNT_TEXT_ERROR . ' (' . @[member='constant']('MODULE_SHIPPING_FREEAMOUNT_AMOUNT_' . $vendors_id) . ') ';
 $get_total = false;
  } else {
 $get_total = true;

if (($get_total == true && $get_weight == true))
  {
   $this->quotes = array('id' => $this->code,
						 'module' => MODULE_SHIPPING_FREEAMOUNT_TEXT_TITLE,
						 'methods' => array(array('id' => $this->code,
						 'title' => MODULE_SHIPPING_FREEAMOUNT_TEXT_WAY,
						 'cost' => $shipping)));
 }
    }
  if ($this->tax_class($vendors_id) > 0) {
    $this->quotes['tax'] = tep_get_tax_rate($this->tax_class($vendors_id), $order->delivery['country']['id'], $order->delivery['zone_id']);
  }
  if (tep_not_null($this->icon))
    $this->quotes['icon'] = tep_image($this->icon, $this->title);
  return $this->quotes;
   }
   function check($vendors_id = '1') {
  if (!isset ($this->_check)) {
    $check_query = tep_db_query("select configuration_value from " . TABLE_VENDOR_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FREEAMOUNT_STATUS_" . $vendors_id . "'");
    $this->_check = tep_db_num_rows($check_query);
  }
  return $this->_check;
   }
   function install($vendors_id = '1') {
  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) values ('Enable Free Shipping with Minimum Purchase', 'MODULE_SHIPPING_FREEAMOUNT_STATUS_" . $vendors_id . "', 'True', 'Do you want to offer minimum order free shipping?', '6', '7', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(), '" . $vendors_id . "')");
  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id,  sort_order, date_added, vendors_id) values ('Maximum Weight', 'MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX_" . $vendors_id . "', '10', 'What is the maximum weight you will ship?', '6', '8', now(), '" . $vendors_id . "')");
  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) values ('Enable Display', 'MODULE_SHIPPING_FREEAMOUNT_DISPLAY_" . $vendors_id . "', 'True', 'Do you want to display text way if the minimum amount is not reached?', '6', '7', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(), '" . $vendors_id . "')");
  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id,  sort_order, date_added, vendors_id) values ('Minimum Cost', 'MODULE_SHIPPING_FREEAMOUNT_AMOUNT_" . $vendors_id . "', '50.00', 'Minimum order amount purchased before shipping is free?', '6', '8', now(), '" . $vendors_id . "')");
  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Sort Order', 'MODULE_SHIPPING_FREEAMOUNT_SORT_ORDER_" . $vendors_id . "', '0', 'Sort order of display.', '6', '0', now(), '" . $vendors_id . "')");
  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Tax Class', 'MODULE_SHIPPING_FREEAMOUNT_TAX_CLASS_" . $vendors_id . "', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now(), '" . $vendors_id . "')");
  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Shipping Zone', 'MODULE_SHIPPING_FREEAMOUNT_ZONE_" . $vendors_id . "', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now(), '" . $vendors_id . "')");
  }
   function remove($vendors_id) {
  tep_db_query("delete from " . TABLE_VENDOR_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys($vendors_id)) . "')");
   }
   function keys($vendors_id) {
  return array (
'MODULE_SHIPPING_FREEAMOUNT_STATUS_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_SORT_ORDER_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_DISPLAY_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_TAX_CLASS_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_AMOUNT_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vendors_id
);
   }
 }
 ?>

Link to comment
Share on other sites

OK, after many winmerge compares of different free shipping mods and not finding a single difference, I finally found the answer.

 

If you enable free shipping in your admin panel/vendor section you must also go into admin panel-Modules-Order Total-Shipping, then click edit for the shipping line and change allow free shipping from true to false. This then allows the new MVS free shipping mod to enable!

Three days of work for one simple change!

Hope this helps someone else!

Link to comment
Share on other sites

I hope someone here can help me. My PHP programming skills are only adequate to install mods, test them, and implement them on my 2.2 rc2 site. I have MVS 1.2.3 installed, and it has been working since it was released. Last March I got myself in a crunch with the USPS Web Tools API change. I was unable to get anything to work well, including any mods here. Up against the clock, I found the USPS Rate V4 Intl Rate V2 thread, and mangaged (just barely) to get that mod to work for me. The problem with that, that is still haunting me, is that installing it worked, the rates are correctly downloading from USPS, BUT after installation, I noticed that I could no longer go into my Modules admin. All modules, not just shipping modules, just give me a blank white screen. Again, rates work, but with the current situation I am unable to make any changes to any modules. Everything else in admin displays perfectly, but I can't even click on modules in the admin box without the blank white page. I have looked through the code (to the best of my abilities) and can find no reason for this. My admin Vendors displays fine.

 

I am trying to fix this, but I don't know how to start. For one thing I can't use admin to remove or add modules. I have backups of the previous files, so I would like to ask how to back out these changes long enough to install a working MVS/USPS V4 fix.

 

Ron

Link to comment
Share on other sites

USPS has changed their API again. I've modified the USPS module for MVS and it seems to work. You can find the code here temporarily. Uninstall your module before installing this one to use all of the changes.

 

I have tested this on my test store, but I would really like to have others test this out and see if it works. Please post here if you have tried this code. If it works I'll add it to the main distribution.

 

@@rwest If you are still having problems, try just uploading this one over your old copy. If it lets you into your Admin, then uninstall and reinstall.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

I installed MVS in my oscommerce 2.3.3 but I have this problem at checkout_confirmation.php

Warning: strpos() expects parameter 1 to be string, array given in C:\xampp\htdocs\enoosc\shop\includes\classes\vendor_shipping.php on line 46

 

Warning: substr() expects parameter 1 to be string, array given in C:\xampp\htdocs\enoosc\shop\includes\classes\vendor_shipping.php on line 46

 

Warning: strpos() expects parameter 1 to be string, array given in C:\xampp\htdocs\enoosc\shop\includes\modules\order_total\ot_shipping.php on line 48

 

Warning: substr() expects parameter 1 to be string, array given in C:\xampp\htdocs\enoosc\shop\includes\modules\order_total\ot_shipping.php on line 48

 

Any Idea. I installed also Credit Class and gift voucher and discount coupon. Any idea about this warning?

Do you know if there are problem if MVS and credit class are installed in the same oscommerce??

 

Thanks for your help

Marco

Link to comment
Share on other sites

You have a broken module in includes/modules/vendor_shipping/. If you've added something to that folder that's not supplied with this addon, try removing that temporarily and see if the error stops. If you haven't added anything, then go delete each file, one at a time, until the error stops. Once you know which module is causing the problem, you'll have to debug that module if it's one that you need, or just leave it out if you don't need it.

 

I have installed MVS along with CCGV in other stores. I don't remember any problems with that. I don't know which discount coupon addon you are using, but none of them should conflict 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

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