KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: giacomokk on August 28, 2017, 04:45:28 pm

Title: How to search order by partial customerName
Post by: giacomokk on August 28, 2017, 04:45:28 pm
Hi, i'm triyng to search an order by "customer name" using the "AdminOrderSearch" class setting a value for the "customerName" property.

I see that it works only if i search with the complete customer name: firstname + lastname (e.g. "Mario Rossi"), and it does not work if i search for only a partial lastname (e.g. "Ross").

Printing the konakart mysql queries log i see that konakart executes a query with the equal "=" symbol (e.g. "select * from orders where customer_name = 'Ross' ") and not with "like" expression (e.g. "select * from orders where customer_name like '%Ross%' ").

How can i solve this issue?

Regards,

G

Title: Re: How to search order by partial customerName
Post by: julie on September 01, 2017, 03:59:27 pm
In the AdminOrderSearch object you can set the search rule:

public void setCustomerNameRule(int customerNameRule)

The rule for the search. Valid values are:
KKConstants.SEARCH_EXACT
KKConstants.SEARCH_ADD_WILDCARD_BEFORE
KKConstants.SEARCH_ADD_WILDCARD_AFTER
KKConstants.SEARCH_ADD_WILDCARD_BEFORE_AND_AFTER
KKConstants.SEARCH_USE_GLOBAL_CONFIG