Add stars and reviews number

This commit is contained in:
Timur Gogolev 2021-09-29 16:23:04 +03:00 committed by And Finally
parent 5c81b4f5ea
commit 916a13b6c6
3 changed files with 63 additions and 6 deletions

View File

@ -421,7 +421,11 @@
}
.product-footer {
align-items: center;
border-top: 1px solid #dcdcde;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 24px;
.price {
@ -429,11 +433,39 @@
color: #1d2327;
}
.price-suffix {
color: #646970; /* Gray 50 */
}
.product-reviews-block {
display: flex;
flex-direction: row;
margin-top: 4px;
.product-rating-star {
background: url(../images/icons/star.svg) no-repeat;
background-size: contain;
height: 16px;
margin: 4px 4px 4px 0;
width: 17px;
}
.product-reviews-count {
color: #646970; /* Gray 50 */
font-size: 12px;
font-family: sans-serif;
line-height: 24px;
letter-spacing: -0.154px;
margin-left: 4px;
}
}
.button {
background-color: #fff;
border-color: #007cba;
color: #007cba;
float: right;
height: 22px;
}
}
}

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="16.27"
height="15.39"
viewBox="0 0 16.270002 15.39"
fill="none"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
>
<path
d="m 8.1376662,11.759108 5.0199998,3.6 -1.9214,-5.8133003 5.02,-3.52 h -6.1566 L 8.1376662,0.02580769 6.1757662,6.0258077 H 0.01919622 l 5.01994998,3.52 -1.92139,5.8133003 z"
fill="#f0c930" />
</svg>

After

Width:  |  Height:  |  Size: 424 B

View File

@ -125,12 +125,24 @@ $current_section_name = __( 'Browse Categories', 'woocommerce' );
<p><?php echo wp_kses_post( $addon->excerpt ); ?></p>
</div>
<div class="product-footer">
<?php if ( '&#36;0.00' === $addon->price ) : ?>
<span class="price"><?php esc_html_e( 'Free', 'woocommerce' ); ?></span>
<?php else : ?>
<span class="price"><?php echo wp_kses_post( $addon->price ); ?></span>
<span class="price_suffix"><?php esc_html_e( 'per year', 'woocommerce' ); ?></span>
<?php endif; ?>
<div class="product-price-and-reviews-container">
<div class="product-price-block">
<?php if ( '&#36;0.00' === $addon->price ) : ?>
<span class="price"><?php esc_html_e( 'Free', 'woocommerce' ); ?></span>
<?php else : ?>
<span class="price"><?php echo wp_kses_post( $addon->price ); ?></span>
<span class="price-suffix"><?php esc_html_e( 'per year', 'woocommerce' ); ?></span>
<?php endif; ?>
</div>
<?php if ( null !== $addon->reviews_count ) : ?>
<div class="product-reviews-block">
<?php for ( $i = 1; $i <= 5; ++$i ) : ?>
<div class="product-rating-star"></div>
<?php endfor; ?>
<span class="product-reviews-count">(<?php echo wp_kses_post( $addon->reviews_count ); ?>)</span>
</div>
<?php endif; ?>
</div>
<a class="button" href="<?php echo esc_url( WC_Admin_Addons::add_in_app_purchase_url_params( $addon->link ) ); ?>">
<?php esc_html_e( 'View details', 'woocommerce' ); ?>
</a>