Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

So is it possible that the problems I'm having are because I used the instruction sheets to edit my code? Maybe there are other spots in the instructions that are also out of date?


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

Oh and as long as I'm posting like a lunatic, here's one more issue (I posted this before but it looks like it got lost in the shuffle):

 

The way the shipping modules (fedex at any rate) cut up the weight of different packages is funky. Instead of filling up one box, then moving onto the next box, filling it up, etc, it averages the weight over all the boxes. This is something I ran into a long time ago, and I believe someone told me how to fix it, but I don't quite remember. I'm going to go slogging through my old posts and see if I can find something, but if someone here has any ideas, please let me know.

 

I haven't found anything about this in my old posts or the replies to them, but it seems like there was/is a way to fix this. Maybe edit the shipping module itself?


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

The files included with the distribution are those used to develop the MVS contribution, so they should be authoritative. I have no idea where that extra code came from. I recognize some of what's in that part of the instructions, but not all of it. We'll get that fixed in the next release, and thanks for letting us know. You might want to check other areas where you are having problems against the supplied files as well.

 

As to the box packing system, that's straight osCommerce code. It just calculates the minimum number of boxes needed to hold the order, then distributes the weight evenly among them. It should be possible to develop a more realistic system, but I'm not certain that it would be worth doing. The difference in cost for an entire shipment should be minimal. If you are seeing substantial differences in cost, then I would start looking at ways to fix 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

To Jim and Craig- thank you for your continued support and assistance!

 

Stew and others,

I am currently working on the issue of being able to checkout without selecting a shipping method as well, I have received several emails asking for help with this particular issue and I beleive this is the single most disturbing bug we have with MVS. Files to check for this bug will be:

in catalog->

checkout_shipping.php

checkout_process.php

checkout_payment.php(though should not have been affected by MVS)

in catalog->includes

application_top.php

in catalog->includes->classes

order.php

shopping_cart.php

vendor_shipping.php

 

 

I downloaded Beyond Compare and got it to work on my SuSE box :)

 

Here is what I found from comparing my installed files to those provided with the MVS release (I included just about everything):

 

checkout_shipping.php- The only differences that came up were things I did to change the layout of the page.

 

checkout_process.php-

 

Beyond Compare found a number of what I would consider spacing differences, with some lines being combined, some missing blank lines, things like that. I modified my installed version to be identical.

 

I know my installed version was modified with code supplied by gregbaboolal for PayPal Shopping Cart IPN.

 

Includes this extra code around line 104:

 'paypal_ipn_id' => $order->paypal_ipn_id);// PayPal_Shopping_Cart_IPN

 

I don't use this contribution anymore so I commented this line out and put the semicolon at the end of the currency_value line.

 

this file was also modified for PWA. Here is the additional code, from around line 378:

  // DDB - 041103 - Add test for PWA : no display of invoice URL if PWA customer
