This little mod automatically suggests similar products to the page you're currently on based upon the search engine friendly url and using a FULLTEXT index search in both title and description.


Category: oscommerce

This solution is based on an MS2.2+ OsCommerce build, takes into account the use of the Ultimate SEO Urls and can be considered a work in progress - currently I have not set it up for plain urls. Please get in touch or comment if you wish this feature added!

The idea is to automatically suggest relevant or similar products based upon the product title/SEF url. It uses a MySQL FULLTEXT index on the product title and description to generate it's relevancy.

An example of the module in action can be seen here :- http://www.wellywarehouse.co.uk/hunter-digger-half-boot-p-1195.html

The following steps are required :-

Step 1. Run the following SQL commands
INSERT INTO `configuration`(`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ( NULL,'You may also be interested in','MAX_ALSO_INTERESTED_IN','3','Maximum number of products to display in the \\\'You may also be interested in\\\' box','3','16',NULL,'0000-00-00 00:00:00',NULL,NULL);
ALTER TABLE products_description ENGINE = MYISAM;
ALTER TABLE `products_description` add fulltext `products_name_fulltext` (`products_name`, `products_description`);
Step 2. Open product_info.php
Around line #430, find
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td>
<?php
if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_also_purchased(3600);
} else {
include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
?>
</td>
</tr>
add below
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td>
<?php
include(DIR_WS_MODULES . FILENAME_ALSO_INTERESTED_PRODUCTS);
?>
</td>
</tr>
Step 3. Open includes/filenames.php
Add at the bottom
define('FILENAME_ALSO_INTERESTED_PRODUCTS', 'also_interested_products.php');
Step 4. Open includes/languages/english/product_info.php
Add:-
define('TEXT_ALSO_INTERESTED_PRODUCTS', 'You may also be interested in these products');
Step 5. Copy includes/modules/also_purchased_products.php

File Attachments

download  Download: also_interested_products.php.txt

Comments

hi, thanks!

hi, thanks!

Don't Works

Don't Works for me it display an error does a miss any steps??

Hi Obed, What is the error

Hi Obed,

What is the error you're seeing?

Cheers,
Graeme.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.