4 replies [Last post]
jimijamesi's picture
Offline
Joined: 08/19/2007
Juice: 75
Was this information Helpful?

Currently if you search for just the sku number you get empty search results

is there a way to add sku to my results
would the site need to be re-crawled via cron jobs
I did not have sku enabled in product page view display options

How ever I do have sku in my cleanURLs and in the SKU field obviously
thanks

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: incl. SKU field in search result

The search module indexes whatever is displayed on the node page. If you really don't want to show the SKU to your customers, you can enable the field, but then hide it with CSS. Search only deals with the themed $content before it's put into the node template.

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Re: Re: incl. SKU field in search result

Thank you for the clarification on this Lyle. I am going to do your solution on our site or now. One issue I can see is that I don't know how to pull SKUs from all possible attribute configurations...

Regards,
BigMike

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Re: Re: Re: incl. SKU field in search result

Hmmmmmm? The first thing that came to mind was to add this to my node-product.tpl.php:

<div style="display: none;"><?php print $node->model; // Include the SKU for searches, but hide it from view ?></div>

But then I realized this won't work because it needs to be pulled from the node's content, not the template.

So I looked at Product > Manage Fields (admin/content/node-type/product/fields) and also Product > Display Fields (admin/content/node-type/product/display), but I can't see anywhere to include the model/SKU field.

Could you please explain how to do this?

Thank you very much in advance,
Mike

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Kyle, Can you please explain

Kyle,

Can you please explain how to do this?

BigMike wrote:

So I looked at Product > Manage Fields (admin/content/node-type/product/fields) and also Product > Display Fields (admin/content/node-type/product/display), but I can't see anywhere to include the model/SKU field.

Could you please explain how to do this?