I have two flat rates on my WooCommerce site and I want to disable one of them, when free shipping is enabled. I have a function which is working for all flat rates only. How do I check for an instance id on a shipping rate? Can anyone help me understand how to check for the instance id? I Was
Tag: woocommerce
WooCommerce – Can’t add a inside the return
I’m using the following code to change the add to cart button text in WooCommerce. add_filter( ‘woocommerce_product_add_to_cart_text’, ‘custom_add_to_cart_price’, 20, 2 ); // Shop and other archives …
Display orders items names excluding a product category in WooCommerce
With WooCommerce, I have faced a problem on my code below: I have tried skip specific category from my loop. Product has been skipped but some remaining products are showing multiple times: How can I avoid this item name repetition on this loop? Answer The variable $product_cat_id is not defined in your code, so your if statement is always true.
WooCommerce product custom additional taxonomy in a loop issue
I am trying to display custom taxonomy field’s names and descriptions for single products in a loop. I’ve created custom product taxonomy next created sample tags: One, Two and assigned them to the Product (via ACF plugin) I want them to be displayed on product page. I was trying to use this code: but there is an issue I cannot
Woocommerce Additional Information Tab: Adding product custom field value
I have the following code working to create the Additional information tab in woocommerce with my own values however I want to pull the information from the built-in product custom field. This is the current code I use to output the custom field, how do I output this in Value 1 in functions.php file in the working code above? Answer
Change WooCommerce thankyou page title based on order status
Attempting to change the title of the thank you page based on specific order statuses, by combining a filter and action as follows: but I have tried multiple ways to combine the two and without any success. Answer You can use the following to change “Order received” page title based on order statuses: Code goes in functions.php file of the
Add the ean code (gtin) in the structured data of the product (Schema.org) in WooCommerce
I am using this snippet to display ean value for gtin in Woocommerce’s product schema: This works but I need to set “identifier_exists” markup to products that don’t have the custom field ean set. How can I modify my snippet to show the ean value in the markup if it exists, and add the identifier_exists attribute = false to products
How to check the value of a WooCommerce filter hook parameter?
In WooCommerce you have many hooks & filters. How can I check what is inside of a filter parameter? For example, I want to unset some shipping rates based on certain conditions. How can I check what is inside my $rates or $package parameter? Answer You can first enable Wordpress debug log by editing your wp-config.php file adding the following
Issue when adding product description at WooCommerce checkout
I’m trying to display the product description at WooCommerce checkout. I’m using: It takes the product short description and displays it below the product. It almost works perfectly, but it displays a colon (:) at the end of the description and the colon remains even if there is no short description. Result: I can’t figure out why it appears any
Add extra checkboxes in Woocommerce user register form and saving / showing if are checked in the backend as user extra data
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. Here is