You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by DotCat1985 July 8, 2024
Hi,
I installed Orchard Core Commerce and so I launched Orchard Core Commerce - Content - Product recipe for trying the PriceVariantProduct type.
As you can see on the screenshots below, I set the predefined settings M, L, XL and a default value of the Size field.
But, when I open the page for creating a PriceVariantProduct:
a Price variant is written as X-L Price instead of XL Price
a Inventory variant is written as L Inventory instead of XL Inventory
Also, when I try to create a PriceVariantProduct, I receive the error message SKU must not empty even if I set SKU=CLOTHING.
I get the same result setting Medium, Large, Extra Large and a default value of the Size field.
I have no problem setting S, M, L and a default value of the Size field.
How can I solve this issue?
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 #460
Originally posted by DotCat1985 July 8, 2024
Hi,
I installed Orchard Core Commerce and so I launched Orchard Core Commerce - Content - Product recipe for trying the PriceVariantProduct type.
As you can see on the screenshots below, I set the predefined settings M, L, XL and a default value of the Size field.
But, when I open the page for creating a PriceVariantProduct:
Also, when I try to create a PriceVariantProduct, I receive the error message SKU must not empty even if I set SKU=CLOTHING.
I get the same result setting Medium, Large, Extra Large and a default value of the Size field.
I have no problem setting S, M, L and a default value of the Size field.
How can I solve this issue?
The text was updated successfully, but these errors were encountered: