Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

what does this code do in admin/categories.php is that new? When I click that link I get strange characters,,,

 $vendors_query_2 = tep_db_query("select v.vendors_id, v.vendors_name from vendors v, products p where v.vendors_id=p.vendors_id and p.products_id='" . $pInfo->products_id . "'");
            while ($vendors_2 = tep_db_fetch_array($vendors_query_2)) {
              $current_vendor_name = $vendors_2['vendors_name'];
            }
Edited by drillsar
Link to comment
Share on other sites

That code returns the name of the vendor that product is associated with.

 

Firefox has problems with some archive files. Right click the link and select Save Link As.

 

Regards

Jim

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

Link to comment
Share on other sites

I have no clue on what is going on here with this. Something is wrong here in the code somewhere along the line in the admin section. For one I noticed that I selected a module for my vendor as flat rate other for individual rate. When I went to check out both rates where shown but I only added the vendor with flat rate only. So obviously something is wrong and I believe probably in the admin area. I guess this error when I totally checkout:

 

Warning: strpos() expects parameter 1 to be string, array given in /home/giftboun/public_html/includes/classes/vendor_shipping.php on line 46

 

Hmm? I just checked my mysql it seems the datatbase is InnonDB instead of MyISAM would that matter or no?

 

I am going to drop the tables and see if that is indeed the issue

Edited by drillsar
Link to comment
Share on other sites

I know about print_r I just don't know where to put it at that is my ?

 

for instance I see this

 

//MVS start
            $vendors_query_2 = tep_db_query("select v.vendors_id, v.vendors_name from vendors v, products p where v.vendors_id=p.vendors_id and p.products_id='" . $pInfo->products_id . "'");
            while ($vendors_2 = tep_db_fetch_array($vendors_query_2)) {
              $current_vendor_name = $vendors_2['vendors_name'];
            }   

 

I want to find out if indeed fields are being drawn in.. I really need to debug this in categories.php I think is the problem or application_top perhaps

Edited by drillsar
Link to comment
Share on other sites

Add this code where you want to see what the value of $foo is:

print '<pre>';
print_r(#foo);
die;

The system will print out the value of $foo, even if it is an array, and then stop at that point. Insert this code after the point where you think the value should be defined.

 

Regards

Jim

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

Link to comment
Share on other sites

Ok I did the following in prods_by_vendor

 

<td class="main" align="left"><?php echo TABLE_HEADING_VENDOR_CHOOSE . ' '; ?><?php echo tep_draw_form ('vendors_report', FILENAME_PRODS_VENDORS) . tep_draw_pull_down_menu ('vendors_id', $vendors_array,'','onChange="this.form.submit()";');?>

<?php print 'Product Vendors:';
 print_r ($vendors_array);?></form></td>

 

I get the following result and when I click on it it dont change value

 

Product Vendors:Array ( [0] => Array ( [id] => 1 [text] => My Store ) [1] => Array ( [id] => 3 [text] => test ) )

Link to comment
Share on other sites

Ok this is what I did.. I made this change:

 

<form action="test.php" method="post">
                <td class="main" align="left"><?php echo TABLE_HEADING_VENDOR_CHOOSE . ' '; ?><?php echo tep_draw_form ('vendors_report', FILENAME_PRODS_VENDORS) . tep_draw_pull_down_menu ('vendors_id', $vendors_array,'','onChange="this.form.submit()";');?></td>

 

the results of test.php

 

Array ( [vendors_id] => 3 )

 

So I think thats right because the vendor id is 3

Link to comment
Share on other sites

Jim I did the following:

 

in prod_vendors.php  I put this in the bottom. I believe the problem is the $vendors_query array and $vendors_array when I click on select vendor both these fields don't change this is the results I got

$vendors_id = 1$show_order = desc$sort_by_filter = p.products_price$languages_id = 1$vend_query_raw = select vendors_name as name from vendors where vendors_id = '1'$vendors_array = Array(    [0] => Array        (            [id] => 1            [text] => My Store        )    [1] => Array        (            [id] => 3            [text] => test        ))$vendors_query = mysqli_result Object(    [current_field] => 0    [field_count] => 2    [lengths] =>     [num_rows] => 2    [type] => 0)$vendors = Array(    [name] => My Store)
Link to comment
Share on other sites

I added this in my categories.php. $vendors_query_2 no results is this a misprint or is it supposed to have two $vendors_query in the code?

 

print '<pre>';
print '$languages_id = ' . ($languages_id) . '<br>';
print '$vendors_query_2 = ';
print_r ($vend_query_2);
print '<br>';
print '$vendors_query = ';
print_r ($vendors_query);
print '<br>';
print '$vendors_array = ';
print_r ($vendors_array);
print '<br>';
print '<br>';
print '$product_query = ';
print_r ($product_query);
print '</pre>';
exit;

 

Results

$languages_id = 1
$vendors_query_2 = 
$vendors_query = mysqli_result Object
(
    [current_field] => 0
    [field_count] => 2
    [lengths] => 
    [num_rows] => 2
    [type] => 0
)

$vendors_array = Array
(
    [0] => Array
        (
            [id] => 1
            [text] => NONE
        )

    [1] => Array
        (
            [id] => 1
            [text] => My Store
        )

    [2] => Array
        (
            [id] => 3
            [text] => test
        )

)


$product_query = mysqli_result Object
(
    [current_field] => 0
    [field_count] => 19
    [lengths] => Array
        (
            [0] => 16
            [1] => 1036
            [2] => 46
            [3] => 1
            [4] => 2
            [5] => 10
            [6] => 0
            [7] => 21
            [8] => 8
            [9] => 6
            [10] => 5
            [11] => 0
            [12] => 19
            [13] => 19
            [14] => 0
            [15] => 1
            [16] => 1
            [17] => 1
            [18] => 1
        )

    [num_rows] => 1
    [type] => 0
)
Link to comment
Share on other sites

here is I think a problem in prod_vendors.php missing a query

 

On line #31 here is the following code from prod_by_vendors.php:

 

Tell me I am wrong but if $vendors_id =1 than it will never change when you select a different vendor.

$vendors_id = 1;
  if (isset ($_GET['vendors_id']) && $_GET['vendors_id'] != '') {
    $vendors_id = (int) $_GET['vendors_id'];
  }
Link to comment
Share on other sites

in categories.php I found this, this don;'t look right

//MVS start
    $vendors_array = array(array('id' => '1', 'text' => TEXT_NONE ) );
    $vendors_query = tep_db_query("select vendors_id, vendors_name from " . TABLE_VENDORS . " order by vendors_name");
    while ($vendors = tep_db_fetch_array($vendors_query)) {
      $vendors_array[] = array('id' => $vendors['vendors_id'],
                                     'text' => $vendors['vendors_name']);
    }
//MVS end
Link to comment
Share on other sites

Both of the last two are correct. The first sets a default value, then changes it if $_GET['vendors_id'} is set. Look at the page URL -- is vendors_id set, and does it have a value? If so, that is the current vendor.

 

The second one builds an array of vendor IDs and names to use in a pulldown to select the vendor.

 

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