
Originally Posted by
willie bee
One thing I have noticed. If you do a search for a part (i.e. you have part number 3001, 43001, 3001-45, etc. and do a search for part number 3001) and it pulls up all these parts. You will see
"compare_default" under the tick box.
copy the defines from the supplied index.php file to your advanced search result.php file and upload it to your template folder.
note one thing i have noticed is that in the advanced search results screen, you cannot compare products. I have notified the author of this.
Copy the following define statements from index.php to advanced_search_result.php
Code:
// values for compare system
define('COMPARE_DEFAULT', 'Compare');
define('COMPARE_REMOVE', 'remove');
define('COMPARE_COUNT_START', 'up to ');
define('COMPARE_COUNT_END', ' items');
copy the following code from tpl_index_product_list.php to tpl_advanced_search_result_default.php
Code:
<div id="compareResult">
<div class="back compareText"><b><?php echo COMPARE_DEFAULT; ?></b><br /><?php echo COMPARE_COUNT_START . COMPARE_VALUE_COUNT . COMPARE_COUNT_END; ?></div>
<div id="compareProducts">
<?php
if (!empty($_SESSION['compare'])) {
foreach ($_SESSION['compare'] as $value) {
$product_comp_image = $db->Execute(
"SELECT p.products_id, p.master_categories_id, pd.products_name, p.products_image
FROM " . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd
ON pd.products_id=p.products_id
WHERE p.products_id='".$value."'");
$comp_images .= '<div class="compareAdded"><br /><a href="' . zen_href_link(zen_get_info_page($product_comp_image->fields['products_id']), 'cPath=' . (zen_get_generated_category_path_rev($product_comp_image->fields['master_categories_id'])) . '&products_id=' . $product_comp_image->fields['products_id']) . '">' . $product_comp_image->fields['products_name'] . '</a><div>'.'<a onclick="javascript: compareNew('.$product_comp_image->fields['products_id'].', \'remove\')" alt="remove">'.COMPARE_REMOVE.'</a>'.'</div></div>';
}
echo '<div id="compareMainWrapper"><div class="compareAdded compareButton">'.'<a href="index.php?main_page=compare" alt="compare">'.'<span class="cssButton">'.COMPARE_DEFAULT.'</span></a></div>'.$comp_images.'</div>';
echo '<br class="clearBoth" />';
}
?>
</div>
</div>
Now you will be able to add & compare products from the search result page.
Hope this helps!
Bookmarks