Manufacturer part number in email

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 Jahre weitere
Hello, my question is (i think) very simple but i'm a newbe to nopCommerce.

Is it possible to add the Manufacturer part number (witch is entered when adding product to the store) in a email called OrderPlaced.StoreOwnerNotification (Message Templates).

Must i change some code for this?

Thanks in advance!, Bogdan.
14 Jahre weitere
Look at NopSolutions.NopCommerce.Common.Messages.MessageManagerfile.ReplaceMessageTemplateTokens() methods. You need to modify it and add new token support for this manufacturer part number. And then add this token to "OrderPlaced.StoreOwnerNotification" template
14 Jahre weitere
Oke thanks for the fast reaction. But i realy can't find

NopSolutions.NopCommerce.Common.Messages.MessageManagerfile.ReplaceMessageTemplateTokens()

Is this a file? of part of a file?
I searched the database a littlebit. Or must i configure with the web interface?

Bogdan
14 Jahre weitere
Hi Bogdan,

you will find the code file MessageManager.cs at the following folder location:

nopCommerce_1_20\Libraries\Nop.Common\Messages\MessageManager.cs

Inside MessageManager.cs there is a function called 'ReplaceMessageTemplateTokens':

        public static string ReplaceMessageTemplateTokens(Order order, string Template, int LanguageID)

Inside this function you will see the 'Tokens' NameValueCollection being initialised with the Token Name and Value pairs.  For example:

        tokens.Add("Order.BillingFirstName", HttpUtility.HtmlEncode(order.BillingFirstName));

adds the value of 'order.BillingFirstName' to the Token name 'Order.BillingFirstName'.

You will need to add a line in this function which takes the value of the 'Manufacturer Part Number' and associates it with a Token name -- for example: "Order.ManufacturerPartNumber".

Then use this Token name "Order.ManufacturerPartNumber" in your templates.

Regards

Walter
14 Jahre weitere
Ok! Thanks very much :D, i'll try it tomorrow becouse i'm not at work now.
14 Jahre weitere
Let me know how it goes.
14 Jahre weitere
Ok, I think I understand the concept here, but for the life of me, I can't find those directories that lead to that file.

I'm using godaddy hosting, and the hosting control center that they provide.  Am I looking in the wrong place?
14 Jahre weitere
Hi almeras.  Can you view any source files on GoDaddy?  You may just have the compiled binaries running on GoDaddy. Walter.
14 Jahre weitere
Wow. That was quick!

Yes, I can.  I can view the root directory.  But, there are no dirs or subs named libraries.

Note: I did not create and upload this to godaddy.  They have a tool that allows you to choose various free and paid apps to load onto your hosted account.

The dirs I see in the root are:

Administration*
App_Browsers
App_Data
App_Themes*
Bin
Boards
Controls
Editors*
Files*
Google
Images*
Install*
JS
KeepAlive
MasterPages
Modules
Properties
Templates*

(* have subs)
14 Jahre weitere
Hi almeras. It looks like they're running the compiled version.  This makes sense because the application will run faster when compiled.  Unfortunately, you won't be able to make changes to the source.  You would have to download the source code version from nopCommerce.  Open it in Visual Studio.  Make your changes.  Build the application.  Upload to your web space.  You would also need an instance of the database.  Regards.  Walter.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.