hook-woocommerce

Display custom column with custom user meta on WooCommerce order admin list

≡放荡痞女 提交于 2020-07-07 12:20:20
问题 In a bit of a quandary here. I've been trying for a couple of days now to get my data, that I collected from a custom field in WooCommerce registration form to insert into user meta in database. The code for the form is: //Addition of morello Account Number to reg page add_action( 'woocommerce_register_form', 'add_register_form_field' ); function add_register_form_field(){ woocommerce_form_field( 'morello_account_number', array( 'type' => 'text', 'required' => true, // required field? 'label'

Show products from above 99$ price in Woocommerce using shortcode or php code

假装没事ソ 提交于 2020-07-04 04:21:05
问题 I am searching for a conditional shortcode based on product price. I have 2k+ products on Woocommerce now and I want to show products above 99$ price from a specific category and from whole products. How can I apply this conditions in the shortcode? Is there any way to do this? Actually, I want to apply in a widget, so shortcode form will work. Below is simple shortcode to show products but I want to apply this needed condition: [products limit="10" columns="4" category="hoodies, tshirts"]

Append text to product title on multiple pages in WooCommerce

穿精又带淫゛_ 提交于 2020-06-29 04:20:12
问题 I'm trying to append text to WooCommerce product title in the order meta - if products has a specific tag. I'm working from "Append text to product title if product has product-tag on cart in WooCommerce" "Display custom payment field in Woocommerce Admin, Orders and emails" This is what I have so fare: add_filter( 'woocommerce_get_order_item_totals', 'add_udstilling_below_cart_item_name', 10, 3 ); function add_udstilling_below_cart_item_name( $total_rows, $order, $tax_display ) {; $new_total

How to disable globally backorders in WooCommerce

China☆狼群 提交于 2020-06-27 03:06:48
问题 New products are being added daily to my website and it is unproductive to keep choosing the "Do not allow backorders" option for each new product and out of stock products. Currently with a growing database of over 2,000 products, I am finding it tedious to do the same process daily. Using the functions.php file, is there some php code I can implement to disallow backorders for all existing and future products? Any help is welcome and appreciated. 回答1: Simply use the following line of code

Show Order Notes with author and date in Woocommerce Admin Order List

眉间皱痕 提交于 2020-06-26 18:08:39
问题 Using "Display back Order Notes in Admin orders list on WooCommerce 3.3" answer code, I am able to add Order notes column in Admin orders list, but it only shows that status changed from One status to another. Now I would like also to show author of this change and date when it's happened, just, just like in order edit pages. Any suggestions? 回答1: It is not necessary to use global $post, $the_order; with manage_shop_order_posts_custom_column . This is because there is a 2nd parameter that

Replace “add to cart” with custom quantity input fields in Woocmmerce

依然范特西╮ 提交于 2020-06-24 10:14:27
问题 I am using WooCommerce with Storefront theme to build an eCommerce website that will be used on smartphones mostly. So I am trying to reduce the number of clicks and buttons to make it as simple as possible. I would like to replace "add to cart" button with a quantity selector : I found a way to add a quantity selector next to "add to cart" button (e.g. with plugin WooCommerce Advanced Product Quantities) but I would like to get rid of "add to cart" button. So, when a customer click on "+",

Replace “add to cart” with custom quantity input fields in Woocmmerce

末鹿安然 提交于 2020-06-24 10:12:49
问题 I am using WooCommerce with Storefront theme to build an eCommerce website that will be used on smartphones mostly. So I am trying to reduce the number of clicks and buttons to make it as simple as possible. I would like to replace "add to cart" button with a quantity selector : I found a way to add a quantity selector next to "add to cart" button (e.g. with plugin WooCommerce Advanced Product Quantities) but I would like to get rid of "add to cart" button. So, when a customer click on "+",

How to add related products or cross sells to order emails in WooCommerce

为君一笑 提交于 2020-06-18 12:55:10
问题 I can't seem to find a way of adding related products or cross sells to order emails in WooCommerce, and it's hurting my brain. I'm sure it must be possible but can't seem to get it working. I tried adding do_shortcode after order table, but that didn't work. 回答1: You can put this in your child theme's functions.php file: // product suggestion in order mail function order_mail_product_suggestion($atts) { $atts=shortcode_atts( array( 'id' => '', ), $atts, 'order_mail_product_suggestion');

Change woocommerce products menu title in Dashboard

 ̄綄美尐妖づ 提交于 2020-06-16 19:23:53
问题 We have tried to change the products page at the back end title menu but we couldn't using the snippet below in the screenshot: We need to change both the menu title " Products " to " New Title " & Sumbmenu "All Products " to " All Submenu " add_filter( 'gettext', 'custom_translate_woocommerce_strings', 999, 3 ); function custom_translate_woocommerce_strings( $translated, $text, $domain ) { $translated = str_ireplace( 'Product', 'New Title', $translated ); return $translated; } 回答1: The first

Minimum cart amount except for specific products in WooCommerce

你。 提交于 2020-06-16 03:51:12
问题 I only permit oders with a minimum value of 15€ on my site, but want to make an exception for one product. I would really appreciated if someone knows how to help me on this. The coding for the minimum order value is below. Anyone know how I can adapt this to exclude one product via a product ID? add_action( 'woocommerce_check_cart_items', 'wc_set_min_total' ); function wc_set_min_total() { if( is_cart() || is_checkout() ) { global $woocommerce; // Setting the minimum cart total $minimum_cart