Commit 30a027bd authored by Mike O\'Connor's avatar Mike O\'Connor

Initial commit of the apachesolr_ubercart integration module. Currently it...

Initial commit of the apachesolr_ubercart integration module.  Currently it simply adds a sku and price field to solr
parents
; $Id$
name = ApacheSolr Ubercart integration
description = Integrates the ApacheSolr and Ubercart
dependencies = uc_cart apachesolr
package = ApacheSolr
<?php
//$Id$
/**
* function apachesolr_ubercart_apachesolr_update_index
* An implementation of hook_apachesolr_update_index
* Adds ubercart specific fields to the solr index
*/
function apachesolr_ubercart_apachesolr_update_index(&$document, $node) {
if (in_array($node->type, module_invoke_all('product_types'))) {
if(!empty($node->model)) {
$document->ssfield_ubercart_sku = $node->model;
}
if (!empty($node->list_price)) {
$document->ssfield_ubercart_list_price = $node->list_price;
}
if (!empty($node->sell_price)) {
$document->ssfield_ubercart_sell_price = $node->sell_price;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment