Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 8 votes

Multi_Vendor_Shipping new thread


4424 replies to this topic

#3841 Roaddoctor

  • Community Member
  • 595 posts
  • Real Name:David Jennings

Posted 12 November 2009, 19:53

ok - got that sorted.

One last detail... when clicking the line item PackingSlip link that goes to vendors_packingslip.php, the Qty, Product, and Model are not appearing. The osc packingslip is ok.

Otherwise all seem good. Thank you again.
-Dave

#3842 Roaddoctor

  • Community Member
  • 595 posts
  • Real Name:David Jennings

Posted 13 November 2009, 17:05

Ok trying to sort out the vendor_packinglist and why the qty product model details are not being shown

in admin/orders.php
// MVS start
    //   echo '<br> the $order->orders_shipping_id : ' . $order->orders_shipping_id;
    if (tep_not_null($order->orders_shipping_id)) {
      require_once ('vendor_order_info.php');
    } else { 
// MVS end

which sends me to /vendor_order_info.php
placing at the top

print '<pre>';
 print_r ($order->products);
 print '</pre>';

Output
Array
(
    [0] => Array
        (
            [Vid] => 1
            [Vname] => My Store
            [Vmodule] => item
            [Vmethod] => Best Way
            [Vcost] => 3.5000
            [Vship_tax] => 0.0000
            [Vorder_sent] => no
            [Vnoname] => Shipper
            [spacer] => -
            [orders_products] => Array
                (
                    [0] => Array
                        (
                            [qty] => 1
                            [name] => Speed 2: Cruise Control
                            [tax] => 0.0000
                            [model] => DVD-SPEED2
                            [price] => 42.0000
                            [vendor_name] => 
                            [vendor_ship] => 
                            [shipping_method] => 
                            [shipping_cost] => 
                            [final_price] => 42.0000
                            [spacer] => -
                        )

                )

        )

)


Within vendor_order_info is the link to the vendor_packingslip

    echo '          <tr class="dataTableRow">' . "\n" .
         '            <td class="dataTableContent" valign="top">' . $order->products[$l]['Vname'] . '<br>' . $ship_data_text . '<br><a href="' . tep_href_link('vendor_packingslip.php', 'oID=' . $oID . '&vID=' . $order->products[$l]['Vid'] . '&text=' . $ship_data_text) . '">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a></td>' . "\n";

the link shows as
http://www.xxx/admin/vendor_packingslip.php?oID=33&vID=1&text=Shipment Number 1 of 1

looking to the /admin/vendors_packingslip.php there is this code
  $package_num = sizeof ($order->products);
  $box_num = $l +1;
  for ($i = 0, $n = sizeof ($packslip_products); $i < $n; $i++) {
    echo '      <tr class="dataTableRow">' . "\n" .
         '        <td class="dataTableContent" valign="top" align="left">' . $packslip_products[$i]['qty'] . '&nbsp;x&nbsp;&nbsp;' . $packslip_products[$i]['name'];
    if (isset ($packslip_products[$i]['packslip_attributes']) && (sizeof($packslip_products[$i]['packslip_attributes']) > 0)) {
      for ($j = 0, $k = sizeof($packslip_products[$i]['packslip_attributes']); $j < $k; $j++) {
        echo '<br><nobr><small>&nbsp;<i> - ' . $packslip_products[$i]['packslip_attributes'][$j]['option'] . ': ' . $packslip_products[$i]['packslip_attributes'][$j]['value'];
        echo '</i></small></nobr>';
      }
    }
    echo '</td>' . 
         '        <td class="dataTableContent" valign="top" align="left">' . $packslip_products[$i]['spacer'] . '</td>' . "\n" .
         '        <td class="dataTableContent" valign="top">' . $packslip_products[$i]['spacer'] . '</td>' . "\n" .
         '        <td class="dataTableContent" valign="top">' . $packslip_products[$i]['model'] . '</td>' . "\n" .
         '      </tr>' . "\n";
  }

Where do I go from here? Im lost. Another priceformatter class side effect?

Thank you for the help.
-Dave

#3843 kymation

  • Community Sponsor
  • 5,285 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 13 November 2009, 17:52

Probably another error in vendors_packingslip.php. The link passes the Order ID (oID) and the file retrieves the rest of the data. I would start with the database query. If that's been removed, you will need to put back the vendor part, like I showed previously.

Regards
Jim

#3844 Roaddoctor

  • Community Member
  • 595 posts
  • Real Name:David Jennings

Posted 13 November 2009, 18:16

Our admin/vendor_packingslip.php files are identical.

Before we made the fix to includes/classes/shopping_cart.php, the items were showing up in vendors_packingslip, although all items were showing and not just that vendors specific items (expected, with vID missing). after the fix, no items appear.

The queries in admin/vendor_packingslip.php

above HEAD
  $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int) $oID . "'");

and within BODY
<?php

  $index = 0;
  $order_packslip_query = tep_db_query("select vendors_id, orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $oID . "' and vendors_id = '" . $vID . "'");
  while ($order_packslip_data = tep_db_fetch_array($order_packslip_query)) {
    $packslip_products[$index] = array (
      'qty' => $order_packslip_data['products_quantity'],
      'name' => $order_packslip_data['products_name'],
      'model' => $order_packslip_data['products_model'],
      'tax' => $order_packslip_data['products_tax'],
      'price' => $order_packslip_data['products_price'],
      'final_price' => $order_packslip_data['final_price']
    );

    $subindex = 0;
    $packslip_attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $oID . "' and orders_products_id = '" . (int) $order_packslip_data['orders_products_id'] . "'");
    if (tep_db_num_rows($packslip_attributes_query)) {
      while ($packslip_attributes = tep_db_fetch_array($packslip_attributes_query)) {
        $packslip_products[$index]['packslip_attributes'][$subindex] = array (
          'option' => $packslip_attributes['products_options'],
          'value' => $packslip_attributes['products_options_values'],
          'prefix' => $packslip_attributes['price_prefix'],
          'price' => $packslip_attributes['options_values_price']
        );

        $subindex++;
      }
    }
    $index++;
  }
?>

Where would a $vendors_query go? if that is what you are referring to
-Dave

#3845 kymation

  • Community Sponsor
  • 5,285 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 13 November 2009, 18:33

Oops, my mistake. I should have taken a closer look at this. It appears that it is also getting vID through the URL, and that is not being set. The first query is also never being used, and would be useless in any case. So, in admin/vendor_packingslip.php, find this code:

  $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
  $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int) $oID . "'");
and change it to this:

  $oID = (int) $_GET['oID'];
  $vID = (int) $_GET['vID'];
Let me know if that helps.

Regards
Jim

#3846 Roaddoctor

  • Community Member
  • 595 posts
  • Real Name:David Jennings

Posted 13 November 2009, 18:35

disregard

Edited by Roaddoctor, 13 November 2009, 18:35.

-Dave

#3847 Roaddoctor

  • Community Member
  • 595 posts
  • Real Name:David Jennings

Posted 13 November 2009, 18:42

Your awesome

that did it. Thank you!

Hopefully :) I wont be back too soon... going to do some heavy testing this evening and try to break it
-Dave

#3848 kymation

  • Community Sponsor
  • 5,285 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 13 November 2009, 18:51

No problem. You found a real bug this time. Now I need to put up a new release using this fix. Thanks for the bug report.

Regards
Jim

#3849 Roaddoctor

  • Community Member
  • 595 posts
  • Real Name:David Jennings

Posted 13 November 2009, 19:35

While your at it... another tiny bug in admin/vendor_packingslip.php

I believe your line 147 is unnescessary and causes a column offset issue. in IE at least, havent tried others. please confirm, or correct me.

Thanks!
-Dave

#3850 kymation

  • Community Sponsor
  • 5,285 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 13 November 2009, 20:01

Right again. There are only three columns there, not four. Thanks for the bug report.

Regards
Jim

#3851 kymation

  • Community Sponsor
  • 5,285 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 15 November 2009, 03:07

I've uploaded a revised package with the above fixes included. It's waiting for admin approval.

Regards
Jim

#3852 Tartan Barty

  • Community Member
  • 80 posts
  • Real Name:Paul Bartlett

Posted 19 November 2009, 13:29

I have a problem with MVS (great contrib though)which may have been covered on this thread but after reading about 60 pages my eyes started to hurt!!

I have 4 vendors set up. One of these uses Royal Mail First, Second and Special delivery methods (so 3 methods installed on the vendor). My weight limit for first class is 1.5kg. If a customer orders 2kg worth of stuff then it would have to go Special Delivery. On the delivery page of checkout first class still shows up with a £0.00 price and is clickable. This means that the customer can select first class and get free postage. Is there a fix for this??

