Slow query while searching a product woocommerce

I was struggling with this issue since long with my wordpress with wooocommerce website. Whenever i was doing a search in admin dashboard for wooommerce products it was taking long time and end up with no results.

SELECT DISTINCT posts.ID as product_id, posts.post_parent as parent_id
    FROM wp_posts posts 
         LEFT JOIN wp_postmeta postmeta ON posts.ID = postmeta.post_id 
    WHERE ( posts.post_title LIKE '%Samsung%' 
            OR posts.post_excerpt LIKE '%Samsung%' 
            OR posts.post_content LIKE '%Samsung%' 
            OR ( postmeta.meta_key = '_sku'
                 AND postmeta.meta_value LIKE '%Samsung%' ) ) 
          AND posts.post_type IN ('product','product_variation') 
    ORDER BY posts.post_parent ASC, posts.post_title ASC

After months of troubleshooting i am still not able to fully resolve the issue, however with this workaround i am finally somewhat relived.

To resolve this issue…

Edit this file – public_html/wp-content/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php

In Woocommerce version 3.4.6 look for search_products function

On line no. 1397 look for

$term_group_query .= $wpdb->prepare( ” {$searchand} ( ( posts.post_title LIKE %s) OR ( posts.post_excerpt LIKE %s) OR ( posts.post_content LIKE %s ) OR ( postmeta.meta_key = ‘_sku’ AND postmeta.meta_value LIKE %s ) )”, $like, $like, $like, $like ); // @codingStandardsIgnoreLine.

Remove following code

OR ( postmeta.meta_key = ‘_sku’ AND postmeta.meta_value LIKE %s )

It should then look like this…

$term_group_query .= $wpdb->prepare( ” {$searchand} ( ( posts.post_title LIKE %s) OR ( posts.post_excerpt LIKE %s) OR ( posts.post_content LIKE %s ) )”, $like, $like, $like, $like ); // @codingStandardsIgnoreLine.

Save the file and you should be able to search for products now. The downside with this is you’ll not be able to search SKU’s. But i was ok with this as dont have SKU’s added to my products.

I hope this will help you.

How to unlink your Aadhaar UIDAI Card?

UIDAI Aadhaar

The Supreme Court on Wednesday declared government’s Aadhaar scheme as Constitutionally valid and also struck down Section 57 of Aadhaar Act permitting private entities to avail Aadhaar data. “Robust data protection regime has to be brought in place as early as possible,” Justice Sikri said while reading out the majority judgement.

The court said that the Aadhaar authentication data cannot be stored for more than six months.

WHAT NEEDS AADHAAR LINKING:
1) It is mandatory to link PAN card with Aadhaar
2) Aadhaar is a must for filing income tax returns
3) Aadhaar is necessary for availing welfare schemes and subsidies given by the government

Not Required
Aadhaar not mandatory for opening of bank account
No mobile company can demand “Aadhaar card”
Aadhaar need not be made compulsory for school admissions
CBSE, NEET, UGC cannot make Aadhaar mandatory
Telecom service providers can’t seek linking of Aadhaar
Not mandatory to link Aadhaar to bank accounts

As of today telecom operators, banks, schools etc have not provided any facility for customers to unlink their aadhaar card. Hopefully this situation will change soon.

MI Wi-Fi Router Error no new or unpaired mi wi-fi was detected

 

 

mi wi fi router error

New update of Mi Wi-Fi app failed to pair with the MI router. you can go thru following steps to resolve the issue. i hope MI resolves the issue with their app soon

  • Uninstall any existing version of Mi Wi-Fi app
  • Download and Install the Mi Wi-Fi app old version 4.0.0 from this Link
  • Sign-in with your existing account or setup a new rotuer
  • and that’s done, you should be able to pair your router with the app.

How to Send Receive SMS / Messages on a PC

Download Android Messages for your phone. You’ll have to go through a  install process to set that up once you have it installed, essentially giving the app access to your contacts and permission to handle texts.

Once done, go to https://messages.android.com and follow the instruction on the screen for pairing your browser with your phone (it essentially just involved scanning a QR code).

Android Messages is available free of charge from Google’s Play Store. You can also opt to make the program your standard app for handling regular text and RCS messages: Go to “Settings” of the app, then “Default messaging app” and select “Messages” from the menu. The app will then adopt all the required settings and can also import existing SMS messages.

How to turn off Facebook recording call and SMS details

Now, that Facebook has explained how it collects this data with Messenger and Facebook Lite, it also tells people what they can do if they don’t want this data collected.

The first thing to avoid giving Facebook your call and SMS details is to deny the Facebook apps access to your contacts when you are installing these apps. The second way is to turn off the permission from Facebook settings. To do this:

On Facebook Messenger: Go to settings > People > Turn off Contact Sync. To delete previously uploaded contacts, go to this page, log into your account and delete contacts.

On Facebook Lite: Go to Settings > Turn off Continuous Contacts Upload. Also turn off Sync Your Call and Text History.