Forums / Customization from the Admin / Mysql : fetch all sales details for specific manufacture

Mysql : fetch all sales details for specific manufacture

Started by jonnyboy22 on 26 Aug 2011, 8:01 AM · Views: 1,154

Results 1 to 4 of 4
26 Aug 2011, 8:01 AM
#1
jonnyboy22 avatar

jonnyboy22

Zen Follower

Join Date:
Jun 2008
Location:
Sheffield South Yorkshire
Posts:
165
Plugin Contributions:
1

Mysql : fetch all sales details for specific manufacture

Hello,

I have a client who is selling tickets via the zencart system. He wants to have a page where he can view all the tickets sold for a certain gig. gigs are grouped by manufacture.

e.g.
all day ticket - £22 - manufacture = event Name
Weekend ticket - £42 - manufacture = even name

What i need to do is drag from the database the sales info secific to the event

e.g select * from database WHERE manufacture = event name AND date = last month

Then i need to display in table format
product id
transaction id
customer name
items ordered + item totals
customer address
order total

Does anyone know if any modules come close to displaying something like this that i can tweak? Failing that I may have to try and code one up from scratch (but rather not!)

Want to switch servers? see our how to migrate Zencart guide
Supercharge your website with our **Fast Zencart Hosting**

26 Aug 2011, 9:25 AM
#2
jonnyboy22 avatar

jonnyboy22

Zen Follower

Join Date:
Jun 2008
Location:
Sheffield South Yorkshire
Posts:
165
Plugin Contributions:
1

Re: Mysql : fetch all sales details for specific manufacture

Ive installed orders export and it seems to have alsmost what i need.

I having trouble editing the following

$filelayout_sql = "SELECT

zo.orders_id as v_orders_id,
customers_id as v_customers_id,
customers_name as v_customers_name,
customers_company as v_customers_company,
customers_street_address as v_customers_street_address,
customers_suburb as v_customers_suburb,
customers_city as v_customers_city,
customers_postcode as v_customers_postcode,
customers_country as v_customers_country,
customers_telephone as v_customers_telephone,
customers_email_address as v_customers_email_address,
date_purchased as v_date_purchased,
orders_status_name as v_orders_status_name,
products_model as v_products_model,
products_name as v_products_name,
products_options as v_products_options,
products_options_values as v_products_options_values
FROM ".TABLE_ORDERS_PRODUCTS." zop LEFT JOIN ".TABLE_ORDERS_PRODUCTS_ATTRIBUTES." opa
ON(zop.orders_products_id = opa.orders_products_id), ".TABLE_ORDERS." zo, ".TABLE_ORDERS_STATUS." zos
WHERE zo.orders_id = zop.orders_id
AND zo.orders_status = zos.orders_status_id
";

the above code works fine but what i want to add is

('zo.orders_id','customers_id') as barcode_id,

but this doesnt work, any ideas?

Want to switch servers? see our how to migrate Zencart guide
Supercharge your website with our **Fast Zencart Hosting**

26 Aug 2011, 11:12 AM
#3
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Mysql : fetch all sales details for specific manufacture

You seem to want to be combine those two fields. Is is a simple concatenation? If so, adding

CONCAT(zo.orders_id,customers_id) as barcode_id,
```should work.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

1 Sep 2011, 1:10 PM
#4
jonnyboy22 avatar

jonnyboy22

Zen Follower

Join Date:
Jun 2008
Location:
Sheffield South Yorkshire
Posts:
165
Plugin Contributions:
1

Re: Mysql : fetch all sales details for specific manufacture

thanks that worked a treat, now i need to somehow limit it so it only fetches orders which match the manufacture ID e.g. Select * from table where manufacture_id = 2

Want to switch servers? see our how to migrate Zencart guide
Supercharge your website with our **Fast Zencart Hosting**