if (!tep_session_is_registered('noaccount')) 
{
 $email_order = STORE_NAME . "\n" . 
                EMAIL_SEPARATOR . "\n" . 
                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
 if ($order->info['comments']) 
 {
   $email_order .= tep_db_output($order->info['comments']) . "\n\n";
 }
 $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . 
                 EMAIL_SEPARATOR . "\n" . 
                 $products_ordered . 
                 EMAIL_SEPARATOR . "\n";
} else {
 $email_order = STORE_NAME . "\n" . 
                EMAIL_SEPARATOR . "\n" . 
                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
{

 

This is what the same section of code looks like in the MVS version:

// lets start with the email confirmation
 $email_order = STORE_NAME . "\n" .
                EMAIL_SEPARATOR . "\n" .
                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

 

Also at around line 403 (of the MVS version) there is an extra "}" that appears to be part of PWA (it's in the same place in the checkout_process.php file included with PWA).

 

PWA is installed and in use on my site.

 

I uploaded the modified file and tested the site- problem persists.

 

checkout_payment.php- I gave this file a quick glance; the comments don't indicate any mods made to this page.

 

application_top.php- installed version contains this code at around line 495 not included with MVS version:

// add the products name to the breadcrumb trail
if (isset($HTTP_GET_VARS['products_id'])) {
$name_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
if (tep_db_num_rows($name_query)) {
$name = tep_db_fetch_array($name_query);
$breadcrumb->add($name['products_name'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
}
}

 

I don't think this difference could cause any real problem, but I commented it out anyway, uploaded the modified file to the site, and no luck.

 

order.php- the code in the installed file and MVS version are identical. The only difference is that the MVS version doesn't have any comments indicating where changes have been made.

 

shopping_cart.php- found a number of very minor differences (blank lines in different places, etc), mostly the pages were identical, except for some commented out code left over from the dark ages of mltship that I have not yet removed completely. Besides this, line 89 is different:

 

$this->update_quantity($products_id, (int)$qty, $attributes);

 

The purpose of the (int) before quantity is, I believe, to prevent people from buying half a product or some such nonsense.

 

Here's an interesting difference at line 214:

$product_query = tep_db_query("select  products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

 

The MVS version of this code includes an additional attribute, products_id. I don't know why this is different. It doesn't look like this is something changed by MVS- my site was modified at some point for reasons unknown to remove that one attribute? I don't even know what purpose products_id serves. I'm going to leave this for now.

 

includes/classes/vendor_shipping.php- My installed version is identical to the MVS version.

 

 

Included below are some other files I looked at and found some differences in. I don't think any of this is really applicable to the checkout without paying for shipping problem but it might be useful in some other way-

 

includes/modules/vendor_shipping.php- The differences here are from the patch posted by Jim.

 

admin/categories.php- the code changes at line 218 were superficially different in the order they were listed and where the comments were located. This is a difference between what is given in the code files and the instructions in Admin_Install.txt.

 

At around line 720 in my store, the code looks like this:

<td class="pageHeading" align="right"><?php echo $currencies->format($pInfo->products_price); ?></td>
	 <?php //vendors_email start
?>
           <td class="pageHeading" align="right"><?php echo " Prod Price:   <br>" . $currencies->format($pInfo->products_price); ?></td>
           <td class="pageHeading" align="right"><?php echo "Vendor Price: <br>" . $currencies->format($pInfo->vendors_product_price); ?></td>
         </tr>
<?php //vendors_email end
?>

 

But in the file included with MVS it looks like this (line 700):

 

<td class="pageHeading" align="right"><?php echo " Prod Price:   <br>" . $currencies->format($pInfo->products_price); ?></td>
           <?php //vendors_email start
           ?>
           <td class="pageHeading" align="right"><?php echo "Vendor Price: <br>" . $currencies->format($pInfo->vendors_product_price); ?></td>
         </tr>
      <?php   //   vendors_email end
      ?>

 

I don't know if this is a big deal, but it is another difference between what the instructions say to do and the code provided in the MVS files.

 

admin/orders.php- In the file included with MVS there is a section of what appears to be duplicate code at line 395:

<tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
     </tr>
     <?php
   //vendors email begin
      $orders_vendors_data_query = tep_db_query("select distinct ov.orders_id, ov.vendors_id, ov.vendor_order_sent, v.vendors_name from " . TABLE_ORDERS_SHIPPING . " ov, " . TABLE_VENDORS . " v where v.vendors_id=ov.vendors_id and orders_id='" . (int)$oID . "' group by vendors_id");
 while ($orders_vendors_data=tep_db_fetch_array($orders_vendors_data_query)) {
 echo '<tr class="dataTableRow"><td class="dataTableContent" valign="top" align="left">Order Sent to ' .$orders_vendors_data['vendors_name'] . ':<b> ' . $orders_vendors_data['vendor_order_sent'] . '</b><br></td>';
         }
         echo '</tr>';
         //vendors email end but there is more
?>


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

Hello All,

Thanks a lot for this great contribution.

Everything seems to be working great except per item shipping module.

On the checkout_shipping page i receive following error.

--Error------------------------------------------------------------------

Fatal error: Call to a member function on a non-object in /includes/classes/vendor_shipping.php on line 89

--------------------------------------------------------------------------

The Line 89 in item.php is as below

--item.php Line 89-----------------------------------------------------

} elseif ($GLOBALS[$class]->enabled($vendors_id)) { //Module is enabled

--------------------------------------------------------------------------

 

Below is the code around it:

--Line 81 to 91 in item.php--------------------------------------------

81 foreach ($this->modules[$vendors_id] as $value) {

82 echo '<br> value is '.$value; // My attempt to debug

83 $class = substr($value, 0, strrpos($value, '.')); // $class is the filename without the .php

84 echo '<br> module is '.$module; // My attempt to debug

85 if (tep_not_null($module)) {

86 if ( ($module == $class) && ($GLOBALS[$class]->enabled($vendors_id)) ) {

87 $include_quotes[] = $class;

88 }

89 } elseif ($GLOBALS[$class]->enabled($vendors_id)) { //Module is enabled for this vendor

90 $include_quotes[] = $class;

91 }

92 }

--------------------------------------------------------------------------

 

I used the files posted on August 5 v..9CR5 on the MVS contribution. If anyone have a working includes\modules\vendors_shipping\item.php I can try replacing this file and see if it might fix the problem.

 

Thanks!

Share this post


Link to post
Share on other sites

It doesn't seem to me that the problem is with per item, but rather /includes/classes/vendor_shipping.php. That's where the error is showing up.

 

That's also why, in your first thread concerning this problem, I told you the code was different- because I compared the code you posted to my vendor_shipping.php (not the right one, as it turns out, but that's another matter).

 

Fatal error: Call to a member function on a non-object in /includes/classes/vendor_shipping.php on line 89

 

All /includes/classes/vendor_shipping.php has on line 89 is

 

 } else {

 

I don't know why you're getting this error, but I think you're looking for the solution in the wrong place.

 

If you're only getting this error when you use per item, not with any other shipping module, that changes things somewhat, but if the problem does lie with the per item module it's not necessarily on line 89.

 

Please post lines 84-91 of your includes/classes/vendor_shipping.php file.


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
It doesn't seem to me that the problem is with per item, but rather /includes/classes/vendor_shipping.php.  That's where the error is showing up.

 

That's also why, in your first thread concerning this problem, I told you the code was different- because I compared the code you posted to my vendor_shipping.php (not the right one, as it turns out, but that's another matter).

All /includes/classes/vendor_shipping.php has on line 89 is

 

 } else {

 

I don't know why you're getting this error, but I think you're looking for the solution in the wrong place.

 

If you're only getting this error when you use per item, not with any other shipping module, that changes things somewhat, but if the problem does lie with the per item module it's not necessarily on line 89.

 

Please post lines 84-91 of your includes/classes/vendor_shipping.php file.

 

My bad, above lines are from classes/vendor_shipping.php and not item.php

---classes/vendor_shipping.php----------------------------------------------------------

81) foreach ($this->modules[$vendors_id] as $value) {

82) echo '<br> value is '.$value;

83) $class = substr($value, 0, strrpos($value, '.')); // $class is the filename without the .php

84) echo '<br> module is '.$module;

85) if (tep_not_null($module)) {

86) if ( ($module == $class) && ($GLOBALS[$class]->enabled($vendors_id)) ) {

87) $include_quotes[] = $class;

