Basically we have an ecommerce system where I am employed, that I have been assigned the task of developing solutions for, beyond what the out of the box solution can provide.
The pick sheets for the warehouse it currently provides are shoddy, they dont give any details for the customer whos ordered that product or anything like that, we currently use another one for the business to business side thats adequate enough for a user just with little amendments.
Enough of the waffle in describing the situation we are in or where our aims are, here's the SQL:
SELECT CONCAT(DATE_FORMAT(FROM_UNIXTIME(A3.date), '%e/%c/%Y'), ' ' ,DATE_FORMAT(FROM_UNIXTIME(A3.date), '%H:%i')) AS order_date, -- Displays date and time in 24hr format -- Order information A1.orderid AS orderid, A3.status AS status, -- Profile A5.login AS username, A5.title AS title, A5.b_firstname AS f_name, -- Billing but using it as first name A5.b_lastname AS l_name, -- Billing but using it as last name -- Profile Billing A5.b_address AS b_address, A5.b_city AS b_city, A5.b_zipcode AS b_pcode, -- Profile Shipping A5.s_address AS s_address, A5.s_city AS s_city, A5.s_zipcode AS s_pcode, -- Products line A4.value AS adventcode, A1.product AS descr, A1.amount AS qty, -- Order notes A3.customer_notes AS cust_notes -- A1.product, A1.amount AS qty, DATE_FORMAT(FROM_UNIXTIME(A3.date), '%e/%c/%Y') AS order_date FROM xcart_order_details A1 LEFT JOIN xcart_pricing A2 ON A1.productid = A2.productid LEFT JOIN xcart_orders A3 ON A1.orderid = A3.orderid LEFT JOIN xcart_extra_field_values A4 ON A1.productid = A4.productid LEFT JOIN xcart_customers A5 ON A3.login = A5.login WHERE A2.membershipid = '2' AND A3.status = 'P' AND A4.fieldid = '3' ORDER BY A5.login AND A1.orderid ASC
Quite a long one I know.
Basically what its doing at the moment when i read it out in PHP.
I have recreated the system invoice and replaced that with Pick List for the header, in standard HTML using a php file.
But if a user was to order 2 seperate items say HP 11 Black 69ml ink cartridge and a HP 69 whatever cartridge (2 different items).
Its listing these as different pick lists (2 peices of paper), with different items only with the same order no.
Therefore is there any somewhat easy way of coding probably in PHP a function or something that makes it keep the orders of the same number together listing the products ordered in table rows?
This is just beyond me at the moment cant seem to work out how to do this or is there an example someone could bring up, I can then edit that to get what we require out of it.
I do have some structure to it though it would involve 2 primary parts but in 3 sections.
Header (prints out the customers id or username rather, order no, and then billing and shipping information respectively) and then the products they have ordered from the same order no, and finally a footer of their notes for that order, which would include something like 'If I am not here blah blah blah'.
Can anyone help?


Sign In
Create Account


Back to top









