Goal: I need to include an event snippet for specific tracking on the Woocommerce Order Confirmation page (the page immediately following a purchase). I must pass order_id, currency and total to the …
Tag: woocommerce
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. Answer To
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 and: If it’s their first order,
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 resources saying the shipping calculator on the basket page is complicated
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 happen on this updateCartQty function. My guess is that something about the function
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 wrong with this code? Background: I’m
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, In
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 work. Note: When changing user email, WordPress
WooCommerce: Add additional form field attributes to WC Vendors Pro
Apologies if I use some of the wrong terminology in my question. I am self-taught and still learning. The code below is part of a form template. I would like to add some additional attributes to the …
Issue with WooCommerce WC_Product set_category_ids() method in ACF “acf/save_post” hook
I have a problem assigning a product category to a Woocommerce product that I create with Php. (Environment is Wordpress 5.6.1, Woocommerce 5.0, Php 7.4.14, ACF Pro 5.9.5, Oxygen 3.6.1) All other attributes for the product gets saved while creating it, and I can see that the product object get updated with the category id prior to saving. However, when