WooCommerce export CSV file - field

I am interested in purchasing the order/customer CSV reports exporter add-on from WooCommerce.
Can anyone please tell me what fields are generated in the file once its been exported and are these editable?
Thanks

You have some options when exporting orders. You can export with all items inside one column, or with each item on its own row. You can filter by date range for the export, and you can select which order statuses you would like to export via checkboxes.
If you export orders with each item on its own row, you have the following columns:
Order ID, Date, Order Status, Shipping, Shipping Tax, Tax, Cart
Discount, Order Discount, Order Total, Payment Method, Shipping
Method, Billing First Name, Billing Last Name, Billing Email, Billing
Phone, Billing Address 1, Billing Address 2, Billing Post
code, Billing City, Billing State, Billing Country, Billing
Company, Shipping First Name, Shipping Last Name, Shipping Address
1, Shipping Address 2, Shipping Post code, Shipping City, Shipping
State, Shipping Country, Shipping Company, Customer Note, Item
SKU, Item Name, Item Variation, Item Amount, Row Price
If you export clients, you get the following columns:
ID, First Name, Last Name, Email, Phone, Address, Address 2, Post
code, City, State, Country, Company
They do export as a CSV files so you can edit them with a program like Microsoft Excel.

Related

How to get details (unit, quantity, price) from XTRF customer invoice API?

We are using the Customer Invoice Api, but we can'n get the details of the jobs, as unit, quantity and price. Only the "totalAgreed", that is the amount already calculated (quantity * price) of the job. How can we recovery this information?
Project.json and invoice.json do not brint this information.
You can use the Browser API from XTRF. This way, you first create a view within XTRF where all the information is present. Then you execute the Browser API with the Customer Invoice ID as a filter.

How to query data that's present in one tab, but not in another?

In Google Sheets, I have a sheet with three tabs. One tab for subscriptions (containing a name, in this case an unique username + date + some personal information), one tab for unsubscriptions (with the same username as in subscriptions) and one tab where I want to show all active subscriptions.
An active subscription is when the username is present in subscriptions, but not in unsubscriptions. There is a possibility that the same username subscribes again, in which case there are multiple entries in the two tabs. In that case, it's active when the subscriptiondate is more recent than the last unsub.
The structure for both sub & unsubs-tab are the same, except for the headertext (Sub.date vs Unsub.date for example).
I now have a query which returns all the subscriptions + information needed for the "Active subs" tab. I don't know where to start for the "filtering" with the Unsubs-tab..
I expect a Query-like output with all active subscriptions with the information from the subscriptionstab I need. The information is in different columns, so subscriptiondate, address and so on are located in for example column E & F, while the unique username is in column B.
Might need a little adjustment but seems worth a try, in a spare column:
=if(and(maxifs(E:E,B:B,B1)=E1,maxifs(E:E,B:B,B1)>maxifs(UnSub!E:E,UnSub!B:B,B1)),"Y",)
then select on the basis of the presence of 'Y'.
The logic is supposed to be:
Is this the row that contains the most recent subscription date for this individual AND
is this individual's most recent subscription date more recent than the most recent unsubscription date for this individual?
So could be shortened a little to:
=if(and(E1=maxifs(E:E,B:B,B1),E1>maxifs(UnSub!E:E,UnSub!B:B,B1)),"Y",)
Or:
Is this the most recent date for this individual across both sheets?

Database Design for product prices depending on time of a day

I'm building a food ordering web application with a standard product/category setup - a category (for example Pizza) has many products (Pizza Salami).
Category
--------
id
name
Product
-------
id
name
category_id
The problem: the price of a category depends on the time of the day. For example for 2pm - 6pm and 9pm - 11pm the price for a pizza is cheaper.
How would I design the prices table and relationships in an effective way?
If your pricing is predictable, you could put a "base price" attribute in the product table, then read it from code, and calculate the "final price", depending on the time. You'll then store that final price in your orders table.
But if you want to be able to read tje final price from the database, I sugest you look into your database documentation, for how to create functions and views.

Creating a subscription in Stripe - I'm confused

I use stripe subscriptions for my users with one plan for, say, $10 per month for 100 API requests and that's a standard price. However, if the user has used 150 API requests, I charge them $10 + $3. For 200 and more requests it's $10 + $7.
Say, I've subscribed the user on October 9th. On November 9th the webhook event invoice.created will be called by stripe. So if the user has used 150 API requests, I have to add $3 more to the basic price (I can do that only within 1 hours according to Stripe documentation https://support.stripe.com/questions/metered-subscription-billing).
if even.type == 'invoice.created'
Stripe::InvoiceItem.create(
customer: stripe_customer_id,
invoice: event.data.object.invoice
amount: 300,
currency: 'usd',
description: 'additional price'
)
The questions:
Will the event invoice.created, indeed, be called on November 9th for the first time?
Will that additional price of $3 be added to the current invoice of $10 for October 9th-November 9th or will it be added to the future invoice for November 9th-December 9th? From the documentation it's not clear.
How do I add metadata to the original invoice of $10? I can add metadata to the additional invoice but in case the user has used less 100 API request I don't have to create the additional invoice at all, so I can't rely to the additional invoice.
It says
Create any invoice items before your customer is subscribed to the
plan, and then create the subscription via an update customer
subscription call.
but I subscribe the user once and forever on October 9th! How can I create an InvoiceItem before or on that (on October 9th) date if one month hasn't passed yet, and thus it's not known how many API calls the user makes (on October 9th the user has made, obviously, zero API calls)? I can only create InvoiceItems in 30 days because it's when I know how much to charge them on top on the $10! On October 9th I don't know that. Don't I understand anything?
Each time an invoice is created, you get the event invoice.created on your webhook. So when you subscribe a customer to a monthly plan on the 9th of November, you will get this event on the 9th of November, on the 9th of December, on the 9th of January, etc.
The first invoice for a subscription (generated when you create a subscription) is always closed immediately, so it is not possible to add an invoice item at that point. If that's something you want to do (for a setup fee for example) you need to create the invoice item before creating the subscription. That way it would get added automatically to the first invoice created when subscribing your customer.
In your case, you want to add fees to the next invoice based on the number of API requests your customer made during the month that just ended. So in the invoice.created event you need to detect whether it's a new month starting or the first one. If it's a new month, you then need to decide whether you have to add an Invoice Item to the user or not (based on the number of API requests).
You can't add metadata to the previous invoice from the month before. You just need to add the invoice item to the current invoice (for the month that is starting) and put a description indicating that the extra line item is for the consumption for the previous month.

Netsuite Tax Item Script

I have customers that have several ship to addresses in netsuite. My problem is this, each one of those ship to addresses needs a different tax item. So if I were to enter a sales order and select the customer, I need some way that when I select a ship to(from the drop down) the tax item is filled in with the correct one. I have yet to find a way to link a certain ship to address to a certain tax item, not to mention have it fill in once the ship to address is selected on a sales order. Any help is appreciated.
If these tax items are just for your reference, then you can create a custom record type and store the reference shipto & taxitem.
Then you can use client script to populate the taxitem based on the shipto by querying the custom record type.

Resources