88) }

89) } elseif ($GLOBALS[$class]->enabled($vendors_id)) { //Module is enabled for this vendor

90) $include_quotes[] = $class;

91) }

92) }

-----------------------------------------------------------------------------------------------

 

And yes, all other modules work fine the error is received only when per item shipping module is installed. If I just uninstall the Per Item module every thing else works fine, but unfortunately it is one of the required shipping method.

Share this post


Link to post
Share on other sites

Try this- it's my entire catalog/includes/classes/vendor_shipping.php. It's 160 lines long. The code that you are posting as lines 81-92 is found at lines 100-109 of my file. Maybe your file has been corrupted somehow, or something is out of order?

 

<?php
/*
 $Id: vendor_shipping.php,v 1.4 2005/04/20 jck Exp $
 $Modified_from: shipping.php,v 1.23 2003/06/29 11:22:05 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2005 osCommerce

 Released under the GNU General Public License
*/

 class shipping {
   var $modules;

////
// Find all of the modules and instantiate the module classes
   function shipping($module = '') {
     global $language, $PHP_SELF;

     $installed_modules_array = array();
	 //Get the vendors_id for each vendor in the database
     $vendors_data_query = tep_db_query("select vendors_id from " . TABLE_VENDORS);
     while ($vendors_data = tep_db_fetch_array($vendors_data_query)) {;
       $vendors_id = $vendors_data['vendors_id'];
       $installed_modules = @constant ('MODULE_VENDOR_SHIPPING_INSTALLED_' . $vendors_id);

       if (isset ($installed_modules) && tep_not_null ($installed_modules)) {
         $modules_array = explode(';', $installed_modules);
         $this->modules[$vendors_id] = $modules_array;

         foreach ($modules_array as $module_name) {
           //if the module is not already in the array, add it in
           if (!in_array ($module_name, $installed_modules_array)) {  
             $installed_modules_array[] = $module_name;
           }//if !in_array
         }//foreach
       }//if isset
     }//while

  	 
     $include_modules = array();
     if ( (tep_not_null($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($modules_array);
       foreach ($installed_modules_array as $value) {
         $class = substr($value, 0, strrpos($value, '.'));
         $include_modules[] = array('class' => $class, 
                                    'file' => $value);
       }//foreach
     }//if tep_not_null

     for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {
       include(DIR_WS_LANGUAGES . $language . '/modules/vendors_shipping/' . $include_modules[$i]['file']);
       include(DIR_WS_MODULES . 'vendors_shipping/' . $include_modules[$i]['file']);

       $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];
     }//for
   }//function

////
// Get a quote for one or many shipping methods, for a specific vendor
   function quote($method = '', $module = '', $vendors_id='1') {
     global $shipping_quoted, $order, $cart, $shipping_num_boxes, $shipping_weight;

     $quotes_array = array();
     if (is_array($this->modules[$vendors_id])) {
       $shipping_quoted = '';
       $shipping_num_boxes = 1;
       
       $shipping_weight = $cart->vendor_shipping[$vendors_id]['weight'];
       $shipping_cost = $cart->vendor_shipping[$vendors_id]['cost'];
       $total_count = $cart->vendor_shipping[$vendors_id]['qty'];

       $vendors_data_query = tep_db_query("select percent_tare_weight, 
                                                  tare_weight, 
                                                  max_box_weight 
                                           from " . TABLE_VENDORS . " 
                                           where vendors_id = '" . (int)$vendors_id . "'"
                                         );
       $vendors_data = tep_db_fetch_array($vendors_data_query);  //Only the row of the table that is for this vendor
       if ($vendors_data['max_box_weight'] == 0) $vendors_data['max_box_weight'] = 1000000;

       if ($vendor['tare_weight'] >= $shipping_weight*$vendors_data['percent_tare_weight']/100) {
         $shipping_weight = $shipping_weight + $vendors_data['tare_weight'];
       } else {
         $shipping_weight = $shipping_weight + ($shipping_weight*$vendors_data['percent_tare_weight']/100);
       }

       if ($shipping_weight > $vendors_data['max_box_weight']) { // Split into many boxes
         $shipping_num_boxes = ceil($shipping_weight/$vendors_data['max_box_weight']);
         $shipping_weight = $shipping_weight/$shipping_num_boxes;
       }

       $include_quotes = array();
       reset($this->modules[$vendors_id]);
       foreach ($this->modules[$vendors_id] as $value) {
         $class = substr($value, 0, strrpos($value, '.'));  // $class is the filename without the .php
         if (tep_not_null($module)) {
           if ( ($module == $class) && ($GLOBALS[$class]->enabled($vendors_id)) ) {
             $include_quotes[] = $class;
           }
         } elseif ($GLOBALS[$class]->enabled($vendors_id)) {  //Module is enabled for this vendor
           $include_quotes[] = $class;
         }
       }

       reset($include_quotes);
       $size = sizeof($include_quotes);
       for ($i=0; $i<$size; $i++) {
         $quotes = $GLOBALS[$include_quotes[$i]]->quote($method, '', $vendors_id);
         if (is_array($quotes)) $quotes_array[] = $quotes;
       }
     }

     return $quotes_array;
   }

////
//Find the cheapest shipping method for a specific vendor
   function cheapest($vendors_id='1') {
     if (is_array($this->modules[$vendors_id])) {
       $rates = array();

       reset($this->modules[$vendors_id]);
       foreach ($this->modules[$vendors_id] as $value) {
         $class = substr($value, 0, strrpos($value, '.'));

         if ($GLOBALS[$class]->enabled($vendors_id)) {
           $quotes = $GLOBALS[$class]->quote('', '', $vendors_id);

           for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
             if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) {
               $rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
                                'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',
                                'cost' => $quotes['methods'][$i]['cost']);
             }
           }
         }
       }

       $cheapest = false;
       for ($i=0, $n=sizeof($rates); $i<$n; $i++) {
         if (is_array($cheapest)) {
           if ($rates[$i]['cost'] < $cheapest['cost']) {
             $cheapest = $rates[$i];
           }
         } else {
           $cheapest = $rates[$i];
         }
       }

       return $cheapest;
     }
   }
 }
