ProductTemplateId is getting changed from 1 (GroupedProduct) to 3 (SimpleProduct)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
The site we are having the issue on was upgraded from a previous version of nopCommerce (3.6) to 4.2.  It functions well, except for one serious problem.

Whenever someone updates a grouped product in the admin, the value of ProductTemplateId is getting changed from 1 (GroupedProduct) to 3 (SimpleProduct) in the database.  Subsequently, the product in the store no longer shows the grouped items, since the SimpleProduct template is now in effect.

We're trying to track down this apparent bug to see if it's code related or data related.

We have years of experience with MVC apps -- but are fairly new to .NET Core.

Would appreciate some advice on how to track this down to the specific controller/service and lines of code where this is happening.
4 years ago
I dont imagine it is code related as you have not changed the code and this is not a known bug
But thats strange standard install has 1 as SimpleProduct and 3 as GroupedProduct

The view is nop42\Presentation\Nop.Web\Areas\Admin\Views\Product\_CreateOrUpdate.Info.cshtml
4 years ago
Very interesting.  I checked another older nop 3.60 site and it also has the following for the ProductTemplate table:

Id  Name  ViewPath  DisplayOrder
1  Grouped product  ProductTemplate.Grouped  100
3  Simple  product  ProductTemplate.Simple  10

But our newest nop 4.20 sites have this:

Id  Name  ViewPath  DisplayOrder  IgnoredProductTypes
1  Simple product  ProductTemplate.Simple  10  10
2  Grouped product (with variants)  ProductTemplate.Grouped  100  5

Did these tables change somewhere along the way -- between nop 3.60 and 4.20?
4 years ago
mwoffenden wrote:
Did these tables change somewhere along the way -- between nop 3.60 and 4.20?

Right back to 3.4 my tables have

Id  Name  
1  Simple product
2  Grouped product
4 years ago
Well thanks for your quick help on this.  I never would have thought to check those database values.

Somehow they got switched around in these older databases we have here.  

I ran sql updates to bring the ProductTemplate table up to date as well as the corresponding ProductTemplateId column in the product table.  Restarted the app and all looks great.

Apparently the code is "expecting" the values of 1 for simple and 2 for grouped.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.