Add category name to order details

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hi

Can anyone tell me how I can add the category name to my product in the order details.
The reason I need this is because each category is a festival and the product is an item being hired at the festival. The product has a name and a SKU but these don't make it clear which festival the item is being hired at and we have 10 festivals and 5 products at each.

Any help would be much appreciated.

Thanks
John
10 years ago
Hello,
You will need to make some coding changes to add the category. Whether you are wanting to add it to the Order notification going to customer or to the Sales-order view in the admin module you will need to code to add the category.  You may be wondering why it's not there now within the order info.  It's because, as you know you can add products to multiple categories, so categories have nothing to do with product uniqueness.  Products and Categories are a Many to Many relationship. NopCommerce uses categories to allow you to choose where product pages are accessed and NOT to somehow concatenate category to a ProductId for uniqueness.  To do this without coding, make your products unique by festival.  Add a festival designator in front of the SKU, then you can give it a description also.  But you could make them all have the same ManufacturerPartNumber or GTIN or whatever so you can still group for reports if need be.
10 years ago
Hi Jeff

Thanks for your speedy reply. I assumed as much but clarification from someone that knows best is appreciated.

Following your update I realised that time was against me to perform the necessary code changes (quite a learning curve for me!), so instead I added a product attribute to each product called Festival and assigned it one preselect radio button value containing the relevant festival name. I'm happy to say this works well for my requirement, it appears in the Order Details page and also in the Email Order notification. It is a bit of a drag having to apply this attribute to every product but I'm more skilled with SQL than MVC so it will be an easy database update.

Thanks again for your help and maybe this post will help someone in the future.

Regards
John
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.