?>


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

Im still having slight problems with my custom shipping mod.

 

I have narrowed the problem down to these few lines.

 

if ($total_count != $quote['order_num_products'])
   $cost = 0;

 

Basically the total count of products should match the order_num_products. But it doesnt.

 

I cant seem to output the $total_count variable.

But if i remove this line it works fine, I know the db field contains '2' and the basket contains 2 products too.

So its narrowed down to that one variable, is there a variable with MVS whereby I can grab the total no of products in the cart?

 

thankx

Paul


Feel free to ask me for help

beep... beep....My Pager

Share this post


Link to post
Share on other sites

MVS is designed to generate all of the data on a per-vendor basis. Since the shipping modules are modified to use the data for the current vendor, you need to use the number of products for that vendor. You should be able to get that number using

$total_count = $cart->vendor_shipping[$vendors_id]['qty'];

$total_count is set in the quote method of the vendor_shipping class, so it should be valid. You might want to try printing out the values of the $cart->vendor_shipping method to see where the problem is.

 

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

 

I had a play and found out some interesting things.

I have 2 products in the Cart, and 'order_num_products' in the database is set to 2. So the value $cost should be whatever is already there. The idea is if cart quantity does not match 'order_num_products' then the $cost is set back to 0 and the user cannot check out.

 

However in my cart I have two products, each one with a different vendor. the $total_count variable is only counting the no of products for that particular vendor so in this case 1. Which is where the problems are coming from it should be 2.

 

Any ideas why?


Feel free to ask me for help

beep... beep....My Pager

Share this post


Link to post
Share on other sites

Ive worked it out, its because the product in question is a gift Voucher and so it is not included in the overall count of products!!

 

Thnx


Feel free to ask me for help

beep... beep....My Pager

Share this post


Link to post
Share on other sites
Try this-? it's my entire catalog/includes/classes/vendor_shipping.php.? It's 160 lines long.? The code that you are posting as lines 81-92 is found at lines 100-109 of my file.?  Maybe your file has been corrupted somehow, or something is out of order?

 

<?php
/*
?$Id: vendor_shipping.php,v 1.4 2005/04/20 jck Exp $
?$Modified_from: shipping.php,v 1.23 2003/06/29 11:22:05 hpdl Exp $

?osCommerce, Open Source E-Commerce Solutions
?http://www.oscommerce.com

?Copyright (c) 2005 osCommerce

?Released under the GNU General Public License
*/

??>

Thanks for the file. I compared and they are identical. I tried to debug and discoverd that the $GOBALS[$class] is object except for all other modules except when $class is item the $GOBALS[$class] equals "Summer". If anyone can think of where is this coming from, let me know. Below is debug output from class/vendor_shipping.php

 

