Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

manufacturer report


dirthawker

Recommended Posts

Hi, some of our manufacturers want to dropship their items directly to the customer. I''ve installed the margin report contribution and it is GREAT, and I plan to install the manufacturer email contrib. However, I was wondering if there was a report that would list our sales (monthly let's say) by manufacturer so we can cut a check to each company. (It would be nice if the margin report could be trimmed to a manufacturer.) I've looked through the mods and don't see anything like that... help?

-andrea-

Link to comment
Share on other sites

Mibble, question, or for anyone familiar with the Margin Report mod:

I swiped and tweaked a chunk of code from margin_report.php and plugged it into margin_report2.php.

 

      $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id order by m.manufacturers_name";
     $filterlist_query = tep_db_query($filterlist_sql);
     $page_contents .= '</td><td align="right" class="main">' . TEXT_SHOW . ' ';
     $m_options[] = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
     while ($filterlist = tep_db_fetch_array($filterlist_query)) {
         $m_options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
     }
     $page_contents .=  tep_draw_pull_down_menu('manufacturers_id', $m_options, (isset($_GET['filter_id']) ? $_GET['filter_id'] : ''), 'onchange="this.form.submit()"');

 

and changed the sql select so that if

(isset($_GET['manufacturers_id']) and $_GET['manufacturers_id'] <> '')

it will pull in only those with the right manufacturer's ID.

 

And believe it or not, it works. I'm not entirely sure how or why, but it does. B)

 

Now -- I'd like to pop the name of the manufacturer up there in the header. And I haven't got a clue because I have no idea how forms work! I can get hold of the id with $_GET['manufacturer_id'] but not the name. How do I get manufacturer_name into a variable? I know it's sitting there somewhere in the array and I don't think I need to do another SQL select....

Thanks

-andrea-

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