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
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Customization
 Randomproducts showing out of homepage flow
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

carfin
VP-ASP Expert

United Kingdom
948 Posts

Posted - June 25 2007 :  04:42:12  Show Profile  Reply with Quote
Hi Alex,

Yes the products table has a timestamp of when a product is added, in a field called cdateadded. This can be used for checking a time limit for New Arrivals. I agree that there is the possibility that at some point there may be no products to display depending on the time limit set, but you should be able to work this out according to your business ie. what is the longest interval between new products arriving. This solution is not a particularly difficult one to implement - it just involves an added conditional check when random products are called. I am not an expert SQL programmer and I'm sure the wonderful support guys here would help me out if this isn't quite correct, but you could add the following lines to shopaddrandomproducts.asp

line 98 reads: dim wherestr, sortstr
add: ,BeginDate,EndDate

line 104 reads: sql="select * from products " & wherestr
change to:
BeginDate = DateAdd("D", -30, Date())
EndDate = Date()
sql = "SELECT * FROM products WHERE (cdateadded >= " & BeginDate & ") AND (cdateadded <= " & EndDate & ")" & wherestr

The -30 is the number of days between the date today and the date that the product was added to the database but it can be changed to whatever you need.

Regards,

Carrol


Go to Top of Page

Alex
VP-ASP New User

50 Posts

Posted - June 26 2007 :  06:31:27  Show Profile  Reply with Quote
Hi Carrol,

I'll give a shot and try it on today. Let me clarify one thing.
Does that code change the functionality of ADDRANDOM? You see I need random product pick from featured products in homepage and time based random pick for new arrivals.

Regards,

Alex
Go to Top of Page

carfin
VP-ASP Expert

United Kingdom
948 Posts

Posted - June 26 2007 :  06:39:08  Show Profile  Reply with Quote
Hi Alex,

the solution for the New Arrivals question earlier on was assumed that random products would be used on one page only and not on the home page. The code changes that I wrote for time limiting the random products will affect all pages where random products are displayed. Take a look at Simon's posting earlier in this thread if you're looking for custom product displays. Their site is pretty good.

Regards,

Carrol
Go to Top of Page

Alex
VP-ASP New User

50 Posts

Posted - June 26 2007 :  06:57:35  Show Profile  Reply with Quote
Carrol,

I have just implemented the code. Is there any way to test its operation? I have created content 'New Products' and asociated it with my template which has only [Add_randomproducts].

Now I have product listed on site in New products. That product I created day or two ago. Tried to put -1 to see if it disappears from listing. It did not. I'll try to create new ones today and leave -1 for test sake.

thanks

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