Author |
Topic |
|
Mark Priest
VP-CART Expert
United Kingdom
580 Posts |
Posted - March 30 2007 : 17:37:53
|
Hi All,
Ive always suggested to VPASP although as far as i know its never been implimented. A way of having new items show at the top of a category for x days, and / or an image or text diplayed with new items for x days so customers can see that the item is new.
Many other carts do this aswell as show the date the product was added.
Any ideas how to implient this?
Regards,
Mark Fireworks |
|
seeker1
VP-CART New User
Australia
114 Posts |
Posted - March 30 2007 : 17:49:05
|
There is actually an undocumented file called shopnewproducts.asp. It uses the cdateavaialble field to show all products updated in last 90 days with this type of logic.
If you put a hyperlink on your site to shopnewproducts.asp, you will get what you need or close to it.
Here is the logic in that file. It generates some sql and then goes to shopdisplayproducts.asp to execute and display the products.
<!-- #include file="shop$db.asp" --> <% newdate=date()-90 newdate=datedelimit(newdate) sql="select * from products where hide=0 and cdateavailable>=" & newdate setsess "sql", sql response.redirect "shopdisplayproducts.asp?search=yes" %>
Howard Kadetz Visit us at www.hkprog.com for a range of VP-ASP add-ons and customization services
|
|
|
Mark Priest
VP-CART Expert
United Kingdom
580 Posts |
Posted - March 30 2007 : 19:09:42
|
Hi howard.
Thanks for that, would there be any way in implimenting that into the current product display to show an image or something.
Regards,
Mark Fireworks |
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - March 30 2007 : 22:37:22
|
I couldn't find one, so when we last did this we used an extra-template-field, and the corresponding function was something like this: Sub BYZ_DISPLAY_IFNEW(arg_out_value,arg_in_cursor) Dim t_cdateadded Dim t_oldest_date Dim t_xtimeperiodtop Dim t_new_flag t_cdateadded=arg_in_cursor("cdateadded") if (t_cdateadded="" or IsNull(t_cdateadded)=true) then t_new_flag="N" else t_xtimeperiodtop=90 t_xtimeperiodtop=csng(t_xtimeperiodtop) t_oldest_date=Date()-t_xtimeperiodtop if (CDate(t_cdateadded)>CDate(t_oldest_date)) then t_new_flag="Y" else t_new_flag="N" end if end if if (t_new_flag="Y") then arg_out_value="New!" else arg_out_value="" end if End Sub
we then used our extra-template-fields addon (byz033) to call that function
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
Edited by - devshb on March 30 2007 22:41:30 |
|
|
Mark Priest
VP-CART Expert
United Kingdom
580 Posts |
Posted - March 30 2007 : 23:27:56
|
Hi Simon,
I have the addon, however, can you confirm for me what the difference is beween using this with your addon and adding the code to shop$db
I presume the results would be vsatly different?
Regards,
Mark Fireworks |
|
|
Mark Priest
VP-CART Expert
United Kingdom
580 Posts |
Posted - March 30 2007 : 23:32:39
|
I think i see the differences, your package contains all the database connection logic?
Am I right?
Regards,
Mark Fireworks |
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - March 31 2007 : 00:55:37
|
the function that I posted assumes that you've already got the product cursor open (which will be the case if you call it from a template-field via something like our byz033)
Howard's sample will give you a list of all the new products, whereas my sample will see whether the current product is new or not and will then return a corresponding bit of text/html.
So, you'd use howard's sample if you want to have a link which shows you all the new products. (ie you'd create an asp, say, called, "newproducts.asp" which has howard's sample code in it, and then you'd create a link to "newproducts.asp" somewhere on your panels so that users can click on it to see all the new products.
And/or you'd use my sample (called from a template-field via tmp_product.htm or tmp_productformat.htm) if you wanted to have something like "new!" shown for products that are new.
ie howard's sample will show new products, and my sample will highlight new products.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
Edited by - devshb on March 31 2007 00:57:29 |
|
|
|
Topic |
|