672 users online

Change font for some featured products on home page

Posted: 4 months ago Quote
Hi,

I'd like to change the font for featured products for which the "Available end date" in Product Variant Info is past the current date.

So, for e.g. if the Available end date for a product is Jan 20, 2012 and today's date is Jan 21, 2012, then show the title of the featured item in gray on the home page instead of the default blue color.

Thanks in advance for your help.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: 3 months ago Quote
How familiar are you with MVC ? Cause you'll need to do some Date Checking, and that isn't really ideal in the View. Which means you'll have to set a flag in the ViewModels and do a checking on the controller.

Or at least, that is how I'd go about it, perhaps someone can confirm.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
nopCommerce v2.xx themes >> http://www.ncthemes.com

Want better front end features for nopCommerce 2.xx ? Vote up this >> http://nopcommerce.codeplex.com/workitem/10622
Posted: 3 months ago Quote
Thanks for the response. Any pointers on what files I should look at? I'm using v2.3.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: 3 months ago Quote
Sure, the ViewModel sits in [ Nop.Web > Models > Catalog > ProductModel.cs ].

That is the ViewModel used in the Product Details Page (i.e. the page that you come to, if you clicked on a Product link on the homepage).

You might find the file easy to understand, or really confusing depending on your C# knowledge. But in a nut shell (in my method of doing it) you will need to add a new property, for example:

public bool IsBeyondDate { get; set; }

Then in your Catalog Controller, which sits in [ Nop.Web > Controllers > CatalogController.cs ] you will find the relevant ActionMethod [ ActionResult Product(int productId) ] and analyse that to see how it does its jobs (it calls other classes/services that do the hard bit) and from that how you can do the checking of the dates.

I hope that makes it clearer !! ;)
This post/answer is useful
-1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
nopCommerce v2.xx themes >> http://www.ncthemes.com

Want better front end features for nopCommerce 2.xx ? Vote up this >> http://nopcommerce.codeplex.com/workitem/10622
Posted: 3 months ago Quote
Thanks-- this helps.

Ciwan wrote:
Sure, the ViewModel sits in [ Nop.Web > Models > Catalog > ProductModel.cs ].

That is the ViewModel used in the Product Details Page (i.e. the page that you come to, if you clicked on a Product link on the homepage).

You might find the file easy to understand, or really confusing depending on your C# knowledge. But in a nut shell (in my method of doing it) you will need to add a new property, for example:

public bool IsBeyondDate { get; set; }

Then in your Catalog Controller, which sits in [ Nop.Web > Controllers > CatalogController.cs ] you will find the relevant ActionMethod [ ActionResult Product(int productId) ] and analyse that to see how it does its jobs (it calls other classes/services that do the hard bit) and from that how you can do the checking of the dates.

I hope that makes it clearer !! ;)
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)