| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Template for advanced reviews load more button. |
| 5 |
* |
| 6 |
* $args module settings. |
| 7 |
* |
| 8 |
* @since 1.0 |
| 9 |
*/ |
| 10 |
|
| 11 |
global $product; |
| 12 |
|
| 13 |
$total_pages = count( get_comments( array( |
| 14 |
'post_id' => $product->get_id(), |
| 15 |
'fields' => 'ids', |
| 16 |
'status' => 'approve', |
| 17 |
) ) ); |
| 18 |
|
| 19 |
$total_pages = ceil( $total_pages / get_option( 'comments_per_page' ) ); |
| 20 |
|
| 21 |
$single_product_reviews_advanced_pagination_type = get_theme_mod( 'single_product_reviews_advanced_pagination_type', 'default' ); |
| 22 |
|
| 23 |
if ( $total_pages <= 1 ) { |
| 24 |
return; |
| 25 |
} |
| 26 |
?> |
| 27 |
<div class="merchant-pagination-wrapper"> |
| 28 |
<a href="javascript:void(0);" class="merchant-pagination-button<?php echo ( 'infinite-scroll' === $single_product_reviews_advanced_pagination_type ) ? ' loading-anim' : ''; ?>" role="button" data-current-page="1" data-total-pages="<?php echo esc_attr( $total_pages ); ?>" data-pagination-type="<?php echo esc_attr( $single_product_reviews_advanced_pagination_type ); ?>"> |
| 29 |
<span class="merchant-pagination-button__label"> |
| 30 |
<?php echo esc_html__( 'Load More', 'merchant' ); ?> |
| 31 |
</span> |
| 32 |
<span class="merchant-pagination-button__loader"> |
| 33 |
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 512 512" aria-hidden="true" focusable="false"> |
| 34 |
<path fill="#FFF" d="M288 39.056v16.659c0 10.804 7.281 20.159 17.686 23.066C383.204 100.434 440 171.518 440 256c0 101.689-82.295 184-184 184-101.689 0-184-82.295-184-184 0-84.47 56.786-155.564 134.312-177.219C216.719 75.874 224 66.517 224 55.712V39.064c0-15.709-14.834-27.153-30.046-23.234C86.603 43.482 7.394 141.206 8.003 257.332c.72 137.052 111.477 246.956 248.531 246.667C393.255 503.711 504 392.788 504 256c0-115.633-79.14-212.779-186.211-240.236C302.678 11.889 288 23.456 288 39.056z" /> |
| 35 |
</svg> |
| 36 |
</span> |
| 37 |
</a> |
| 38 |
</div> |
| 39 |
|