Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Nov 2006
    Posts
    13
    Plugin Contributions
    0

    Default Show manufacturer on invoice?

    Does anyone know if there is an easy way to show the manufacturer for each product on the invoice in admin? I've been searching for awhile and can't dig anything up.

  2. #2
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,196
    Plugin Contributions
    0

  3. #3
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    663
    Plugin Contributions
    0

    Default Re: Show manufacturer on invoice?

    You would just go by making a mysql call for each product, to lookup the manufacture and print it on the page. Similar to the post in the thread linked above!

  4. #4
    Join Date
    Nov 2006
    Posts
    13
    Plugin Contributions
    0

    Default Re: Show manufacturer on invoice?

    Thanks for pointing me in the right direction. Very helpful. I've hit a snag though when trying to modify this to show the manufacturer. Since the manufacturer_id is not stored with the order, how can I query the db? Please bear with me, I'm fairly new to PHP.

    Here's my query:

    <?php $manufacturersid_sql = $db->Execute("SELECT manufacturers_id from ".TABLE_MANUFACTURERS." WHERE manufacturers_id = '".$order->products['manufacturers_id']."'"); ?>

    but I realize this won't work. Any suggestions would be greatly appreciated!

  5. #5
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    663
    Plugin Contributions
    0

    Default Re: Show manufacturer on invoice?

    Ok I thought you only needed some small pointers...

    Here is a code I just wrote for you to use:
    find in admin/invoice.php at line 156
    PHP Code:
        for ($i 0$n sizeof($order->products); $i $n$i++) { 
    replace with
    PHP Code:
        for ($i 0$n sizeof($order->products); $i $n$i++) {
        
    //manufacture hack start
        
    $manufacture_id_sql "select m.manufacturers_name, m.manufacturers_id
                              from " 
    TABLE_PRODUCTS " p, " .
                                
    TABLE_MANUFACTURERS " m
                              where p.products_id = '" 
    . (int)$order->products[$i][id] . "'
                              and p.manufacturers_id = m.manufacturers_id"
    ;
        
        
    $order->products[$i]['manufacture_id']=$manufacture_id_sql->fields['manufacturers_id'];
        
    $order->products[$i]['manufacture_name']=$manufacture_id_sql->fields['manufacturers_name'];
        
    //manufacture hack end 
    Then print anywhere in the loop the manufacture's name or id by using
    PHP Code:
    <?php echo $order->products[$i]['manufacture_id']; ?>
    or
    PHP Code:
    <?php echo $order->products[$i]['manufacture_name']; ?>

  6. #6
    Join Date
    Nov 2006
    Posts
    13
    Plugin Contributions
    0

    Default Re: Show manufacturer on invoice?

    Thanks for such a speedy reply, Masterblaster. I appreciate it. I've replaced the code as suggested and then added this in about line 182 but nothing is displaying. Did this work on your end?

    <td class="dataTableContent" valign="top">' . $order->products[$i]['manufacture_name'] . '</td>' . "\n";

  7. #7
    Join Date
    Nov 2006
    Posts
    13
    Plugin Contributions
    0

    Default Re: Show manufacturer on invoice?

    Sorted it out:

    $manufacture_id_sql = $db->Execute("select m.manufacturers_name, m.manufacturers_id
    from " . TABLE_PRODUCTS . " p, " .
    TABLE_MANUFACTURERS . " m
    where p.products_id = '" . (int)$order->products[$i][id] . "'
    and p.manufacturers_id = m.manufacturers_id");

    THANK YOU, MASTERBASTER!!!!

  8. #8
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    663
    Plugin Contributions
    0

    Default Re: Show manufacturer on invoice?

    You are welcome, glad you found out yourself.

  9. #9
    Join Date
    Jan 2006
    Posts
    16
    Plugin Contributions
    0

    Default Re: Show manufacturer on invoice?

    Quote Originally Posted by digitalrust View Post
    Sorted it out:

    $manufacture_id_sql = $db->Execute("select m.manufacturers_name, m.manufacturers_id
    from " . TABLE_PRODUCTS . " p, " .
    TABLE_MANUFACTURERS . " m
    where p.products_id = '" . (int)$order->products[$i][id] . "'
    and p.manufacturers_id = m.manufacturers_id");

    THANK YOU, MASTERBASTER!!!!

    Hi Digital, can you tell me where you placed this code,, i am also trying to do the same thing.

  10. #10
    Join Date
    Nov 2006
    Posts
    13
    Plugin Contributions
    0

    Default Re: Show manufacturer on invoice?

    Sure, here's my whole invoice.php file so you can see how it's implemented. I had to modify the tables in order to display the name column. Bascially look at lines 148, 158, 183, and 206 where I changed the colspan to 9.

    I'll also note that I have stock by attributes installed so my page may include some additional code as well.
    Attached Files Attached Files

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Show Manufacturer in New Products
    By rustydutch in forum General Questions
    Replies: 6
    Last Post: 9 May 2011, 05:43 PM
  2. show manufacturer in confirmation email
    By lucafrangi71 in forum General Questions
    Replies: 8
    Last Post: 28 Aug 2009, 09:53 PM
  3. do not show Manufacturer in Product info
    By chg2winter in forum General Questions
    Replies: 3
    Last Post: 9 Aug 2008, 10:27 AM
  4. Show manufacturer products
    By Svanis in forum Upgrading from 1.3.x to 1.3.9
    Replies: 7
    Last Post: 7 Sep 2006, 02:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg