Woocommerce - 产品页面中的说明 [英] Woocommerce - description in products page

查看:852
本文介绍了Woocommerce - 产品页面中的说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Woocommerce插件中对我的产品添加一点摘要。
我有这样的页面: http://exploreprague.cz/guides-buddies-2/ ,我需要在每个人的名字下有一些描述文本...有什么办法吗?

I need to add little excerpt from description on my "product" in Woocommerce plugin. I have page like this: http://exploreprague.cz/guides-buddies-2/ and I need to have some description text under the name of each person... is there any way to do it?

推荐答案

其中包含产品的类别页面是:
woocommerce >> templates >> content-product.php

That category page with the products inside is: woocommerce >> templates >> content-product.php

在此页面中显示标题为:

And you can find that only function to show the Title inside this page as:

<h3><?php the_title(); ?></h3>

之后您可以添加自己的行:

After that line you can add your own lines:

<br /><?php echo $product->get_sku(); ?> <br /><?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?>

这些将显示SKU和产品的简短描述。

These will display the SKU and the short-description of the product.

Btw,这只是一个快速硬编码的方法,你可以尝试添加这些函数到该主题的函数。

Btw, this is just a quick hard-coded method, you can try to add these functions to the hook on that page in your theme's functions.php.

add_action('woocommerce_after_shop_loop_item_title','woocommerce_template_single_excerpt', 5);

正如在hooks评论部分提到的,PRICE已经挂在那里。

As it is mentioned in that hooks comments section that the PRICE is already hooked in there.

这篇关于Woocommerce - 产品页面中的说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