wordpress - 有什么方法可以显示所有产品变化价格?
问题描述
我有销售产品的 WordPress woo-commerce 网站,并且我对产品有三种不同的价格,例如(1 公斤 -420、500 克 - 220 和 250 克 - 100)。目前它的价格显示为 100-420,但我需要将所有三个变体价格显示在产品下方,任何人都可以帮助解决这个问题
$formatted_price = ( $negative ? '-' : '' ) . sprintf( $args['price_format'], '<span class="woocommerce-Price-currencySymbol">' . get_woocommerce_currency_symbol( $args['currency'] ) . '</span>', $price );
$return = '<span class="woocommerce-Price-amount amount">' . $formatted_price . '</span>';
if ( $args['ex_tax_label'] && wc_tax_enabled() ) {
$return .= ' <small class="woocommerce-Price-taxLabel tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
解决方案
推荐阅读
- java - 有没有办法访问 Environment.DIRECTORY_DOWNLOADS?
- mongodb - 如何在 Moleculer 中使用 MongoDB 聚合
- python - 按值长度降序然后按键升序对python dict进行排序
- typescript - 项目级 .eslintrc.js 打字稿规则未生效
- c# - e.NewWindow = (CoreWebView2)sender 仍然会产生一个单独的实例
- css - Webkit-scrollbar 在 Firefox wordpress 上不起作用
- node.js - DISCORD JS BOT - TypeError [CLIENT_MISSING_INTENTS]:必须为客户端提供有效的意图
- python - Spotify语音助手属性错误__enter__
- typescript - 我可以询问在 Typescript(和字符串联合类型)中使用(或不使用)枚举的任何哲学原因吗
- php - 如何在 codeigniter 博客文章页面中获取上一篇和下一篇文章