Zen Cart Logo
Forums / General Questions / How does the ordering process "come together"

How does the ordering process "come together"

Views: 851

Results 1 to 5 of 5
13 Jun 2012, 4:17 PM
#1
philip56 avatar

philip56

Zen Follower

Join Date:
Sep 2007
Location:
Herne Bay, Kent, England
Posts:
182
Plugin Contributions:
0

How does the ordering process "come together"

Hi everyone. I'm developing my own plugin to allow a Warehouse Location to be shown on the paperwork we use to pick the stock to facilitate speeding location of the stock. It's going well but I need to input information into TABLE_ORDERS_PRODUCTS and I can't find the appropriate php file where this happens for each order. Could anyone point me in the right direction? I've tried using Developers Toolkit but it hasn't been very useful.
Many thanks in anticipation.
Philip

14 Jun 2012, 2:27 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How does the ordering process "come together"

I see you've been posting the same question in the Super Orders support thread.

My question is: WHY do you think you need to put ANYTHING in the orders_products table?

If your warehouse-location-info is already in another table, and especially if it's already related to your products in some way, then why don't you just tell whatever tool you use to print your warehouse sheets (I'm guessing Super Orders since that's where you started posting) to look up that data from those other tables, and output it that way.
There's no need to store warehouse location info in "yet another" place in the database, if it's already available in the database somewhere.

In short, you've been posting with a technical "solution" already madeup in your mind. I'm not sure it's the best solution. I don't want to give you answers that push you further in the wrong direction. So let's back WAY up and start with what is the business problem you're trying to solve, and what data/tools you already have available. And work out the best solution from there.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Jun 2012, 3:11 PM
#3
philip56 avatar

philip56

Zen Follower

Join Date:
Sep 2007
Location:
Herne Bay, Kent, England
Posts:
182
Plugin Contributions:
0

Re: How does the ordering process "come together"

I take your point Dr Byte. I know the direction in which I should be going - I just can't get my head around the code.

BTW I'm not in the habit of multiple posting - I just realised this was the more appropriate place.

15 Jun 2012, 4:23 PM
#4
philip56 avatar

philip56

Zen Follower

Join Date:
Sep 2007
Location:
Herne Bay, Kent, England
Posts:
182
Plugin Contributions:
0

Re: How does the ordering process "come together"

What I should have done yesterday was explain what I think the best solution to my problem is and seek help with that. Unfortunately embarrassment/pride got in the way. I'm over that now.
I should say at the outset that I am new to php - in fact this is my first "real" project.
I do indeed use super orders but a lot of the grunt work is done by ZC files, in this case order.php. I've put my data in warehouse_location in the PRODUCTS table. It seems to me that as data from the orders_products table, for each item I need to call warehouse location from TABLE_PRODUCTS. The best common link would be product_model. The code to achieve that escapes me and any help would be much appreciated.
Regards
Philip

15 Jun 2012, 5:44 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How does the ordering process "come together"

The best common link would be the products_id.

SELECT warehouse_location from products where products_id = 33;
select op.*, p.warehouse_location from orders_products op, products p 
where op.products_id=p.products_id
and orders_id=5;

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.