Insights

Category: woocommerce

Paypal & Stripe Currency Converter for WordPress with WooCommerce & WPML

Do you want to show your WooCommerce store with a currency that’s not supported by Paypal and Stripe and also use them as payment gateways ? And show your default currency on all the website except on the user goes to the checkout page ? We will do that using the WPML & WooCommerce, here’s the plugins you will need to be installed to achieve that 1- Add the new currency that you want customers to pay with and also set the exchange rate with the default currency, don’t worry you don’t have to show it in the frontend for the users 2- We need to enable PayPal gateway in the website as it won’t be enabled because our default currency is not supported so add this snippet to solve this issue. Change ‘AED’ with your default currency code. 3- Now we will have to show the default currency in the whole website except the checkout page, and we can do that with this snippet Change ‘USD’ to your new currency Change ‘AED’ to your default currency Now the issue is solved and all visitors and customers can now pay with PayPal and Stripe in your non supported currency store.

Login with Phone number in Woocommerce WordPress

We will learn today how can we enable our customers to login with their phone number or any other custom field of our choice. 1- Add phone number field in the woocommerce registration form 2- Save the phone number field in the database when the user registers into the website 3- Now we need to edit the WordPress authentication process so we can tell it to login the user with his phone number or any custom field Make a function to search for users by phone number Then we check if the email and username doesn’t exist in the authentication process, that’s how we know the user might have written his phone number, so we search for him by his phone number and return the user. 4- Finally we need to edit the login label to tell the user that he can login with his phone number Full Gist of the code are here