WooCommerce Zip Code Pricing per Customer - woocommerce

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?

Related

Is it possible to add multiple prices to one product in Woo commerce depending on whether the customer is an individual or a professional?

My client has two customer types (enterprises and individuals), he wants to propose different prices regarding the customer type. This customer type should be defined when the customer creates its account. I still haven't found a solution to do this automatically : after account creation depending on whether the customer said he is an enterprise or an individual, I want that the right price is automatically selected. Do you have any idea of how to do this without a manual user role given ?
Before registration, is it possible de display both prices so that the enterprise also knows what it will have to pay if it registered ?
That would be awesome if you have any idea of plugins doing this or how to code this.
Thanks a lot
Have a good day !
I believe you are looking for a what will be called a Wholesale User Plugin. There's a handful of them out there that you could look into. It will allow you to set up multiple user roles with different pricing structures.

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.

How to get bestselling and favorites products in rest API in woocommerce?

I want to get bestselling and favorites products from woocommerce site with rest API .
I read this site but not found any thing about that.
Does it exist any way to get that ?
For People Who are Still Stumbling upon this Question
As per WC v3 API. You can now pull Most Popular products through the API (which is the best selling product list as per my understanding);
GET /wp-json/wc/v3/products?orderby=popularity&order=desc
This should get you the most popular products in descending order by the number of sales. This is not currently documented (as of Feb 2, 2021).
Total list of possible orderby params are: date, id, include, title, slug, modified, menu_order, price, popularity, rating
Another part of the question asks for Favorite product API, which woo commerce doesn't have.
I can see that you can access bestsellers through reports. See here. As for favourites, I think this is done using third party plugins or custom code so I'm not sure how you are going to access this. But if I was to hazard a guess I would probably assume it would be under customer meta

Best Way to Pass variable to Woocommerce Product?

Here is the setup.
Customer fills out form of information for product specifications. This creates an entry in the db with a unique detailsID.
They then are taken to a product page, with many variables. They select the variable product and checkout.
Now in the db they have an order as well as a separate table with the details of their request.
What is the best way to connect the product they bought with the detailsID?
I would like to basically pass the detailsID to the product page, then add this detailsID to the product. Or add the orderID back into the details table.
I keep going around whether to add this as meta data, or use a session, or just do post order logic to add the order ID back into the details table.
I really just need to link the two once the order completes but am not sure the best method to do this. I am pretty new to Woocommerce so don't know a lot of the hooks yet.
Thank you so much for your suggestions!
After a lot of research and experimenting here is the method I have decided on. This seems to add the information in a variety of places to make it easy to track orders and to insure that the customer is getting the customized product they want.
add custom data to woocommerce
I am using this method very close to how it is spelled out in this great article. This was really helpful for me being a woocommerce newb.

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