Open sarahelsaig opened 3 months ago
Hi, During my debugging session of OrchardCore.Commerce solution, I discovered that, in row 84 of OrchardCore.Commerce.Drivers.PriceVariantsPartDisplayDriver.cs, attr.HtmlClassify().ToUpperInvariant() transforms the item XL into X-L. I don't know the use of HtmlClassify(), but this bug could be fixed by removing HtmlClassify(). What do you think about it?
I will look into this and double check later, but I think .HtmlClassify().ToUpperInvariant()
was intended to force the variant key to respect the format constraints of SKUs (all upper case, no spaces). This is because the variant keys are appended to the end of the SKU in the order summary (and you'd use that complex SKU in invoicing). Looks like .HtmlClassify()
was not a perfect fit fir this task because it splits the word along before capital letters so XL becomes X-L and LARGE becomes L-A-R-G-E. So ironically now it only works when the predefined values are lower case such as m, l, xl.
Discussed in https://github.com/OrchardCMS/OrchardCore.Commerce/discussions/460