-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Increase product excerpt default length in Single Product template and block #47651
Conversation
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Howdy @kmanijak,
I've gone through the testing instructions and have encountered some issues!
Scenario 1 - transform classic template into blockified
- No Short Description: Unfortunately, this truncates at 55 words still.
- Short Description: When the short description is present it truncates at 100 as expected.
Scenario 2 - default template
- The behavior of Scenario 2 is the same as Scenario 1.
Scenario 3 - Single Product block
- While the excerpt block shows
100
as the value the behavior is still the same as the other two scenarios.
Great catch @ObliviousHarmony! I did some digging and the truncation happens in WordPress itself:
The same happens on I'll contribute upstream to add As I wrote in the PR description, this is just short-term improvement and I'm focusing on providing an alternative solution to |
Made a contribution to Gutenberg fixing the problem: WordPress/gutenberg#61888 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into that and submitting an upstream fix @kmanijak 😄
Since we can't fix that edge case, let's go ahead with this!
…d block (#47651) * Increase the length of Product Summary block (core/post-excerpt variation) * Add changelog * Bring back the Product Summary variation to original length * Increase the Product Summary length to max 100 words in Single Product template and block * Increase the Product Summary length to max 100 words in Single Product block * Update tests * Change the attribute type froms tring to niumber as expected
Submission Review Guidelines:
Changes proposed in this Pull Request:
In #44260 we discuss Product Summary Block: character limit and rendering behavior of different scenarios. We highlight multiple issues, among others that product summary is truncated.
There's multiple requirements to be addressed (it will be taken in multiple steps):
The above requires multiple actions and more research that I'm working on. However, in the meantime the least we can do is increase the word limit in Product Summary (
core/post-excerpt
variation) to the maximum by default. I wanted to set the limit higher (I even used "Infinity" 😅 ), but unfortunately, there's a max set inedit
in Gutenberg here. So even if I put higher value (e.g. 10000), it's shows like this, which I think is very misleading especially that you cannot achieve the10000
any other way except for inserting a block:Hence, setting it to 100.
This PR covers three places where Product Summary is used:
The PR doesn't cover Product Summary in Products (Beta) and Product Collection blocks. I kept the default value of 55 there.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Prerequisites:
0. Edit some product and add some description longer than 100 words:
Example content
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus sed nibh blandit, sodales enim aliquet, ultricies ligula. Praesent enim lectus, gravida a sapien eget, venenatis tempor ligula. Etiam cursus, nisl id molestie rutrum, ex velit volutpat arcu, at blandit quam lectus ut urna. Sed at venenatis turpis, convallis laoreet ante. Nulla lobortis odio non est eleifend, eu vulputate arcu pharetra. Pellentesque porta ante non mauris rutrum consectetur. Quisque nulla neque, vestibulum sed consectetur eget, pellentesque quis felis. Nullam maximus felis neque, a efficitur velit venenatis vitae. Praesent elit sem, bibendum id malesuada sit amet, tristique non turpis. Vivamus varius venenatis sem auctor semper. Cras imperdiet risus diam, sit amet tincidunt dui dictum posuere.Duis ut tellus fermentum arcu efficitur posuere. Sed tincidunt, nulla a porttitor sagittis, felis felis condimentum felis, ut bibendum augue lacus eu orci. Vestibulum consequat condimentum viverra. Duis pharetra turpis vel varius malesuada. Quisque id velit id.
Scenario 1 - transform classic template into blockified
"excerptLength":100
Scenario 2 - default template
Scenario 3 - Single Product block
Changelog entry
Significance
Type
Message
Comment