-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct_card.php
65 lines (65 loc) · 2.61 KB
/
product_card.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<div class="card">
<div class="list-item__thumbnail-wrapper">
<a href="<?php the_permalink(); ?>" class="list-item__thumbnail">
<img src="<?php echo get_the_post_thumbnail_url(); ?>" class="img-fluid" alt="">
<?php
#Get array of categories
$cat_array = get_the_terms(get_the_ID(), 'product_cat');
?>
<span class="list-item__cat">
<?php foreach((array) $cat_array as $cat){
echo $cat->name . '</br>';
}?>
</span>
<?php if(get_field('video')) : ?>
<svg class="list-item__cat-icon icon">
<use xlink:href="<?php echo get_template_directory_uri(); ?>/img/symbol-defs.svg#icon-play-rounded"></use>
</svg>
<?php endif; ?>
</a>
<!--<div class="list-item__actions">
<a href="#" class="list-item__actions-item">
<svg class="list-item__actions-icon icon">
<use xlink:href="<?php echo get_template_directory_uri(); ?>/img/symbol-defs.svg#icon-share"></use>
</svg>
</a>
<a href="#" class="list-item__actions-item">
<svg class="list-item__actions-icon icon">
<use xlink:href="<?php echo get_template_directory_uri(); ?>/img/symbol-defs.svg#icon-love"></use>
</svg>
</a>
</div>-->
</div>
<?php
#Get the product objet for Woocommerce info
$product_obj = wc_get_product(get_the_ID());
?>
<div class="card-body">
<h5 class="card-title"><?php echo the_title(); ?></h5>
<div class="list-item__meta mb-4">
<div class="list-item__meta-item stars-by-yotpo" >
<div class="yotpo bottomLine" style="margin-bottom: 0" data-product-id="<?php echo get_the_ID(); ?>"></div>
</div>
<span class="separator">|</span>
<div class="list-item__meta-item"><?php echo get_post_meta( get_the_ID(), 'total_sales', true );?> <?php _e('booked', 'nenemi_button_element'); ?></div>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-sm">
<h4 class="mb-1"><?php if($product_obj->is_type('variable')) { wc_currency_display_text($product_obj->get_variation_sale_price()); } ?></h4>
</div>
<div class="col-sm text-right">
<p class="list-price mb-0"><?php if($product_obj->is_type('variable')) {wc_currency_display_text($product_obj->get_variation_regular_price('max')); } ?></p>
</div>
</div>
<div class="row align-items-end">
<div class="col-sm"><a href="<?php the_permalink(); ?>" class="btn btn-secondary"><?php _e('READ MORE', 'nenemi_button_element'); ?></a></div>
<?php if(is_between_dates(get_field('schedule_start'), get_field('schedule_end'))) : ?>
<div class="col-sm text-right">
<p class="mb-0 small"><?php _e('Available now', 'nenemi_button_element'); ?></p>
</div>
<?php endif; ?>
</div>
</div>
</div>