Add custom order meta to Order Completed email

paste the below code your active theme functions.php file add_filter( ‘woocommerce_email_order_meta_fields’,’custom_order_email_order_meta_data’, 10, 3 ); function custom_order_email_order_meta_data( $fields, $sent_to_admin, $order ) { $fields[‘wpcf-purchase-student’] = array( ‘label’ => __( ‘purchase amount’, ‘woocommerce’ ), ‘value’ => get_post_meta( $order->id, ‘wpcf-purchase-student’, true ) ); return $fields; }

wooCommerce checkout page State / County (optional) validate not working

Code goes in function.php file of your active child theme (or active theme). It could works. add_filter( ‘woocommerce_billing_fields’, ‘woo_filter_state_billing’, 10, 1 ); function woo_filter_state_billing( $address_fields ) { $address_fields[‘billing_state’][‘required’] = true; return $address_fields; } add_filter( ‘woocommerce_shipping_fields’, ‘woo_filter_state_shipping’, 10, 1 ); function woo_filter_state_shipping( $address_fields ) { $address_fields[‘shipping_state’][‘required’] = true; return $address_fields; }

Fatal error: Call to undefined method WooCommerce::nonce_field()

The Products section in wp-admin panel doesn’t depend on the theme. If you select default WordPress theme you’ll see the same issue. This is WordPress configuration. To fix the errors you need edit files via FTP, open the file wp-content/themes/your_theme/woocommerce/cart/shipping-calculator.php on line 67 and replace $woocommerce->nonce_field with wp_nonce_field and the file wp-content/themes/your_theme/woocommerce/checkout/form-checkout.php on line 3 … Read more

WooCommerce Country Drop Down colours CSS [closed]

It’s part of the “Select2” library, which is a jQuery replacement for select fields. You’ll find the stylesheet in /assets/css/select2.css in the WooCommerce plugin folder. The following are the property definitions you’ll find as the defaults for each of the items you mentioned. First, the selected value: .select2-container–default .select2-results__option[aria-selected=true],.select2-container–default .select2-results__option[data-selected=true] { background-color:#ddd } Second, the … Read more

Change Category Widget Dropdown List Select Name

Use the following code snippet, hope it’ll work for you. I’ve tested it on my dev machine and it works just fine. /** * Change product category dropdown placeholder text. * * Product category dropdown uses selectWoo/select2 * that’s why it’s not possible to change the placeholder text using * woocommerce_product_categories_widget_dropdown_args filter hook. * * … Read more