| 1 |
<?php |
| 2 |
/** |
| 3 |
* Wishlist page template |
| 4 |
* |
| 5 |
* @author RadiusTheme |
| 6 |
* @package RTSB_ABSPATH\Templates\Wishlist\list |
| 7 |
* @version 1.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
/** |
| 11 |
* Template variables: |
| 12 |
* |
| 13 |
* @var $field_ids string[] List of field ids |
| 14 |
* @var $empty_text string |
| 15 |
* @var $return_to_shop_text string |
| 16 |
*/ |
| 17 |
|
| 18 |
use RadiusTheme\SB\Modules\Compare\CompareFns; |
| 19 |
|
| 20 |
defined( 'ABSPATH' ) || die( 'Keep Silent' ); |
| 21 |
?> |
| 22 |
|
| 23 |
<div class="rtsb-compare-wrap"> |
| 24 |
<?php do_action( 'rtsb/module/compare/before_list' ); ?> |
| 25 |
<div class="rtsb-compare-list"> |
| 26 |
<?php |
| 27 |
|
| 28 |
if ( ! empty( $products ) ) { |
| 29 |
foreach ( $field_ids as $field_id ) { |
| 30 |
// Generate Filed name |
| 31 |
$name = CompareFns::instance()->field_name( $field_id ); |
| 32 |
?> |
| 33 |
<div class="rtsb-compare-list-row"> |
| 34 |
<div class="rtsb-compare-list-col rtsb-compare-field-label"><?php echo esc_html( $name ); ?></div> |
| 35 |
<?php foreach ( $products as $product ) : ?> |
| 36 |
<?php if ( ! empty( $product ) ) : ?> |
| 37 |
<div class="rtsb-compare-list-col rtsb-compare-list-value" |
| 38 |
data-product_id="<?php echo esc_attr( $product['id'] ); ?>"><?php CompareFns::instance()->display_field( $field_id, $product ); ?></div> |
| 39 |
<?php else : ?> |
| 40 |
<div class="rtsb-compare-list-col empty"> |
| 41 |
<?php echo esc_html( $name ?: '-' ); ?> |
| 42 |
</div> |
| 43 |
<?php endif; ?> |
| 44 |
<?php endforeach ?> |
| 45 |
</div> |
| 46 |
<?php |
| 47 |
} |
| 48 |
} else { |
| 49 |
if ( $empty_text ) { |
| 50 |
echo '<div class="rtsb-compare-empty">' . wp_kses_post( $empty_text ) . '</div>'; |
| 51 |
} |
| 52 |
|
| 53 |
if ( $return_to_shop_text ) { |
| 54 |
echo '<div class="rtsb-compare-return-to-shop"><a href="' . esc_url( wc_get_page_permalink( 'shop' ) ) . '" class="button">' . esc_html( $return_to_shop_text ) . '</a></div>'; |
| 55 |
} |
| 56 |
} |
| 57 |
?> |
| 58 |
<?php do_action( 'rtsb/module/compare/after_list' ); ?> |
| 59 |
</div> |
| 60 |
</div> |
| 61 |
|