Hide Downloads section under Toggle (#43864)
* Add Include downloads to show/hide the Downloads section * Fix margin top for none first child nested sections * Add changelog files * Fix php linter errors
This commit is contained in:
parent
dbae7d6661
commit
26a546954a
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: add
|
||||
|
||||
Fix margin top for none first child nested sections
|
|
@ -53,7 +53,9 @@
|
|||
}
|
||||
|
||||
.wp-block-woocommerce-product-section {
|
||||
margin-top: 0;
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
padding-bottom: 0;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
@ -74,9 +76,15 @@
|
|||
* Core removes the "loading" animation styles
|
||||
* from the button when it's disabled, so we
|
||||
* let's add them back.
|
||||
*/
|
||||
*/
|
||||
.components-button.is-tertiary.is-busy:disabled {
|
||||
background-image: linear-gradient( -45deg, #fafafa 33%, #e0e0e0 0, #e0e0e0 70%, #fafafa 0 );
|
||||
background-image: linear-gradient(
|
||||
-45deg,
|
||||
#fafafa 33%,
|
||||
#e0e0e0 0,
|
||||
#e0e0e0 70%,
|
||||
#fafafa 0
|
||||
);
|
||||
background-size: 100px 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: add
|
||||
|
||||
Add Include downloads to show/hide the Downloads section
|
|
@ -455,10 +455,37 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
);
|
||||
// Downloads section.
|
||||
if ( Features::is_enabled( 'product-virtual-downloadable' ) ) {
|
||||
$general_group->add_section(
|
||||
$product_downloads_section_group = $general_group->add_section(
|
||||
array(
|
||||
'id' => 'product-downloads-section-group',
|
||||
'order' => 50,
|
||||
'attributes' => array(
|
||||
'blockGap' => 'unit-40',
|
||||
),
|
||||
'hideConditions' => array(
|
||||
array(
|
||||
'expression' => 'editedProduct.type !== "simple"',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$product_downloads_section_group->add_block(
|
||||
array(
|
||||
'id' => 'product-downloadable',
|
||||
'blockName' => 'woocommerce/product-checkbox-field',
|
||||
'order' => 10,
|
||||
'attributes' => array(
|
||||
'property' => 'downloadable',
|
||||
'label' => __( 'Include downloads', 'woocommerce' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$product_downloads_section_group->add_section(
|
||||
array(
|
||||
'id' => 'product-downloads-section',
|
||||
'order' => 50,
|
||||
'order' => 20,
|
||||
'attributes' => array(
|
||||
'title' => __( 'Downloads', 'woocommerce' ),
|
||||
'description' => sprintf(
|
||||
|
@ -470,7 +497,7 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
),
|
||||
'hideConditions' => array(
|
||||
array(
|
||||
'expression' => 'editedProduct.type !== "simple"',
|
||||
'expression' => 'editedProduct.downloadable !== true',
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue