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

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.

Related

Client needs to specify origin zipcode per item to calculate shipping costs

Basically the title. The client has multiple distribution locations with specific items coming from specific warehouses. They want to calculate shipping based on where the items are coming from specifically. I see the "Per Product Shipping" module but I am not sure that it does quite this. Im hoping to not have to write a custom plugin for this. Does anyone know how to do this out of the box, a module that already does it, or can cofirm thet Per Product Shipping does this already?
Thanks

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.

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?

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.

NopCommerce 3.6 Tax By Country & State & Zip always results in zero tax

The NopCommerce 3.6 Tax By Country & State & Zip plugin always returns zero tax for one of my stores. I have the same results locally and remotely, but the database was not copied from local machine. I performed the steps locally and then again remotely to help eliminate the particular environment as a factor.
What might be wrong?
Here are some screen shots to demonstrate.
Tax provider marked primary :
Test customer address contains example zip code.
No roles are marked exempt.
Set tax based on shipping address, etc.
Tax rates were imported via SSMS.
Customer is not exempt.
General tax category has been added.
CountryID of 1 is present.
Specific tax rate for test shipping address is identified.
I also attempted a test with a specific StoreId of 1, though there is only 1 store. Also the field is not nullable, zero acts as the wildcard.
All products are taxable and assigned to General tax category.
No tax displayed in the cart.
No tax displayed in checkout.
No relevant errors in the log.
As much as I wanted to avoid thinking it was true, this problem was created by a third party plugin. A vendor's alternate "One Page Checkout" was clearing the tax for the cart once the Checkout page was hit, and preventing that user from ever obtaining tax calculations in the cart afterward. Removing the plugin corrected the problem, and I've reached out to the vendor for support.
Thanks for anyone who took the time to look at this!
EDIT: To be clearer, what's occurring is that the Real One Page Checkout plugin creates NULL fields in the Address table and associates them with the customer. Therefore, any subsequent orders put in the cart by that customer will never calculate taxation again. I didn't investigate what else might be happening as a result.
I've downloaded the latest copy of the plugin and tested with the same results. All orders placed without the plugin installed work fine, with the plugin installed there are blank records added to the Address table and associated with the Customer.
Here is how the One Page Checkout plugin for nopCommerce works:
When the customers open the checkout page they start with blank addresses (that is why initially you see two empty addresses in the database - one for the billing address and another one for the shipping address) and that is why your taxes are 0 since there is still no any country selected.
Once the customer selects a country then the address in the database will be updated with the country id and all the tax calculations will be based on the newly selected country. The order total will also be updated and the customers will see the new taxes. If the customer changes the country again then the order total will again be updated again with the new taxes based on the new country.
By looking at the provided screenshots, your customer already has an address in his address book and you expect him to use the same address for any new orders.
In that case you can simply check these settings in the administration of the One Page Checkout plugin - Preselect Last Customer Billing Address and/or Preselect Last Customer Shipping Address.
This way when the customer starts the checkout it will not start with a blank address but with the address he has used to make his latest order.
Since the preselected address should already has a country selected then your taxes will automatically be shown for that country right from the start of the checkout.

Resources