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

tracking number field in Woocommerce order [closed]

The syntax to get your custom field is: get_post_meta($post_id, $key, $single); In your context, you should try: $tracking_id = get_post_meta($order->get_order_number(), ‘Tracking_ID’, true); To show you in your example: <?php /* translators: %s: Site title */ $tracking_id = get_post_meta($order->get_order_number(), ‘Tracking_ID’, true); ?> <p><?php printf( esc_html__( ‘Your %s order is completed. Your tracking number is: %s’, ‘woocommerce’ … Read more

Show special field when correct shipping is chosen

You need to setup the change event on the field: $(‘select.shipping-field’).on(‘change’, function()) { $.post( ajaxurl, { action: ‘shipping_special’, data: ‘your data here..’ }, function(response){ // The response should contain your special field HTML } ); }); You can pass the current shipping select option Then your theme’s functions.php file needs to have the action to … 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

Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages

Let’s take a look at get_the_terms Codex page. We can find there that this function may return: (array|false|WP_Error) Array of WP_Term objects on success, false if there are no terms or the post does not exist, WP_Error on failure. So your code will work correct only in one case – when the function returns an … 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 );