Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

I was hoping someone had the admin side done or at least the admin/categories.php that is where I think the problem lies.

Share this post


Link to post
Share on other sites

do you perhaps have the admin side converted to 2.3.4 or at least to 2.3.1? the file I have is mvs1.3 which isn't completed the admin side I feel is the problem

Share this post


Link to post
Share on other sites

The version I have also has a lot of other mods installed, so I'm not sure how much good it will be. Here's the code.

 

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

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Thanks Jim much appreciated. Yeah you have a lot of mods lol but I probably using most of them as well. Now lets see if I at least can get the admin side of this done tnt.

Share this post


Link to post
Share on other sites

The products_sort_order and products_qty_blocks part of MVS or another mod? I think the products_sort_order is for the products_by_vendor page is it not? or thats not the case? I am just wondering if I need this field

Share this post


Link to post
Share on other sites

It is now saving the vendor my issue now that the products_by_vendors is bot being populated. It loads and doesnt do anything after that. I am completely lost on that. It uses javascript correct?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

OK I looked at my database it's something wrong. I ordered from my_store vendor id# is 1 the order says vendor_id 0. That is very strange

Share this post


Link to post
Share on other sites

IS there a way I can debug this on where it's coming from and print out the array on each page to figure out if the code is correct? That area I am not familiar on

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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 ) )

Share this post


Link to post
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

Share this post


Link to post
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)

Share this post


Link to post
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
)

Share this post


Link to post
Share on other sites

Hmm I see a problem I think correct?

 

Vendor None and My store has same ID#

 

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

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

Share this post


Link to post
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'];
  }

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

I can't figure it out what is wrong here. Makes no sense at all. maybe someone can zip some files that indeed work on a test for 2.3.4. I just don't know why it's not working

Share this post


Link to post
Share on other sites

I think I am going to manually install it; instead of using winmerge maybe my best solution. THanks JIm though for all your help.

Share this post


Link to post
Share on other sites

Omg I think I found the problem I mispelled a $products_query instead of vendors_prod_id I had it vendor_prod_id I will test tm if that was it thats dumb as heck lol and driving me nuts for days

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

×