value is fedex1.php

module is

class is fedex1

class in globals is Object

value is flat.php

module is

class is flat

class in globals is Object

value is item.php

module is

class is item

class in globals is Summer

Fatal error: Call to a member function on a non-object in dev2/includes/classes/vendor_shipping.php on line 92

Edited by shahd2

Share this post


Link to post
Share on other sites

Hey,

I finally got per item and table rate shipping modules to work with MVS,

Now I need multiple tables rates for ground, 2nd day and next day, So i want to see if i can get lucky, if anyone has modified multi-table shipping module for MVS.

I think it is called additional_table_rate_options_v1.2

 

 

 

Thanks!

Share this post


Link to post
Share on other sites

The layout of ordered products in orders and in the account info page, is very user unfriendly in my stores design, so I have replaced the account_history_info.php with the original one and the orders show up as they did.

 

however in admin orders.php when I replace this file with the original, where the products should be it just lists an x.

 

Any ideas how I can get this to work like the original way. I just want it to display the products ordered I think the rest of the info is overkill.

 

thnx.


Feel free to ask me for help

beep... beep....My Pager

Share this post


Link to post
Share on other sites

In order to pre-select a shipping method I tried modifying the body tag like so:

 

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" onload="javascript:document.checkout_shipping.shipping_3[0].click();return true;">

 

I got this from a post where someone wanted to preselect a payment method on the checkout_payment page. I installed the code recommended for that and uploaded the file, it works perfectly. So I tried coming up with a version for checkout_shipping and that's what is shown above. Unfortunately it doesn't work.

 

If anyone can come up with a reason why this should/should not work, I would greatly appreciate it.

 

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
Stew and others,

I am currently working on the issue of being able to checkout without selecting a shipping method as well, I have received several emails asking for help with this particular issue and I beleive this is the single most disturbing bug we have with MVS.

 

<snip>

 

I too have been trying to solve the "checkout without shipping" and "select cheapest shipping" problem along with everyone else, and finally got it working on my development store. Find the original code on catalog/includes/modules/vendor_shipping.php (Line 84):

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

 

and replace with:

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

