I have following function to create new woocommerce product on the frontend. parse_str($_POST[‘form_data’], $form_data); $insertPost = array( //’ID’ => $post_id, ‘post_title’ => …
Tag: woocommerce
A non well formed numeric value encountered while using wc_price WooCommerce hook
I have a simple function that used to work that I got online somewhere a few years back. It allows me to manually change the currency conversion rate for EUR (€, Euro). Problem now is this: Whereof the notice refers to this line: This is what I need help fixing. This is the complete code: Answer Since WooComm…
WooCommerce: Add Custom order statuses with custom email notifications
Using Add a new order status that Send an email notification in WooCommerce 4+ answer code, I have been able to get an email notification for ONE custom status however cannot get my head around how I would go about being able to send the email notification for BOTH custom statuses. See below the example codes…
WooCommerce: Set country by default in checkout page for unlogged users
How to make the country default for regular (unregistered users). But if the buyer has a personal account and entered the country there, he would not be thrown into default in checkout? I have tried …
Show created and modified product date on WooCommerce pages
I’m looking for solution to display products current date on the shop page. I have tried with this, but it shows nothing at all Any help is appreciated. Answer The following code shows the date the product was created and modified on the single product page and archive/Shop page Note: the time/date disp…
Display a custom delivery notice on WooCommerce orders and email notifications
With the following code I display a custom message on WooCommerce checkout page. When a customer places an order on a Saturday and Sunday, the order will be delivered on the next Monday. If a customer …
Display vendor store-name (Dokan) on WooCommerce admin order preview
We add vendor information in the admin order details for each order via: WooCommerce show vendor store-name (Dokan) in admin order details overview Now I also want to add this information also in the order preview. I found this answer Display custom data on Woocommerce admin order preview We change the hook t…
Why does php strpos() sometimes does not work on Unicode character?
I’m building a system that categorizes woo-commerce products by their name, my product’s name is in Hebrew. I have to check in my code if a name of a product contains a Hebrew word. if I write something like: it will work properly but when I try to do it with a return from a function like here it …
Disable add to cart button via custom checkbox in WooCommerce product settings
We want to prevent add to cart for certain upcoming products. We want to have a checkbox to select the specific product on which we want to prevent add to cart. We have right now the checkbox and save code. I also found this: Remove add cart button in Woocommerce for a specific product category and https://wi…
Allows decimal float numbers in WooCommerce form field type number
I am making an input form in WooCommerce using a function called woocommerce_form_field() for an input type number field like below: Now I would like to be able to allow decimal float numbers to be inputed in this field. Is it possible? What should I do? Answer You need to use ‘custom_attributes’ …