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

Authenticate user into wordpress via 3rd party system, both with the same domain

I found a way to do it. I created a new folder under https://domain.tld/store/ and created 2 new files (/store/integra/wp-login.php and /store/integra/wp-auth.php). wp-login.php require_once(“wp-auth.php”); auth(); wp-auth.php startit(); function auth() { // decode query string $u = base64_decode($_GET[‘u’]); $p = base64_decode($_GET[‘p’]); $r = base64_decode($_GET[‘r’]); $username = htmlspecialchars($u); $password = htmlspecialchars($p); $user = get_user_by(‘login’, $username); if (!wp_check_password($password, … Read more

How do I hide out of stock products from homepage but not from catalog?

Assuming you are using storefront default homepage template. You can filter products before displaying on hompepage function rfl_show_backorders( $is_visible, $id ) { $product = new wC_Product( $id ); if ( ! $product->is_in_stock() && ! $product->backorders_allowed() && is_front_page() ) { $is_visible = false; } return $is_visible; } add_filter( ‘woocommerce_product_is_visible’, ‘rfl_show_backorders’, 10, 2 );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)