The Official Website of AgoraCart and Agora.cgi
AgoraCart.com Demos Download AgoraCart User Manuals & Wiki Gold Members Forum Go Gold Now! Gold Version Memberships

AgoraCart.com

About
Features
Download
Payment Gateways
Send a Donation
Founders Club
BLOG: News & Updates

Showcases & Demos

AgoraCart Demos
Shop Live Stores

Downloads & Add-ons

Gold Version Downloads
DBwizz Database Mgr.
AgoraCart.com Store

Help & Support

User Manuals
Gold Version Users Forum
Gold Version Chat
Tech Support
Certified Agora Pros
Certified Designers
Hire a Freelancer

Gold Version Members

Member Benefits
Join Today!
Gold Members Home
Gold Version Users Forum
Gold Version Chat Rooms
Gold Version Downloads

For Store Owners

Merchant Accounts
Cool Resources
Advertise Here
"Powered by" Logos
Web Hosting Search

Misc.

Contact Us
MEET's Talking Guide
The Ancient Greek Agora






AgoraCart Free User Forums

This is the official FAQ and Cool Tips guide For the AgoraCart shopping Cart software


Official Sponsors of the AgoraCart Project:

       


RegisterSearchFAQLog in
Reply to topic Page 1 of 1
what you'll find...
Author Message
Reply with quote
Post what you'll find... 
Hi,

I've increased the number of randomly picked products that appear on the front page to 8 and then decreased it to 6, that figure suits me. But there's a but. I have on occasions noticed that the set of random numbers includes twice the same number, resulting in a product being displayed twice. Now, I know that the subject of random numbers is complex but I am looking for some way to ensure that the numbers produced are unique. Granted, my database only contains 60 or so elements but the set of values is large enough; repetition should remain rare but it's not rare enough... hmmm But I'm talking about sets and this gives me an idea...

View user's profile Send private message Send e-mail Visit poster's website
Reply with quote
Post  
not sure what you're saying. the random numbers in the address bar (CART_ID) or the product ID numbers assigned by the manager?
d
url to store and some example links please

Reply with quote
Post  
No url since the site is not live yet.
I'm talking about the sample of products displayed on the home page. There's a script in html/index.html that reads the data file and randomly picks a number (I think 4 by default) of products and shows'em under the heading "What's in the store" or something similar; surely you know what I'm talking about. Well, I modified the script to show 6 random products but sometimes the sampling set contains twice the same product. So what I'm working on is a method of picking 6 unique numbers. I define a set of indices (from 0 to the number of products in the products array - 1) and randomly pick one, then I take away the index from this set and repeat the procedure until I get 6 unique indices to the database array (ie @line).

Henri

View user's profile Send private message Send e-mail Visit poster's website
Reply with quote
Post  
oh i get it now. yeah the random products can do that if there aren't many products in the dB.
glad you got it solved.
d

Reply with quote
Post  
Henri,
Did you get this solved? If so, can you please post the code and send what you did to Mister Ed for inclusion in future updates?
You can send it to him using the contact form at:
http://www.agoracart.com/contactus.html

Thanks!


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
I will.

View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum