Updated Product attributes placeholder to e.g. length or weight (#51379)

* Updated Product attributes placeholder to e.g. length or weight

* Added Changelog

* Add changefile(s) from automation for the following project(s): woocommerce

* Delete changelog/51134-product-attribute-placeholder-update

* Add changefile(s) from automation for the following project(s): woocommerce

* Revise changelog.

* Add changefile(s) from automation for the following project(s): woocommerce

* Satisfy linter.

* Increase exactitude to reduce ambiguity levels.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
This commit is contained in:
Narendra Sishodiya 2024-09-18 04:29:22 +05:30 committed by Christopher Allford
parent b1fa7c2f85
commit cc8cf2366d
No known key found for this signature in database
GPG Key ID: 80E44C778F08A88E
4 changed files with 10 additions and 5 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Comment: Changed Product attributes placeholder to e.g. length or weight

View File

@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<strong><?php echo esc_html( wc_attribute_label( $attribute->get_name() ) ); ?></strong>
<input type="hidden" name="attribute_names[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" />
<?php else : ?>
<input type="text" class="attribute_name" name="attribute_names[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" placeholder="<?php esc_attr_e( 'f.e. size or color', 'woocommerce' ); ?>" />
<input type="text" class="attribute_name" name="attribute_names[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" placeholder="<?php esc_attr_e( 'e.g. length or weight', 'woocommerce' ); ?>" />
<?php endif; ?>
<input type="hidden" name="attribute_position[<?php echo esc_attr( $i ); ?>]" class="attribute_position" value="<?php echo esc_attr( $attribute->get_position() ); ?>" />
</td>

View File

@ -112,7 +112,7 @@ for ( const productType of Object.keys( productData ) ) {
.getByRole( 'link', { name: 'Attributes' } )
.click();
await page
.getByPlaceholder( 'f.e. size or color' )
.getByPlaceholder( 'e.g. length or weight' )
.fill( attributeName );
await page
.getByPlaceholder( 'Enter some descriptive text.' )
@ -183,7 +183,7 @@ for ( const productType of Object.keys( productData ) ) {
.getByPlaceholder( '0' )
.fill( productData[ productType ].shipping.weight );
await page
.getByPlaceholder( 'Length' )
.getByPlaceholder( 'Length', { exact: true } )
.fill( productData[ productType ].shipping.length );
await page
.getByPlaceholder( 'Width' )

View File

@ -39,8 +39,9 @@ test.describe( 'Add product attributes', { tag: '@gutenberg' }, () => {
} );
test( 'can add custom product attributes', async ( { page } ) => {
const textbox_attributeName =
page.getByPlaceholder( 'f.e. size or color' );
const textbox_attributeName = page.getByPlaceholder(
'e.g. length or weight'
);
const textbox_attributeValues = page.getByPlaceholder(
'Enter options for customers to choose from'
);