WooCommerce REST API to get Customer information by phone number - woocommerce

I am integrating WooCommerce with another app that requires to pull customer data from WooCommerce based on their phone numbers instead of Customer ID or Email.
I didn't find any standard parameter for the number number.

Related

How to charge different amount on an order after processing via WooCommerce API

Take this example:
A user places an order for 2 items on a WooCommerce shop. The order is picked up (using REST) by a POS (Point-of-Sale) system. The owner discovers that only one of the items is available (for whatever reason) and decides to amend the order by removing the non-existing item.
How does the POS system tell WooCommerce (via REST API) that the order is "completed" (so that WooCommerce plug-in can do the capture (charge) of the payment at the payment provider), but at the same time tells WooCommerce that it should only charge the price for the one item, and not the price registered on the order?
In another shop we manage, we can tell the shop the amount to charge when we change the order status to "completed" - how do we do this properly in WooCommerce?
Option 1:
Some payment methods e.g. PayPal allows you to authorize (reserve the amount) without capturing it right away, so this could be used to address your issue in the following flow:
Payment method payment action is set to Authorize to reserve the funds on customers account.
Customer places an online order.
POS system calls GET /wp-json/wc/v3/orders/<id> to retrieve order details.
Optional. Changes are made to order items and PUT /wp-json/wc/v3/orders/<id> Rest API endpoint called to update the order details.
Another PUT /wp-json/wc/v3/orders/<id> request is made to change order status from processing to completed. This will trigger payment method to capture the funds based on current order total.
Note: It might be possible to combine steps 4 and 5.
Option 2:
If payment method you are using does not support authorizations, your other option is refunds.
Payment method configured to capture the funds.
Customer places an online order.
POS system calls GET /wp-json/wc/v3/orders/<id> to retrieve order details.
PUT /wp-json/wc/v3/orders/<id> request is made to change order status from processing to completed.
A refund in desired amount can be created by calling POST /wp-json/wc/v3/orders/<id>/refunds end point.
Note: Some payment methods do not support partial refunds. A REST API call will be needed to update order and remove products that could not be shipped. You may need to test when it is the best time to make such call so it does not affect refund/order totals.

WooCommerce Flexible Checkout Fields Price Change

I'm using Flexible Checkout Fields plugin with wooCommerce. I have a select field where the user selects a number of attendees and 1, 2, or 3 team players. Each player option has a price. IF the user has a membership I want to override the player price and set it to 0. I was trying to do this with FCF Field validation with no luck. If you're wondering, the product in question has a base price everyone is charged, so using membership discounts won't work in the product. I thought about changing it to a variable product, but that started getting really messy as a user may have 3 attending, but only 1 or 2 playing. The simplest approach seemed to be just to validate the player fee based on membership and number chosen.
FCF validation number filter.

How can I receive payment in multiple currency in wordpress Woocommerce?

I just installed wordpress and woocommerce, my default currency is USD.
Now when I convert the currency on store it is working smooth. I mean it is changing from USD to INR.
Now say I want to make payment in INR and product cost is USD100 and after converting currency it display INR6500 but when I checkout it pass INR100 to payment gateways.
Kindly suggest.
I was using a plugin long back, currency swicher. This plugin will change your plugin will convert your customer's currency automatically based on their addresses. But you have to enter the conversion rates for currency in admin panel and have to keep updated.
If you can code something like getting conversation rates from a live api and update that list then it will be superb. But still if you can manage updating rates manually , it can work like charm.

Woocommerce: Place order, but accept payment later?

Step 1: My WooCommerce shop is attached to a warehouse. I need customers to add products to cart, and then to place their order without making any payment or selecting any shipping.
Next, someone from my warehouse receives the order, and makes edits to the order, and then manually adds a shipping cost to the total invoice.
Step 2: The updated order is then sent back to the customer notifying them of the total cost of the order and then asks the customer to make payment via credit cart or bank transfer.
What I have done so far:
I have configured Step 1 to work correctly - using cheque as Gateway method. What I cannot do is Step 2, accept Payment via a different gateway,
Plugin: WooCommerce Purchase Order Gateway, but that doesn't allow for payment to be captured via WooCommerce later on
What's the best practice here?
I solved this by using WooCommerce Request a Quote plugin, and configuring it to replace the "Add to Cart" button.
Once the Quote list has been submitted, someone from my end confirms the order and uses the Order's Action menu to send Customer Invoice which provides a hyperlink back to the payment gateway: Paypal, Credit Card, Direct Deposit etc.
Looking for same feature, this plugin helped me. but it allow you to send your client invoice

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