I would like to show in the backend, when seeing the user detail if the checkboxes were selected when the user was created, here is the code that helped me to implement the extra checkboxes in the register form. Answer There is a mistake in your first function as each checkbox needs it own $key to be saved. H…
Tag: wordpress
WooCommerce: Hide other shipping methods except local pickup when free shipping is available
I do not want to hide Local Pickup when free shipping is available. Removing local pickup makes no sense, but I cannot figure out how to not remove it using the official code. This is my attempt in removing flat_rate1 since that is, for me, the paid option. Again, I want to keep FREE shipping and LOCAL pickup…
Check if customer has purchased something and add product to cart in WooCommerce
The code below auto add a product to cart in WooCommerce: The answer Checking if customer has already bought something in WooCommerce allows to check if user has already make a purchase or not with a custom conditional function has_bought(). So what I would like is to check if the customer has ordered before …
Set WooCommerce billing postcode from product custom input field for guests
I am trying to add an input field which allows the customer (guest) to enter their postcode on the product page before ‘add to cart’ which then sets/prepopulates the postcode in the basket & checkout without them having to enter their details or login/create an account. I’ve seen some re…
WordPress Same Custom CSS On Multiple Page
How can use the same custom css code on multiple pages in wordpress right now i am using this custom css on this page id 1367 in wordpress and i would like to use these same css on this page id 1699 too do i need to add like this or any other method is available in wordpress Answer Can
Redirect by user role from a specific admin url to another url
This code works fine if I use is_front_page as current page/url, because it gets my homepage and redirects user by role to a specific path, but it doesn’t work if I try to get a specific current url of wp admin dashboard, I tried with get_home_url(path), but it doesn’t work: Thank you in advance. …
How to fix “Uncaught Error: Call to a member function get_tax_class() on null” in WooCommerce?
I’ve an ecommerce app that’s was working fine some days ago. After I update the wordpress and woocommerce plugin, the app suddenly stopped working. I think that’s something about the plugin that I use (mstore app-mobile), but unfortunately is not possible to update this plugin. The error hap…
How to make a redirection to checkout on a custom add to cart button in WooCommerce
I’m using WooCommerce and added the following code to functions.php: What I would expect is that when a user adds a product to their basket: this code will redirect the user to the checkout page without actually adding the product to the basket. However, it still adds the product to the basket. What is …
WooCommerce: Add a birthdate billing field in checkout, My account, admin orders and WordPress user
I try to add a birthdate field in the Woocommerce Checkout form, then save it as a user meta. I can display it with the code below but i can’t save it in order to see it in the user profile page. Answer Here is the complete code that will display billing birthdate in checkout, in My account Addresses, I…
Updating WordPress account email with WooCommerce billing email after checkout
I need update WordPress account email with woocommerce billing email after successful checkouts. I used this code but it does not work : Am I used an outdated code? Answer There are some mistakes. Try the following instead: Code goes in functions.php file of the active child theme (or active theme). It should…