Restored `output_search_promotion_block` and some of the CSS for `.addons-wcs-banner-block`.

This commit is contained in:
And Finally 2021-10-13 18:56:38 +01:00
parent 26affe1e8a
commit c66d6f6095
2 changed files with 61 additions and 0 deletions

View File

@ -255,6 +255,13 @@
width: 124px;
}
.addons-wcs-banner-block {
background: #fff;
border: 1px solid #ddd;
margin: 0 0 1em 0;
padding: 2em 2em 1em;
}
.addons-column {
flex: 1;
width: 50%;
@ -6596,6 +6603,29 @@ table.bar_chart {
.woocommerce_options_panel p.form-field {
padding: 5px 20px !important;
}
.addons-wcs-banner-block {
flex-direction: column;
}
.wc-addons-wrap {
.addons-wcs-banner-block {
padding: 40px;
}
.addons-wcs-banner-block-image {
padding: 1em;
text-align: center;
width: 100%;
padding: 2em 0;
margin: 0;
.addons-img {
margin: 0;
}
}
}
}
/**

View File

@ -469,6 +469,37 @@ class WC_Admin_Addons {
return $formatted_promotions;
}
/**
* Output the HTML for the promotion block.
*
* @param array $promotion Array of promotion block data.
* @return void
*/
public static function output_search_promotion_block( array $promotion ) {
?>
<div class="addons-wcs-banner-block">
<div class="addons-wcs-banner-block-image">
<img
class="addons-img"
src="<?php echo esc_url( $promotion['image'] ); ?>"
alt="<?php echo esc_attr( $promotion['image_alt'] ); ?>"
/>
</div>
<div class="addons-wcs-banner-block-content">
<h1><?php echo esc_html( $promotion['title'] ); ?></h1>
<p><?php echo esc_html( $promotion['description'] ); ?></p>
<?php
if ( ! empty( $promotion['actions'] ) ) {
foreach ( $promotion['actions'] as $action ) {
self::output_promotion_action( $action );
}
}
?>
</div>
</div>
<?php
}
/**
* Map data from different endpoints to a universal format
*