php shopping cart
free shopping cart   shopping cart software

Free Shopping Cart PHP Software


Back to Functions List
This Function Has Been Available Since:
(AFCommerce v 2.1,     Functions v 1.1)

Searches the database to automatically find the 2 most relevant products and display these 2 products as "short listings" directly next to the product's description.


afc_find_most_relevant_products (prodid)

This function searches the database to automatically find the 2 most relevant products and display these 2 products as "short listings" directly next to the product's description (by default, you may move this by editing getproduct.php). The afc_print_product_short_listing function is used to print these results. This function is referenced as the short listing function, so please take note of this shorter name.

This is, in my opinion, one of the coolest new features in version 2. It truly finds the 2 most relevant products by doing a true search and finding the 2 most relevant products, unlike other software that has a similar feature (very few have anything similar). Other software simply grabs other products from the same category, which as many of you know, does not necessarily mean those products are really relevant. One of the keys to having a great online store, is putting the products a customer will most likely purchase directly in front of them before they lose interest and leave your website.

This function has one weakness though. If you have a very large number of products, this can seriously slow down your product pages, since each and every time someone views a product, this function will search the entire database. You can easily turn this feature on or off from the admin area. At the moment, you can not change how many products are displayed, the number 2 is hard coded because I felt beginners might play around with it and mess up the look of their site. I will be upgrading the admin area and functions often, because these files are encrypted, and when an upgrade is available for the admin area or functions, all you will have to do is upload the files, and not worry about overwriting any custom work, or custom functions you create.


prodid (integer) - The product id number of the current product.

Return Values

This function has no return value, however it does print the 2 most relevant products (one per row), where ever this function is called. By default, this function is called right next to the product's description, and I strongly feel this is the best place for it to stay.

Open Source: No

Paul's Examples

There are currently no examples for this function.

Back to Functions List


There are currently no posts for this topic.

AFCommerce Documentation

High End Website DevelopmentCompletely Free
Dating Service
Copyright 2004 - 2006
AFCommerce Website
And Cart Builder