How do I display woocommerce sales data on front end in widgets - wordpress

I am wanting to know how to pull the woocommerce data from the backend to be displayed in a widget on the front-end. More specifically I am wanting to pull the data about total number of customers & the total amount of sales. This is to be used for a crowdfunding campaign page that I have built.
The total number of customers will be changed to backers & will update automatically when a sale has been processed.
The total number of customers will display the number of backers & will also update automatically when a sale has been processed.
The idea is that all you need to build a crowdfunding single campaign site is just woocommerce & a couple of free plugins, without the need for expensive plugins that you don't need in reality.
Any help with this would be greatly appreciated.
Cheers!

You might already know, but there are themes specially built for crowdfunding. I dont know any free plugins that can do that. The only way to get this data is to either grab them from database which will require some pretty advance mysql joins, or a better way would be to inspect the code that woocommerce uses to display the reports. Here is a great post on how to do just that http://imdev.in/woocommerce-how-to-get-total-sales-of-all-products-number/
You can use the code and create a plugin, which can then help other developers as well.

Related

Multi Store with Subdomains

I want to create multiple online shops for selling merchandise products for companies. The products are basically identical but should be personalized in dependence of the company I am building the shop for. Because I do not want to build a new shop every time a new company joins the program I am looking for something like that:
www.myshop.com : One shop with the underlying product database and checkout system - not showing any products, just as a parent structure
www.company1.myshop.com : A slightly personalized shop where only a selection of the product catalogue is available
www.company2.myshop.com : A slightly personalized shop where a different selection of the product catalogue is available
Do you get it?
Does anybody know a tool for that?
Thanks in advance!
I already looked into WooCommerce, Shopify and even WiX. As far as I understood what I am looking for is not supported.
Since your example is based off of subdomains, you can choose to assign a Shopify store to each subdomain. Each store feeds from your inventory and accounting, giving your customers the illusion of a custom experience. Or you can just simplify your life, have one store, and assign your customers to view collections specific to them. That is the smart move. You may not like that, but it would work a peach for you. You just tag customers to see their specific collections, of products specific to those collections. Simple.
I can also think of a dozen other ways to pull this off with Shopify, but that is me, not you. For an opinion question like this, SO is not the right place to ask these kinds of questions, but I answered anyway. Your mileage may vary of course.

Using WooCommerce. How to prompt for address before cart/checkout, based on the address (i.e. zipcode), show specific products available?

I am building out an ecommerce website using WordPress and WooCommerce. I'm able to set up my products and corresponding fees/taxes based on the address entered, but it's during checkout. I will have two locations which could have different inventory, so looking to have the address/zipcode check well before the cart/checkout so that specific products would be shown based on the address/zipcode.
I've searched everything and anything--all I can find is based on geolocation, but the shipping (or delivery) address is what I need to know ahead of time because someone can order from a different location but for delivery within the delivery area serviced.
Thanks in advance!
I have been looking for something similar, but I want to force the customer to put their zip code in before checkout so I can valid their cart for delivery.
I found this plugin:
https://wordpress.org/plugins/woocommerce-check-pincode-zipcode-for-shipping/
I haven't tested it, but it looks like something that could work for what you are doing. It can check stock of product based on a zip code at any given location.

WooCommerce Zip Code Pricing per Customer

Sorry I don't have any code to show yet as I'm just trying to find a solution.
I'm in need of a way to set the price of products based on the users billing zip code. I have a custom registration form, I was thinking of somehow figuring this out during that process. Basically after they fill out their billing info, somehow check their zip code and and apply a price for that customer.
I may be able to write a custom API that would take the zip code and return a price. But what would I do with this price? Store it in user_meta? Then I would have to override $price in a million different templates.
I have googled this and didn't come back with much.
What would the best approach be for this?

woocommerce generate producer-orderlists

For a certain webshop, products are made by three different producers. Orders placed by users have to be ordered at these vendors. I'm looking for a add-on which which is capable making producer-orderlists based on the woocommerce orders which the webshop then can send to the producers. I already build in producer support for woocommerce items. There are some specific requirements (such as aggregation) which i can edit myself.
I looked around but find it hard to believe, no such solution is available.
It's different from dropshipping because the producer does not directly send to the customer. These plugins do not suit since they are transparant to the user, offer backend logins for the producers and so on.
Any suggestions?

Wordpress : data exchange betweeen two plugins

I want to develop a website where teachers create exams and students pay money in order to pass these exams, so it's an e-commerce website where products are quiz.
The exams will be managed with a quiz plugin : i'll use Watu.
I still have no idea what e-commerce plugin I'll use.
What I want is to make exams as products so students can add them to cart, but I dont't see how can I do it : the e-commerce plugin manages its own products !!! Is there an easy way to do it ?
This is my idea: alter the quiz module so when an exam is created the script insert a row in the e-commerce table(s), so when I go to the e-commerce plugin I'll find a new product! But I think this is not a clean way !!
You might consider setting up woo-commerce setting a link as a software product that will be delivered on checkout.
You could build a quiz answer table in sql, deliver a generic quiz (via a link sold in the store)
the quiz table could have a field for quiz_id and you could have their answers recorded as a text field.
so the link would be delivered digitally thru the store, your answers 1-100 a-d might look like this:
userid: xxxxx
autodate
test: 1
Answer:abadddaeababadddaeababadddaeababadddaeababadddaeababadddaeab
so one entry would contain all the answers on the test in question in one field.
once committed you could return a result based on a difference function from a pattern mask.
how many wrong answers in the simple query.
You then can store the answers and draw data based on what particular answers they got wrong.
they can also retake the same test at a later date and you can see each time how they did.
advantages of using a single text field means that you can use a single compare to pull the data and it's short to store.
with a membership plugin. Give roles afther payments. Diferent roles for diferent levels of exam. It´s easy than make conexion with database.

Resources