Accounting > Sales > Payment > Customer Search is ignoring the search term
-
Hello,
Accounting > Sales > Payment > Customer Search is ignoring the search term.
Steps to reproduce:
1. Login to /wp-admin
2. Click Accounting > Customers
3. Create two Customers
4. Click Accounting > Sales
5. Click the Payment button at the top
6. Click the Customer Search box
7. No matter the search term you put in, it always list all CustomersI have a test site for you https://wperp.cloud77.com. If you want to use it, please let me know your email address.
Workaround:
Add this code to /erp/includes/functions-people.php, right after
$sql['where'] = [''];
if( !empty( $s ) ) { $search_term = '%' . $wpdb->esc_like( $s ) . '%'; $sql['where'][] = $wpdb->prepare( "AND ( " . "LOWER( people.first_name ) LIKE %s OR " . "LOWER( people.last_name ) LIKE %s OR " . "LOWER( people.company ) LIKE %s OR " . "LOWER( people.email ) LIKE %s OR " . "LOWER( people.phone ) LIKE %s OR " . "LOWER( people.mobile ) LIKE %s OR " . "LOWER( people.other ) LIKE %s OR " . "LOWER( people.website ) LIKE %s OR " . "LOWER( people.fax ) LIKE %s OR " . "LOWER( people.notes ) LIKE %s OR " . "LOWER( people.street_1 ) LIKE %s OR " . "LOWER( people.street_2 ) LIKE %s OR " . "LOWER( people.city ) LIKE %s OR " . "LOWER( people.state ) LIKE %s OR " . "LOWER( people.postal_code ) LIKE %s OR " . "LOWER( people.country ) LIKE %s" . ")", array( $search_term, $search_term, $search_term, $search_term, $search_term, $search_term, $search_term, $search_term, $search_term, $search_term, $search_term, $search_term, $search_term, $search_term, $search_term, $search_term ) ); }
Thanks,
- This topic was modified 7 years, 5 months ago by .
- This topic was modified 7 years, 5 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘Accounting > Sales > Payment > Customer Search is ignoring the search term’ is closed to new replies.