Author |
Topic |
|
Jill
VP-CART Super User
USA
249 Posts |
Posted - June 03 2003 : 21:49:46
|
Does anyone have any idea what might be wrong here -- I want to randomly display only certain records. I marked about 40 of them with "show", but only the first 8 show and they never change.
Thanks for any ideas.
Jill
|
|
support
Administrator
4679 Posts |
Posted - June 03 2003 : 22:05:06
|
There is no logic to use random and something else. You would need to alter the SQL generator in file shoprandomproduct.asp
Set the frontpage field to Random Then
change this SQl to add additional criteria to limite which products display sqlstr="SELECT catalogid FROM products where hide=0"
for example sqlstr="SELECT catalogid FROM products where hide=0 and pother5='show'"
VP-ASP Support
|
|
|
Bosse
Starting Member
Sweden
25 Posts |
Posted - June 13 2003 : 03:05:49
|
Hi
Does this go only if you've got sql?
I have Access. When changing the line as below, I'll get a message: Microsoft VBScript runtime error '800a0009' Subscript out of range: 'i' /500shop/shoprandomproducts.asp, line 138
How do I do? /Bosse
quote:
There is no logic to use random and something else. You would need to alter the SQL generator in file shoprandomproduct.asp
Set the frontpage field to Random Then
change this SQl to add additional criteria to limite which products display sqlstr="SELECT catalogid FROM products where hide=0"
for example sqlstr="SELECT catalogid FROM products where hide=0 and pother5='show'"
VP-ASP Support
|
|
|
Jill
VP-CART Super User
USA
249 Posts |
Posted - June 13 2003 : 08:55:05
|
Bosse,
I don't know what your error message means, but I have Access, too.
Jill
|
|
|
Bosse
Starting Member
Sweden
25 Posts |
Posted - June 13 2003 : 17:30:27
|
Hi Jill,
Did you get it to work? (random with the 40 "show") If yes, how did you do it?
/Bosse
|
|
|
Jill
VP-CART Super User
USA
249 Posts |
Posted - June 14 2003 : 21:32:59
|
Bosse,
I did just like support said to do - I set the frontpage field to Random (in the admin), and then changed the line on shoprandomproduct.asp to say "SELECT catalogid FROM products where hide=0 and pother1=show"
Then in the products table, I marked the ones I wanted to show with the word "show" (in the pother1 field).
Hope that explains it!
Jill
|
|
|
jackbox
VP-CART New User
United Kingdom
72 Posts |
Posted - May 17 2005 : 04:33:14
|
I found I had no need for the 'mfg' field in products table so changed its caption in languages file to "Show On Homepage" and altered shoprandomproducts to:
sqlstr="SELECT catalogid FROM products where hide=0 and mfg=Yes"
I then downloaded database and in design view set the default value for 'mfg' to 'Yes' (updating all products in that field to 'Yes').
After that if you DON'T want a product to show on the home page you just delete the 'Yes' in the products table.
Same thing I guess but might work better for some. It was a case of finding a simpler clearer way for the merchant rather than having to remember what "Pother1" was for etc.
Mind you, you could always retitle Pother1 I suppose.
|
|
|
|
Topic |
|