Latest News: (loading..)
Sign in to follow this  
Followers 0
cloudrunner

[Contribution]Manufacturer Name On Admin's Invoice

13 posts in this topic

Well, here's the thread folks. If you DL it, then I hope you find it useful. I will try to provide support for it as i can, but seeing as how it is EXTREMELY small and fairly straightforward, I shouldn't have to.

 

The reason that I am starting this thread is to enable you folks to help me out here. If you find a better way to grab the products_id from the order variable and it works (as $orders->products[$i]['id'] should but doesn't) then we can update the contribution as needed.

 

Thanks for the help, I hope you find it useful!

 

)O( Cloudrunner )O(

Share this post


Link to post
Share on other sites

I think part of the issue is that the manufacturer is not saved in the orders tables along with the other information. I would think a way of doing this would be to modify the code that writes to the orders table to include the manufacturers id. this way adding the manuf. to the invoice would be as simple as adding a field to the invoice.php.

 

There may be some gotcha's to this approach. I would also like this mod but just not at the top of my list to do. Someday when I really need it I might sit down and have the manuf. written to the order table.

 

thoughts?

Share this post


Link to post
Share on other sites

I really wanna stay away from some major hard-core mods. If I can simply get the products_id from the orders table then we'd be set and it'd take out three lines of code, but more on that later...still playing with myself...er it...

Share this post


Link to post
Share on other sites

Here's the updated system. I got the products_id working, so now there is no chance of a wrong MFG being associated with a product.

 

enjoy!!!

 

)O( Cloudrunner )O(

 

"Life is sexually transmitted." --anonymous

Share this post


Link to post
Share on other sites

looks good! seems to work without any issues....I will test it against some old sales with complex transactions to see....

 

Good Job!

 

B)

Share this post


Link to post
Share on other sites

hmmm...when i pull up an invoice with products from multiple manufacturers....all products default to the first manufacturer....need to look into this more....

 

B)

Share this post


Link to post
Share on other sites

Hello,

I happy to see that you are on this...

I was working on a solution but had to stop due to other programming issues...

there is a bug... like rodney said the mfg populates the entire mfg row. so the first mfg that your contrib grabs it just multi it on down the list.

I do belive you are on to somthing here but i wonder how you can associate the MFG with the product without having a mfg table in the order_products table?...

does this way put unneeded stress on the DB?...

it's almost there...

keep it up!

Share this post


Link to post
Share on other sites

Ahhhhh CRAP@!!

 

Will look into it more...gotta be in the loop somewhere. I really really do not want to alter the order table to do this...oh well...off I go!!!

 

Brandon

Share this post


Link to post
Share on other sites

fixed.

 

Have to add one line to orders.php in the admin/includes/classes area, and one name to the query, then make some minor adjustments to the invoice code, but it now shows all the manufacturers for the proper item.

 

Thank you jello1 and carrerarod for finding this!

 

Brandon

 

P.s. Here's the link again: http://www.oscommerce.com/community/contributions,1624

Edited by cloudrunner

Share this post


Link to post
Share on other sites
does this way put unneeded stress on the DB?...

It shouldn't with the update 1.1.

 

The reason is simple, we are now having the orders query simply add one more field to the list it pulls from the database already. We then use that to pull from the mfg list. It shouldn't show any increase as far as I can see other than adding one additional query to the system already in place. But then again, who knows until I can get it tested under a heavy load scenario.

 

Keep me posted with yer thoughts on the fix.

 

Thanks!

Brandon

Share this post


Link to post
Share on other sites
hmmm...when i pull up an invoice with products from multiple manufacturers....all products default to the first manufacturer....need to look into this more....

B)

 

Does anyone know if the above problem was fixed, or if there is another way to do this.

 

I'm actually trying to add the vendor (supplier) to the order page and can not seem to quite grab how to get this to work correctly.

 

Any help would be great.

Thanks

Share this post


Link to post
Share on other sites

hi . i have successfully installed this amazing/handy/fantastik contribution and the products list nicely under their manufacturer. i also list extra fields per products as author and isbn. from the products table

 

what i try to do is to display the manufacturer_url from the manufacturers_info table but i cant make the join of the tables at admin/includes/order.php

 

i have tried to improvise by looking at the manufacturers_info box from the catalog side but i cant understand it

 

 

*********************************this is the place that the join has to happen :-)

 

 

$orders_products_query = tep_db_query("select op.orders_products_id, op.products_id, op.products_name,products_person, products_isbn, op.products_model, op.products_price, op.products_tax, op.products_quantity, op.final_price, p.manufacturers_id,m.manufacturers_name from " . TABLE_ORDERS_PRODUCTS . " op left join " . TABLE_PRODUCTS . " p on p.products_id = op.products_id left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id = p.manufacturers_id where op.orders_id = '" . (int)$order_id . "' order by p.manufacturers_id");

 

************************************************************************

 

while ($orders_products = tep_db_fetch_array($orders_products_query)) {

$this->products[$index] = array('qty' => $orders_products['products_quantity'],

'products_person' => $orders_products['products_person'],

'products_isbn' => $orders_products['products_isbn'],

'name' => $orders_products['products_name'],

'products_id' => $orders_products['products_id'],

'model' => $orders_products['products_model'],

'tax' => $orders_products['products_tax'],

'price' => $orders_products['products_price'],

'id' => $orders_products['products_id'],

'final_price' => $orders_products['final_price'],

'manufacturers_id' => $orders_products['manufacturers_id'],

 

'manufacturers_name' => $orders_products['manufacturers_name']);

 

regards from greece

george

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
Sign in to follow this  
Followers 0