VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Displaying featured products anywhere
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

34 Posts

Posted - May 09 2005 :  17:08:21  Show Profile  Reply with Quote
This code is simple and allows you to use the routine in shoprandomproducts.asp to display featured items anywhere on your site.

Example of how we used this code
We treat each catagory as a seperate store and each store has it own look and featured items. By using this code we can have random or set items display anywhere and with their own look.

First thing to do is make a copy of the file shoprandomproducts.asp and rename it to something meaningfull. In this example we named it shoprandomproductsFeatureItem.asp

Open your new file (shoprandomproductsFeatureItem.asp) and on line 2 replace:
Sub Displayrandomproducts
Sub DisplayrandomproductsFA(Search,CTemplate)
*note I changed the name of the function just in case you need to call this procedure from your home page so it wont mess up your normal featured products.

Now go to line 17
template= CTemplate

Go to line 37

Save and close the file.

To display your featured items You need to make sure the following files are included in your page.

<!--#include file="shop$db.asp"-->
<!--#include file="shoprandomproductsFeatureItem.asp"-->
<!--#include file="shopfileio.asp"-->

To display your product just paste the following code where you would like the items to apear.

<% DisplayrandomProductsFA "Specials","tmp_frontpageSpecials.htm" %>

The code above makes a call to the random product generator but passes along criteria that tells it only show products that have the word "Specials" in the frontpage field on the product table. It also passes along a template to display the product. If you want to call this procedure multiple times and display different products, simply change the name of the criteria you pass.

Example you may want to show christmass specials on one page and Halloween on another. To do that go into your products table and enter the word"Christmass" in the "Frontpage" field. Do the same for a halloween item but type "Halloween" in the frontpage field.

When you make your function calls they would look like this:
<% DisplayrandomProductsFA "Christmass","tmp_Christmass.htm" %>
<% DisplayrandomProductsFA "Halloween","tmp_Halloween.htm" %>

Note you dont have to use seperate templates, you can just pass the standard template Tmp_frontpage.

If you do want to generate random products sometimes, then pass the criteria "Random"

If you have any questions, you can email me at [email protected]

Edited by - Agravane on May 09 2005 17:50:51

VP-ASP New User

127 Posts

Posted - May 10 2005 :  07:01:37  Show Profile  Reply with Quote
Thanks for sharing. Can you give your website URL so we can see what it looks like in action?

Go to Top of Page

Starting Member

34 Posts

Posted - May 10 2005 :  09:12:26  Show Profile  Reply with Quote
Sure, the site is still under contruction but we do have one "store" set up with this feature.


Go to Top of Page

Starting Member

35 Posts

Posted - October 02 2009 :  16:05:13  Show Profile  Reply with Quote

I am trying this out and I am getting the following error.


Microsoft VBScript runtime error '800a000d'

Type mismatch: 'shopopendatabaseP'

/shoprandomproductsFeatureItem.asp, line 12

Any help would be greatly appreciated.

Thank you!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000