I've been provided with a Woocommerce SQL dump (don't have access to that platform anymore as it was shut down), and need to identify their most valuable customers and what they bought, i.e.
Customer X spent the most at $X, and the last purchase item was 'Red umbrella'
Customer Y spent next most at $Y etc
I can see a wp_users table which has the customer data, a wp_woocommerce_order_items table which has the items data.
My question is - where can I find revenue data, and how can I link these tables (which IDs in each table correspond to which other ID in other tables?) - in particular how do I link customers, to orders, to items?
Thanks a lot
Look for the table wp_postmeta in that table, the field _customer_user will hold the id of the customer who placed that order post_id field in that same table.
Related
I am new to Wordpress.
I am studying an already made site which has WooCommerce plugin.
Well, please see this image which shows a product list:
I have spent some hours trying to find where products and categorÃes are stored. There is not a product table neither category table neither a database table with similar names.
I have also exported the whole database in SQL format and then trying to find the product name or category name, but I could not find them.
Any one can point me to the right direction?
Thanks
Jaime
Woocommerce products are stored in wp_posts table with post_type column value as "product" and "product_variation".
Any additional product data will be stored in the wp_postmeta table.
The product categories and tags both are stored in the wp_terms table and can be identified as a category or tag based on its data in the wp_term_taxonomy table where it stores the product_cat value in the "taxonomy" column.
This is the sale price that is displayed (excluding the VAT) in addition to the quantity and the total price and the VAT, for each item in the order items table.
I would like to display the regular price and the discount of the product item.
I checked in the WC_Order_Item_Product, but I could not find the information and I do not want to retrieve it from the related product attributes because that information can change.
I want the information that was active when the order was created.
I searched on this site and and googled a lot but could find any information. Is it even possible ?
Here is the scenario:
In the Sales and marketing > Sales orders > All sales orders
I entered the lines by double-clicking the Sales order number
by doing that I am entering the lines of the sales order.
Now in my lines, there is a button there where I will use to add a syntax where I will insert fields in my newly created table.
I would like to know how can I know what record I am in (before entering the lines/before double-clicking the sales order number). I need to know what Sales order number I'm in as I enter the lines of the record.
In every form the current record of a specific FormDataSource has the same name of the FormDataSource. For example in the SalesTableListPage form the only datasource is called "SalesTable", so the current sales order record is identified in your code with the salesTable identifier.
Every record is extended from [Common]. There you have field TableId. You can get table name with [tableId2name].
You can inspect fields with DictTable and field* methods.
I'm new to Access and am trying to figure out the best way to write a query. I have a table that tracks security entry information for each employee which has an Employee ID field and a date field [ENTRYDATE]. Another table (tblSPACE) lists out where that employee sits and is updated each month with new information. There is a field in tblSPACE which tracks what month the information is from. [ASOFMONTHYEAR]. These two tables are related by a unique employee ID number. What I want to do is have a query that shows the entry information and the corresponding seat that that employee was in for that month. I'm thinking I need to add a criteria into one of the date fields to have it match the month of the other date field? Something like Where Month(tblSpace.ASOFMONTHYEAR) = Month(tblEntry.ENTRYDATE). But of course that doesn't work. Any guidance on how I should go about this? Sorry if I've not explained this well.
I've generated a simple access report that is used for purchasing.
Basically, there are two tables, one for purchase orders, and one for the items on the purchase orders.
For the items on an order, I store the item details, quantity ordered, quantity delivered, and price per unit. (plus a few other fields which aren't relevant in the context of this question).
I'm generating a report to list all outstanding items still on order, and the report has a calculated field showing the outstanding quantity * cost per item. This works perfectly fine.
What I'm struggling with, is showing a sum of this calculated field (i.e. a total cost of all outstanding items), but when I try to add a total to the column, it only gives me the option of adding an item count for the column. The column is a 'Currency' field.
What might I be doing wrong, or am I expecting too much from access?
Resolved. I created the only option that the GUI would allow (item count), then modified the query from:
=Count(*)
to
=Sum([Quantity]*[Cost])
Works perfectly.