Increase product excerpt default length in Single Product template and 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
This commit is contained in:
Karol Manijak 2024-05-31 08:19:06 +02:00 committed by GitHub
parent 5dd7713346
commit fe30778293
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 3 deletions

View File

@ -42,6 +42,7 @@ const getBlockifiedTemplate = () =>
} ),
createBlock( 'core/post-excerpt', {
__woocommerceNamespace: PRODUCT_SUMMARY_VARIATION_NAME,
excerptLength: 100,
} ),
createBlock( 'woocommerce/add-to-cart-form' ),
createBlock( 'woocommerce/product-meta' ),

View File

@ -65,6 +65,7 @@ export const DEFAULT_INNER_BLOCKS: InnerBlockTemplate[] = [
{
__woocommerceNamespace:
PRODUCT_SUMMARY_VARIATION_NAME,
excerptLength: 100,
},
],
[ 'woocommerce/add-to-cart-form' ],

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Product Summary: Increase the length of the description from 55 to 100 words (max supported by core/post-excerpt)

View File

@ -21,7 +21,7 @@
<!-- wp:woocommerce/product-price {"isDescendentOfSingleProductTemplate":true, "fontSize":"large"} /-->
<!-- wp:post-excerpt {"__woocommerceNamespace":"woocommerce/product-query/product-summary"} /-->
<!-- wp:post-excerpt {"__woocommerceNamespace":"woocommerce/product-query/product-summary", "excerptLength":100} /-->
<!-- wp:woocommerce/add-to-cart-form /-->

View File

@ -135,7 +135,7 @@ class SingleProductTemplateTests extends WP_UnitTestCase {
<!-- wp:woocommerce/product-price {"isDescendentOfSingleProductTemplate":true, "fontSize":"large"} /-->
<!-- wp:post-excerpt {"__woocommerceNamespace":"woocommerce/product-query/product-summary"} /-->
<!-- wp:post-excerpt {"__woocommerceNamespace":"woocommerce/product-query/product-summary", "excerptLength":100} /-->
<!-- wp:woocommerce/add-to-cart-form /-->
@ -204,7 +204,7 @@ class SingleProductTemplateTests extends WP_UnitTestCase {
<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:post-title {"level": 1, "__woocommerceNamespace":"woocommerce/product-query/product-title"} /-->
<!-- wp:post-excerpt {"__woocommerceNamespace":"woocommerce/product-query/product-summary"} /-->
<!-- wp:post-excerpt {"__woocommerceNamespace":"woocommerce/product-query/product-summary", "excerptLength":100} /-->
</div>
<!-- /wp:column -->
</div>