Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 how can i make this work in v7
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jayceew
VP-CART New User

USA
114 Posts

Posted - October 04 2012 :  15:57:27  Show Profile  Reply with Quote
how can i make this work in v7?

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
With:
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
replace:
template="tmp_frontpage.htm"
with:
template= CTemplate

Go to line 37
Replace:
selectvalue=getconfig("xfrontpagevalue")
With:
selectvalue=Search

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"

Thanks
Jack

diegomilito
VP-CART Expert

Argentina
779 Posts

Posted - October 27 2012 :  03:31:07  Show Profile  Reply with Quote
jack, what is the page url of your built one ?
Diego.
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - October 27 2012 :  04:02:44  Show Profile  Visit devshb's Homepage  Reply with Quote
take a look at the reply posted here, it might help:
http://vpasp.com/virtprog/vpaspforum/topic.asp?TOPIC_ID=15075

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
www.BigYellowKey.com
Follow us on Twitter: http://twitter.com/bigyellowzone
Web Design, Online Marketing and VPASP addons
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00