Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PriceVariantProduct issues (OCC-262) #461

Open
sarahelsaig opened this issue Jul 8, 2024 Discussed in #460 · 2 comments
Open

PriceVariantProduct issues (OCC-262) #461

sarahelsaig opened this issue Jul 8, 2024 Discussed in #460 · 2 comments
Labels
bug Something isn't working

Comments

@sarahelsaig
Copy link
Contributor

sarahelsaig commented Jul 8, 2024

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.

1

As you can see on the screenshots below, I set the predefined settings M, L, XL and a default value of the Size field.

2 3

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
4

Also, when I try to create a PriceVariantProduct, I receive the error message SKU must not empty even if I set SKU=CLOTHING.

5

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?

\n\nJira issue

@sarahelsaig sarahelsaig added the bug Something isn't working label Jul 8, 2024
@github-actions github-actions bot changed the title PriceVariantProduct issues PriceVariantProduct issues (OCC-262) Jul 8, 2024
@DotCat1985
Copy link

DotCat1985 commented Jul 16, 2024

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?

Screenshot 2024-07-16 at 20 04 05

@sarahelsaig
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants