我需要在特定模板中显示产品。
这是模板代码:
<div class="searchproduct">
<div class="searchsingle">
<?php the_post_thumbnail( 'medium_large' ); ?>
<h2 class="woocommerce-loop-product__title"><?php echo esc_html( get_the_title() ); ?></h2>
<div class="price"><span class="woocommerce-Price-amount amount"><?php echo $product->get_price(); ?><span class="woocommerce-Price-currencySymbol"> €</span></span></div>
<a href="<?php the_permalink(); ?>">
<div class="button">Ajouter au panier</div>
</a>
</div>
</div>
我想显示价格(有折扣)和旧价格。
<?php echo $product->get_price(); ?>
我怎样才能改变这个变量?
PIPIONE