block.json
6 months ago
controller.php
6 months ago
error.php
6 months ago
index.asset.php
1 month ago
index.js
1 month ago
style-index-rtl.css
4 months ago
style-index.css
4 months ago
view.php
6 months ago
controller.php
19 lines
| 1 | <?php |
| 2 | $product = sc_get_product(); |
| 3 | |
| 4 | // no product. |
| 5 | if ( empty( $product ) ) { |
| 6 | return; |
| 7 | } |
| 8 | |
| 9 | // reviews are not enabled. |
| 10 | if ( ! apply_filters( 'surecart/review_form/enabled', $product->reviews_enabled ) ) { |
| 11 | return; |
| 12 | } |
| 13 | |
| 14 | $query = sc_product_review_list_query( $block, $product->id ); |
| 15 | $reviews = $query->data ?? []; |
| 16 | |
| 17 | // return the view. |
| 18 | return 'file:./view.php'; |
| 19 |