Another thing that I would like MVS to do is if a customer buys a big product from me which costs £200 to deliver but also orders some small items, then the large shipping costs swallows up the small one. I.e. customer orders £3000 product with £200 deliver. They also order 3 small products £30 total with £3 delivery. Total cost £3030 with only £200 delivery and not £203. Is this possible?

Many thanks

#3853 kymation

  • Community Sponsor
  • 5,285 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 19 November 2009, 18:18

1. That's a problem with the Royal Mail module, not MVS. I'm not familiar with that module, so I probably won't be much help. I actually wasn't even aware that module had been modified for MVS. I suggest posting on the Modules forum for anyone who knows that one.

2. There is currently no way to do this. It would be difficult to implement if the charges are from different "vendors."

Regards
Jim

#3854 Tartan Barty

  • Community Member
  • 80 posts
  • Real Name:Paul Bartlett

Posted 19 November 2009, 19:44

Sorry Jim not explaining myself very well. I have just copied the table shipping method to give table1 - royal mail first class, table2 - royal mail second class and table3 - 2-3 day service. Without MVS when the cart weight exceeds the max in the table it doesn`t appear. Somehow this bit is lost when using MVS. So once a cart exceeds the max weight of the table it still appears but with #0.00 and is selectable.

Does that make sense??

Edited by Tartan Barty, 19 November 2009, 19:46.


#3855 kymation

  • Community Sponsor
  • 5,285 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 19 November 2009, 19:51

The Table module used in MVS doesn't have any upper limit. The highest price in the table is used for any shipment over the maximum weight in the table. I don't see how you are getting 0.00 from that. In any case, the Table module would need to be modified to have a maximum weight limit. It shouldn't be hard to do that though.

Regards
Jim

#3856 psychoder

  • Community Member
  • 34 posts
  • Real Name:Best in town
  • Gender:Male
  • Location:Nashville, TN

Posted 24 November 2009, 21:55

I somehow do not see the manage box on the right, when I click the manage button. Anyone have any idea what the problem might me, I checked vendor_modules.php file and it is still same with the original file that comes with the contribution. This used to work when I first installed it.

The other parts seem to work. The vendors I added before there was this problem seem to also work for shipping estimates and all, but manage page does not show installed modules too. I checked the configuration table and it seems to be intact as well.

Edited by psychoder, 24 November 2009, 21:56.


#3857 kymation

  • Community Sponsor
  • 5,285 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 24 November 2009, 22:16

This could be due to a problem in a module. Have you added any new modules lately? What have you changed since the last time you know this was working?

Regards
Jim

#3858 psychoder

  • Community Member
  • 34 posts
  • Real Name:Best in town
  • Gender:Male
  • Location:Nashville, TN

Posted 24 November 2009, 23:13

View Postkymation, on 24 November 2009, 22:16, said:

This could be due to a problem in a module. Have you added any new modules lately? What have you changed since the last time you know this was working?

Regards
Jim

I have a bunch of contributions installed, but I did not add a new shipping module. the new contributions I added have nothing to do with vendors or shipping, I added some search enhancement, some category tools. I do not think I modified any related files as well. But I added new vendors, and I am trying to insert shipping module information for that thats when I noticed this problem.

Edited by psychoder, 24 November 2009, 23:14.


#3859 kymation

  • Community Sponsor
  • 5,285 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 24 November 2009, 23:32

Then it's most likely something in that file. Look at the bottom of the page source to see where it's stopping. Post the last 20 lines or so here if that's not enough for you to figure it out.

Regards
Jim

#3860 psychoder

  • Community Member
  • 34 posts
  • Real Name:Best in town
  • Gender:Male
  • Location:Nashville, TN

Posted 25 November 2009, 15:43

View Postkymation, on 24 November 2009, 23:32, said:

Then it's most likely something in that file. Look at the bottom of the page source to see where it's stopping. Post the last 20 lines or so here if that's not enough for you to figure it out.

Regards
Jim


  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require_once(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require_once(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

This is the part where it prints the right manage box,the previous lines adds the install button etc. As I mentioned before this file is just same as the file that came with the package...

While searching on google, I came across something mentioning manage button not working with some contribution called multiple admins. I do not have that contribution but I do have a second admin on the website which I added recently. Was wondering if there would be a problem because of the admin rights?