Add CreateOnUtc to ProductBox and to Detail Product

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Hi ,
Is any way to add CreateOnUtc to ProductBox and to Detail Product ?
For NOPCOMMERCE 4.2.
3 years ago
You need to customize the source code for that.

Add
public DateTime CreatedOn { get; set; }
field
at both Nop.Web.Models.Catalog.ProductOverviewModel and Nop.Web.Models.Catalog.ProductDetailsModel

Then at Nop.Web.Factories.ProductModelFactory add this line at here

and here


Then display the date data at your corresponding view files. If you need help on this point too, please let me know.
3 years ago
Hi Mahbubur,

Thanks for your sharing solution.
I added it  to source code.
After this..

I added ... (@ Model.CreatedOn.ToString ("D")) to the ProductBox, but I'm getting the following error::

One or more compilation failures occurred:
c:\inetpub\weby\svetreklaxace\Themes\DeLuce\Views\Home\_ProductBoxListBig.cshtml(47,24): error CS1061: 'ProductOverviewModel' does not contain a definition for 'CreatedOn' and no extension method 'CreatedOn' accepting a first argument of type 'ProductOverviewModel' could be found (are you missing a using directive or an assembly reference?).

Can you help me with this presentation at View ?
3 years ago
I assume you rebuilt the project source code and there we no errors ?
3 years ago
petrjiricek wrote:
Hi Mahbubur,

Thanks for your sharing solution.
I added it  to source code.
After this..

I added ... (@ Model.CreatedOn.ToString ("D")) to the ProductBox, but I'm getting the following error::

One or more compilation failures occurred:
c:\inetpub\weby\svetreklaxace\Themes\DeLuce\Views\Home\_ProductBoxListBig.cshtml(47,24): error CS1061: 'ProductOverviewModel' does not contain a definition for 'CreatedOn' and no extension method 'CreatedOn' accepting a first argument of type 'ProductOverviewModel' could be found (are you missing a using directive or an assembly reference?).

Can you help me with this presentation at View ?


Hi, welcome.
I think you didn’t take updated nop dll files after build your project in visual studio, you only took  view files into your server/deployed application.
As here we do source code changes, you have to publish and deploy again.
3 years ago
Hi Guys, You are right.

I tried to re-create and publish, re-copy these files ....... AND IT WORKS !!!!!

Result you can check on : https://deluce.cz

Thank you for your help !
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.