hook-woocommerce

Saving the value of a custom field phone number in WooCommerce My account > Account details

爱⌒轻易说出口 提交于 2019-12-09 13:53:21
问题 Trying to add a field for Woocommerce billing_phone to the my-account/edit-account/ . It is present within the update address pages but when adding to the form-edit-account.php it does not update. Currently adding by following the same code as the other fields, such as first_name : <input type="text" class="form-control woocommerce-Input woocommerce-Input--phone input-text" name="billing_phone" id="billing_phone" value="<?php echo esc_attr( $user->billing_phone ); ?>" /> Image of form with

woocommerce_thankyou hook not working

允我心安 提交于 2019-12-09 02:10:19
问题 When I paste the code below directly into the thankyou.php , it works perfectly fine. but when I try to hook it into woocommerce_thankyou , nothing happens. I'm just getting started with PHP, add_action('woocommerce_thankyou', 'test_1', 10, 1); function test_1() { $paymethod = $order->payment_method_title; $orderstat = $order->get_status(); if (($orderstat == 'completed') && ($paymethod == 'PayPal')) { echo "something"; } elseif (($orderstat == 'processing') && ($paymethod == 'PayPal')) {

Set a unique validation error notice in Woocommerce My Account Addresses and Account Details

≯℡__Kan透↙ 提交于 2019-12-08 13:15:28
Billing fields in Woocommerce checkout page and my account page shows individual error if the required fields are empty. Well, if all fields are empty, all errors for those empty fields will be shown like: - First name is a required field - Last name is a required field - Street address is a required field and so on… I want to display only one error if all the required fields are empty, like “ERROR: All fields are empty. Please fill in all required fields to place order.” Well I somehow solved this problem on checkout page with the code below: add_action( 'woocommerce_after_checkout_validation

Rename username label on woocommerce login page

好久不见. 提交于 2019-12-08 10:44:27
问题 i want to rename username label "Username or email' on woocommerce login page, is there any working hook to achieve this, function login_function() { add_filter( 'gettext', 'username_change', 20, 3 ); function username_change( $translated_text, $text, $domain ) { if ($text === 'Username') { $translated_text = 'customLoginName'; } return $translated_text; } } add_action( 'login_head', 'login_function' ); 回答1: There is not any hook for change Username Or email label change but yes you can put

Change “reply to” email address in all Woocommerce emails notifications

独自空忆成欢 提交于 2019-12-08 08:21:33
问题 In Woocommerce, I would like to change the email address that should always be used as the reply address for all emails notifications. How is this possible with Woocommerce? 回答1: The following will change the "Reply to" email address (and name) in all email notifications: add_filter( 'woocommerce_email_headers', 'change_reply_to_email_address', 10, 3 ); function change_reply_to_email_address( $header, $email_id, $order ) { // HERE below set the name and the email address $reply_to_name =

Create a Woocommerce product when post is created

亡梦爱人 提交于 2019-12-08 07:33:49
问题 I am using Woocommerce on my WordPress site. and I am Selling Various items on my site. What I want is that every time I create a small post about a particular item.it also creates a Woocommerce product page with the one item available to be sold. For example: I create a post about custom-made jewelry and I write a small post about it, and the customer can look at the post and buy it from the Woocommerce product section. Once the product is out of stock the post disappears"Hidden" until I

Remove breadcrumbs from WooCommerce Storefront theme

你说的曾经没有我的故事 提交于 2019-12-08 06:45:12
问题 In order to remove breadcrumbs from the Storefront theme, the documentation states to add the following in functions.php : remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 ); I tried this in a child theme of Storefront and it doesn't work. Tracing back the woocommerce_breadcrumb , it seems to be added in storefront_content_top action (in the file <storefront_dir>/inc/woocommerce/storefront-woocommerce-template-hooks.php . I commented out the corresponding line

Blur a background image via css

ぃ、小莉子 提交于 2019-12-08 06:40:54
问题 <div class=" testingclass wpd-page-title wpd-page-title_horiz_align_left wpd-page-title_vert_align_middle" style="background-color:#ffffff;height:80px;color:#222328;margin-bottom:15px;"> <div class="wpd-page-title__inner"> <div class="container"> <div class="wpd-page-title__content"> <div class="page_title"> <h1>Multilingual Digital Marketing</h1> </div> </div> </div> </div> </div> CSS for these are body.term-107 .wpd-page-title { background: url(https://khaleejdev.com/kds/newtornetto/wp-

Replace order status names everywhere incl. Woocommerce admin order preview

时间秒杀一切 提交于 2019-12-08 06:40:24
问题 I need to rename "On Hold" to "Pending Approval" and "Processing" to "Approved", in every instance. (Btw, I'm a diy shop owner, not a developer) This topic got me 60% there, Rename multiple order statuses in Woocommerce Now need to address these locations: admin > orders, the preview popup (eye symbol). front end > my-account/orders, the Status column. front end > my-account/view-order/x, the summary line. My code: add_filter( 'wc_order_statuses', 'rename_order_statuses', 20, 1 ); function

Remove woocommerce complete or processing email based on order meta

那年仲夏 提交于 2019-12-08 06:15:30
问题 I am trying to remove the processing (or complete) email based on some order meta. I'm using a POS system and getting customers to pay via the customer invoice email - the initial order status is pending payment. I want to a) test if the order was made using the pos, b) remove either the "processing" or "complete" email. I can't seem to get the if statement logic to work. I'm pretty sure the meta key is '_pos' and the value is '1' or '0'. Here's my myphp screem shot of wp_postmeta add_action(