(first part of patch from Post #744)<{POST_SNAPBACK}>

 

And at Line 186 the original code was:

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

 

Replace with:

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

(second part of patch from Post #671)<{POST_SNAPBACK}>

 

It seems to be working OK for me now, I have tried going back to the shipping page after subsequent pages, logging off during the checkout process and then logging back in, going back and adding more items to the cart after passing the shipping, etc. and have had it select cheapest shipping each time for all vendors.

 

Hopefully everyone else will have the same good fortune! :lol:

 

Regards,

 

John

Share this post


Link to post
Share on other sites

My sales tax is still showing 3 decimal places on the customer e-mails (sent from checkout_processing), and I can't track down why. It seems to be adding an additional zero after the second decimal place. I have set the Admin->Configuration->Tax Decimal Places to 2, but it does not have any effect. Any ideas where to start looking?

 

Thank you,

John

Share this post


Link to post
Share on other sites
I too have been trying to solve the "checkout without shipping" and "select cheapest shipping" problem along with everyone else, and finally got it working on my development store. Find the original code on catalog/includes/modules/vendor_shipping.php (Line 84):

CODE

 

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

 

 

and replace with:

CODE

 

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

 

(first part of patch from Post #744)*

 

And at Line 186 the original code was:

CODE

 

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

 

 

Replace with:

CODE

 

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

 

(second part of patch from Post #671)*

 

It seems to be working OK for me now, I have tried going back to the shipping page after subsequent pages, logging off during the checkout process and then logging back in, going back and adding more items to the cart after passing the shipping, etc. and have had it select cheapest shipping each time for all vendors.

 

Hopefully everyone else will have the same good fortune! laugh.gif

 

Regards,

 

John

 

Well holy s^&*.......

 

At first I thought you were crazy, because it looks so much like the patch from post 744, but then I looked more closely and I thought "Well that's code from an old patch that didn't work." But yes, this works perfectly!

 

THANK YOU

 

I'm so relieved, I don't even know what to do with myself.

 

And to think just yesterday I got the credit card module that ye shall not name working. Guess I'll just start selling stuff...

 

:D

 

 

Oh- that's not the first patch from post 744, unless the code deceives me. It's the second part of the patch applied on line 84, with the patch for line 186 coming from post 671.


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

 

Is it possible to set up a product with free shipping? I tried setting up a new vendor category without installing a shipping module, but when I get to checkout_process.php the following error comes back:

 

 Warning: Invalid argument supplied for foreach() in /var/www/html/checkout_process.php on line 131

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/checkout_process.php:131) in /var/www/html/includes/functions/general.php on line 29

 

This is how line 131 reads:

 

foreach ($shipping_array as $vendors_id => $shipping_data) {

 

It works as far as free shipping is concerned, the order is processed (cart is emptied and an order is generated in admin, visible on user's account page) and nothing is charged for shipping, but that error message is what you see instead of checkout_process.php.

 

???

 

Maybe it's just late and I should go to bed....

 

 

Any luck on resolving this error?? I am getting the same message!! :o

Thx.

 

Pedro

Share this post


Link to post
Share on other sites
Any luck on resolving this error?? I am getting the same message!! :o

Thx.

 

Pedro

 

As far as I know this only happens when no shipping method is selected (the checkout without paying for shipping bug, basically).

 

If you want to offer free shipping this way, use flat rate or per item with the rate set to zero.


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

Pedro-

 

According to your other post you're getting this-

 

Warning: Invalid argument supplied for foreach() in D:\Web Sites\BFMFightwear.COM\store\checkout_shipping.php on line 109

 

Warning: Cannot modify header information - headers already sent by (output started at D:\Web Sites\BFMFightwear.COM\store\checkout_shipping.php:109) in D:\Web Sites\BFMFightwear.COM\store\includes\functions\general.php on line 29

 

I'm still a rookie when it comes to coding, but this is not exactly the same error message I posted- mine referenced line 131 on checkout_process.php, not line 109 of checkout_shipping.php.

 

Did you modify your checkout_shipping.php file as instructed? Maybe you missed something in the install.

 

Also, as I said above, the customer has to select a shipping method selected on checkout_shipping.php- that's how I was getting the error I was posting. If you've got the checkout without shipping bug there is a patch for that posted just a few messages up.


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

Stew,

 

Glad you were able to get your checkout_shipping working. You are right about the code being applied to line 84, that's what I meant to say, just didn't come out right. :blush: That's what happens when you stay up too late trying to figure this stuff out (and I am by no means a PHP expert, which doesn't help matters alot!)

 

Now I have a question that is not so serious an issue, more of a curiosity: What is the "Vendor Image" used for? I put each vendor's logo in for the image, but I never see it anywhere. Should I be seeing this someplace? Has anyone else tried to load a vendor image in for their vendors?

 

Just curious. :blink:

 

John

Share this post


Link to post
Share on other sites

"Glad you were able to get your checkout_shipping working."

 

So am I! Thanks again!

 

As for "Vendor Image", I've never used it. Maybe it's commented out somewhere? Or you could add it in?


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

Guys im trying to add a Multi Flat Rates Contribution so i can add multiple flat rates to products, since my vendor has flat rate shipping. Im trying to add this contribution. http://www.oscommerce.com/community/contri...ulti+flat+rates

I started to look at the code difference to each but its way over my head. Also i need to add this contribution so i can put in the actual price to the attributes and that contribution is located here http://www.oscommerce.com/community/contri...ctual+attribute

If you could help me out with one or both of these it would be greatly appreciated!!

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

×