0

我试图找出 woocommerce 钩子实际上了什么,它是如何定义的,但同时试图将我的问题写得足够笼统,以至于答案可能会帮助其他有类似问题的人。

我的产品有几个属性,所以页面当前显示:

>MY GREAT PRODUCT
>Price from: £x
>long winded description about how great it is - long winded description about how great it is - long winded description about how great it is.
>Attribute selection box 1
>Attribute selection box 2
>Price & Add To Cart Button

到目前为止很好,但我也在运行扩展 Woocommerce 产品附加组件,它提供了两种额外配置的选择,所以现在它:

>MY GREAT PRODUCT
>Price from: £x
>long winded description about how great it is - long winded description about how great it is - long winded description about how great it is.
>Attribute selection box 1
>Attribute selection box 2
>Product Add-On 1
>Product Add-On 2
>Price & Add To Cart Button

不太好,因为当客户选择属性时,他仍然看不到价格,除非他向下滚动页面经过产品附加组件。所以,最后,这就是我想要做的事情:

>MY GREAT PRODUCT
>Price from: £x
>long winded description about how great it is - long winded description about how great it is - long winded description about how great it is.
>Attribute selection box 1
>Attribute selection box 2
>**Price**
>Product Add-On 1
>Product Add-On 2
>Price & Add To Cart Button

好的,所以我发现我所追求的钩子是“woocommerce_template_single_excerpt”,我想编辑它只是复制页面底部显示的价格,并将其放在更靠前的位置属性框后的页面。我可以在任何地方找到一个文件来定义调用 woocommerce_template_single_excerpt 操作时会发生什么吗?我能不能!

4

0 回答 0