Jump to content

Eddy's Content

There have been 29 items by Eddy (Search limited from 07-Jun 19)



Sort by                Order  

#50315 How can I make search only show products with all words

Posted by Eddy on 18 June 2009 - 09:05 PM in General Questions

You should be looking in YOUR_SKIN/customer/common_templates/search.tpl. At the top of the page add/change the following red parts:

<form action="{$index_script}" name="search_form" method="get">
<input type="hidden" name="subcats" value="Y" />
<input type="hidden" name="type" value="extended" />
<input type="hidden" name="status" value="A" />
<input type="hidden" name="pshort" value="[COLOR="Red"]N[/COLOR]" />
<input type="hidden" name="pfull" value="[COLOR="Red"]N[/COLOR]" />
<input type="hidden" name="pname" value="Y" />
<input type="hidden" name="pkeywords" value="Y" />
[COLOR="Red"]<input type="hidden" name="match" value="exact" />[/COLOR]
{hook name="search:additional_fields"}{/hook} 


Many thanks baballuci. Many thanks

I tried and it works well for me.

But when I turn the Setting: Search also in Pages and Site News, it behaves stranged
The result is not perfect.

Any idea?



#50310 moving to 2.0.4

Posted by Eddy on 18 June 2009 - 08:36 PM in Installation & Upgrade

I tried to export from v1.35sp4 to file and then import to cs 2.04
The name, description, meta... is ok but I cannot import the Images to cs2.04

Now my new shop (cs2.04) with full info but no product images

Does anyone have the experience or trick to do that?



#50204 How can I make search only show products with all words

Posted by Eddy on 17 June 2009 - 08:50 PM in General Questions

How to you do with Cs-cart 2.04?

I want to search exact in the Product name and the Search words only. I don't want it searches in short and full description.

Here are some adjust I made to search Exact in the Quick search and search by product code but it doesn't work well

---------------Original code----------------------
// Search string condition for SQL query
if (!empty($params['q'])) {

if ($params['match'] == 'any') {
$pieces = explode(' ', $params['q']);
$search_type = ' OR ';
} elseif ($params['match'] == 'all') {
$pieces = explode(' ', $params['q']);
$search_type = ' AND ';
} else {
$pieces = array($params['q']);
$search_type = '';
}

$_condition = array();
foreach ($pieces as $piece) {
$tmp = db_quote("(descr1.search_words LIKE ?l)", "%$piece%"); // check search words

if ($params['pname'] == 'Y') {
$tmp .= db_quote(" OR descr1.product LIKE ?l", "%$piece%");
}

-------------------Adjusted code--------------------------------------

// Search string condition for SQL query
if (!empty($params['q'])) {

if ($params['match'] == 'exact') {
$pieces = explode(' ', $params['q']);
$search_type = ' OR ';
} elseif ($params['match'] == 'all') {
$pieces = explode(' ', $params['q']);
$search_type = ' AND ';
} else {
$pieces = array($params['q']);
$search_type = '';
}

$_condition = array();
foreach ($pieces as $piece) {
$tmp = db_quote("(descr1.search_words LIKE ?l)", "%$piece%"); // check search words

if ($params['pname'] == 'Y') {
$tmp .= db_quote(" OR descr1.product LIKE ?l", "%$piece%");
}

if ($params['pname'] == 'Y') {
$tmp .= db_quote(" OR products.product_code LIKE ?s", "%$piece%");
}

Any one can help me?



#49664 Quick search - Exact words in Product name and Search words

Posted by Eddy on 08 June 2009 - 08:41 AM in Configuration

Hi All,

I'm configuring the new version of cs-cart 2.04 and I need the search in the quick search box

I want to find the "Exact" name of the item in "Product name" and "Search words" only.

Could anyone can help me?

In the advance, I don't find the feature search in front store "The feature of the product should be search able) as the version 1.35

Many thanks