You have no items in your shopping cart.

Saturday, April 20, 2024 6:47:49 AM

Bugs

Posted: 6 years ago

#6861 Quote

michaelm@gogbs.com

Posted: 6 years ago

#6861 Quote
Thanks for checking and pointing out the issue.

It was a data issue.  There was a carriage return character on several records in the Name column in the the SpecificationAttributeOption table

Ran this script and it fixed the data issue:

UPDATE [dbo].[SpecificationAttributeOption]
   SET [Name] = RTRIM(LTRIM(replace(replace([Name],char(13),''),char(10),'')))

May be on future releases, to make the plugin resilient, may be it can clean the dropdown value first before rendering the dropdown.

Posted: 6 years ago

#6863 Quote

Support

Posted: 6 years ago

#6863 Quote
I'll think about it....

Posted: 6 years ago

#8096 Quote

michaelm@gogbs.com

Posted: 6 years ago

#8096 Quote
We tested the plugin against our Large Database (e.g. 100K categories)  there was a slight performance issue.  It took a few seconds to load.  It's b

The issue is the HTML build of the Category dropdown.  NOP takes time.  We've solve the issue on some of our own plugins.  We use a stored procedure to generate the hierarchy instead of using code.  

Sharing this SQL statement:

;WITH cteCategoryHierarchy AS
(
SELECT Id,
       HierarchicalPath = CAST(' >> '+ [Name] AS VARCHAR(4000)),
       [Name]      
        
   FROM dbo.Category  
       WHERE ParentCategoryId = 0 and Deleted = 0
  UNION ALL
SELECT c1.Id,
       HierarchicalPath = CAST(ch.HierarchicalPath + ' >> '+ c1.[Name] AS VARCHAR(4000)),
       c1.[Name]      
        
   FROM dbo.Category c1
  INNER JOIN cteCategoryHierarchy ch ON c1.ParentCategoryId = ch.Id
  WHERE  c1.Deleted = 0
)
SELECT
       RIGHT(HierarchicalPath, LEN(HierarchicalPath) - 4) as [Text],        
        Id as [Value]
                
   FROM cteCategoryHierarchy
  ORDER BY HierarchicalPath
  --for JSON PATH

It's actually very fast.  If you are using JSON for passing the data back as an object, just uncomment the the last line and the JSON data will be prebuilt by SQL.

Thanks for all the help.


Posted: 6 years ago

#8097 Quote

Support

Posted: 6 years ago

#8097 Quote
Thank you...
You are right.
I prefer the performance...  It's a good idea to add such feature in our plugins from the box...
I thought to do this category tree as static cache and using in all our plugins, but maybe it's better to add it in nopcommerce kernel. Many customers have such problems... Thank you.

Powered by nopCommerce

Copyright © 2023 FoxNetSoft. All rights reserved