* Use product-sale-price ID for hooks. Closes #42907. * attempt to add a changelog
This commit is contained in:
parent
e1e1d3c593
commit
4d7bf10c96
|
@ -0,0 +1,3 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
Comment: Fix incorrect sale price hook name in product editor example documentaion
|
|
@ -63,7 +63,7 @@ function YOUR_PREFIX_remove_block( BlockInterface $sale_price_block ) {
|
|||
$sale_price_block->remove();
|
||||
}
|
||||
|
||||
add_action( 'woocommerce_block_template_area_product-form_after_remove_block_sale-price', 'YOUR_PREFIX_remove_block' );
|
||||
add_action( 'woocommerce_block_template_area_product-form_after_remove_block_product-sale-price', 'YOUR_PREFIX_remove_block' );
|
||||
```
|
||||
|
||||
### Conditionally hiding a block in product editor templates
|
||||
|
@ -76,7 +76,7 @@ function YOUR_PREFIX_hide_block( BlockInterface $sale_price_block ) {
|
|||
$sale_price_block->add_hide_condition( 'editedProduct.regular_price < 10' );
|
||||
}
|
||||
|
||||
add_action( 'woocommerce_block_template_area_product-form_after_add_block_sale-price', 'YOUR_PREFIX_hide_block' );
|
||||
add_action( 'woocommerce_block_template_area_product-form_after_add_block_product-sale-price', 'YOUR_PREFIX_hide_block' );
|
||||
```
|
||||
|
||||
### Conditionally disabling a block in product editor templates
|
||||
|
@ -89,7 +89,7 @@ function YOUR_PREFIX_hide_block( BlockInterface $sale_price_block ) {
|
|||
$sale_price_block->add_disable_condition( '!editedProduct.regular_price' );
|
||||
}
|
||||
|
||||
add_action( 'woocommerce_block_template_area_product-form_after_add_block_sale-price', 'YOUR_PREFIX_hide_block' );
|
||||
add_action( 'woocommerce_block_template_area_product-form_after_add_block_product-sale-price', 'YOUR_PREFIX_hide_block' );
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue