在产品灯箱上显示完整的产品描述
Displaying full product description on product lightbox
是否有 WooCommerce add_action 来显示完整的产品描述,这是在主文本编辑中找到的文本 window(不是产品简短描述)
经过快速 google 搜索后,我只能找到有关添加简短描述的建议。 woocommerce_template_single_excerpt
.
我正在尝试将其添加到 woocommerce_show_product_saleflash
之后。
灯箱php如下图。
<?php
do_action( 'woocommerce_before_single_product_lightbox_summary' );
?>
</div>
<div class="product-info summary large-6 col entry-summary" style="font-
size:90%;">
<div class="product-lightbox-inner" style="padding: 30px;">
<a class="plain" href="<?php echo the_permalink();?>"><h1><?php the_title(); ?></h1></a>
<div class="is-divider small"></div>
<div><?php the_content(); ?></div>
<?php
do_action( 'woocommerce_single_product_lightbox_summary' );
?>
</div>
</div><!-- .summary -->
</div><!-- #product-<?php the_ID(); ?> -->
</div><!-- product-container -->
</div>
<?php do_action('wc_quick_view_after_single_product'); ?>
完整的产品描述设置在选项卡中,因此相应的模板位于:
single-products/tabs/description.php
。
您可以轻松取消设置此选项卡:Editing product data tabs (Removing tabs)
然后你可以在任何地方添加这段代码,使用任何钩子(来自 description.php 模板的代码):
<?php the_content(); ?>
您还可以使用:
global $post;
echo $post->post_content;
或者(如果 WC_Product 对象可用):
global $product;
echo $product->get_description();
是否有 WooCommerce add_action 来显示完整的产品描述,这是在主文本编辑中找到的文本 window(不是产品简短描述)
经过快速 google 搜索后,我只能找到有关添加简短描述的建议。 woocommerce_template_single_excerpt
.
我正在尝试将其添加到 woocommerce_show_product_saleflash
之后。
灯箱php如下图。
<?php
do_action( 'woocommerce_before_single_product_lightbox_summary' );
?>
</div>
<div class="product-info summary large-6 col entry-summary" style="font-
size:90%;">
<div class="product-lightbox-inner" style="padding: 30px;">
<a class="plain" href="<?php echo the_permalink();?>"><h1><?php the_title(); ?></h1></a>
<div class="is-divider small"></div>
<div><?php the_content(); ?></div>
<?php
do_action( 'woocommerce_single_product_lightbox_summary' );
?>
</div>
</div><!-- .summary -->
</div><!-- #product-<?php the_ID(); ?> -->
</div><!-- product-container -->
</div>
<?php do_action('wc_quick_view_after_single_product'); ?>
完整的产品描述设置在选项卡中,因此相应的模板位于:
single-products/tabs/description.php
。
您可以轻松取消设置此选项卡:Editing product data tabs (Removing tabs)
然后你可以在任何地方添加这段代码,使用任何钩子(来自 description.php 模板的代码):
<?php the_content(); ?>
您还可以使用:
global $post;
echo $post->post_content;
或者(如果 WC_Product 对象可用):
global $product;
echo $product->get_description();