在产品页面 woocommerce 中显示“每个属性”链接

问题描述 投票:0回答:1

我一直在到处寻找在 Wordpress/Woocommerce 中应该很明显的提示。我想让属性值显示在产品页面中,作为每个自动生成的存档链接。有谁知道这是怎么做到的吗?代码页是:

<?php
            if ( $attribute['is_taxonomy'] )  {

                $values = woocommerce_get_product_terms( $product->id, $attribute['name'], 'names' );
                echo  apply_filters( 'woocommerce_attribute', wpautop( wptexturize( implode( ', ', $values ) ) ), $attribute, $values ) ;

            } else {

                // Convert pipes to commas and display values
                $values = array_map( 'trim', explode( '|', $attribute['value'] ) );
                echo apply_filters( 'woocommerce_attribute', wpautop( wptexturize( implode( ', ', $values ) ) ), $attribute, $values );

            }
        ?>

有人可以帮忙吗? 谢谢! F.

php wordpress woocommerce attributes
1个回答
1
投票

请看一下这个。刚刚在github上找到的

https://gist.github.com/coenjacobs/2594985

© www.soinside.com 2019 - 2024. All rights reserved.