Page 1 of 1

"whats new" ConLib

Posted: Thu Dec 06, 2007 3:17 pm
by compunerdy
Could someone create a "Whats New" ConLib that could pull the last 4 or so items added to the database and display them in a sidebar vertical or the main page horizontal?

Posted: Mon Dec 10, 2007 7:52 am
by AbleMods
Not a bad idea. Want me to see if I can make one?

Posted: Mon Dec 10, 2007 9:27 am
by compunerdy
Please do. It would be like a featured items page but just pull the last 4 or so items that where added to the database.

Posted: Mon Dec 10, 2007 9:35 am
by AbleMods
<cracks> brace yourself....

Posted: Mon Dec 10, 2007 11:33 am
by AbleMods
Done. Tested. It rocks.

Shoot me a PM with your email and I'll send you the files.

The control has the same parameters as PopularProductsDialog, so you can specify the number of items, number of columns, vertical or horizontal orientation etc. it uses the product CreatedDate field value as the criteria for inclusion.

Someone smack me the next time I volunteer to write in C-Sharp ;)

Posted: Mon Dec 10, 2007 12:17 pm
by compunerdy
Thanks Joe!!

Posted: Tue Jan 08, 2008 2:28 pm
by AbleMods
I've got an updated version of the Whats New user control. It properly excludes any hidden, private or otherwise disabled products from the display.

I've also uploaded it to my site so anyone can download it. Feel free to buy some fishing and hunting times while you're there, I won't stop you :wink:

http://www.solunar.com/newestproductsdialog.zip

Posted: Tue Jan 08, 2008 3:05 pm
by compunerdy
Thanks Joe

Posted: Wed Feb 06, 2008 9:18 pm
by Road Rider
Joe:

I downloaded your zip file. Is there any info or could you help me with installation of these files?

Posted: Wed Feb 06, 2008 9:20 pm
by AbleMods
Just unzip the files into your ~\ConLib\Custom folder.

You reference it like any other user control. Edit a Sidebar or Content Scriptlet and add the [[ConLib:Custom\NewestProductsDialog]] line.

You can look at other scriptlets and see how user controls are referenced to get an idea of how it's done.

Posted: Wed Feb 06, 2008 9:33 pm
by Road Rider
Thank you. I will see what I come up with.

Posted: Wed Feb 06, 2008 10:10 pm
by Road Rider
Piece of cake Joe, again thank you.

How can I center the "Newest Products" text in the cell?

Posted: Thu Feb 07, 2008 5:13 am
by AbleMods
In the cell? You mean within the sidebar itself?

My layout skills are worse than my poker skills. I *think* you would have to modify the table in the layout scriptlet you are using so that the cell alignment is set to "centered".

I had to get another very kind forum member to help me change my page layouts so it would work correctly. I believe what we did though was change the style.css file so the body of the page always took up 100%. That automatically squeezed the sidebars into their minimum width. It worked perfectly, except for a few Able sidebars now squeeze too much and wrap badly.

Still haven't figured that one out - I so need to buy a book on this stuff :roll:

Posted: Tue Feb 12, 2008 8:01 pm
by Road Rider
Joe

Can I change how it determines "new". It seems like it considers a product new until you edit it?

Posted: Tue Feb 12, 2008 8:19 pm
by AbleMods
Shouldn't be - the query uses the CreatedDate, not the LastModifiedDate.

What did you change when you edited the product?

I just tested an edit to a product and it correctly updated only the modified date, not the created date.

Posted: Tue Feb 12, 2008 8:42 pm
by Road Rider
I disabled the purchase function. My "whats new" is completely empty and in the last 2 days I have added 50 +/- products. All of them have the purchase disabled mind you.

Posted: Tue Feb 12, 2008 9:06 pm
by AbleMods
The control is designed to exclude products that cannot be purchased. Enable some products and see what it does.

You do realize you can turn all products on or off from purchase with one switch in the store configuration screen? Enable Catalog Mode, bottom right of the screen.

I didn't really account for a store where all products are disabled from purchase when I made the control.

Re: "whats new" ConLib

Posted: Sat Oct 30, 2010 7:09 am
by AbleMods
stone76567 wrote:hi everyone..
thanks for sharing your opinion and suggestion in this site..
thanks a lot and have a nice day..
how to treat depression[/u]
lol

Re: "whats new" ConLib

Posted: Sat Oct 30, 2010 11:14 am
by compunerdy
When I need to fight depression I just grab my shotgun and IP trace some spammers :mrgreen: