作为How to show some few attributes on woocommerce category page?的续篇,您如何过滤不包含具有这些属性的产品的类别?还是留空?
这是我开始使用的格式。
/**
* Load theme metaboxes.
*/
require get_template_directory() . '/inc/theme-metaboxes.php';add_action('woocommerce_after_shop_loop_item','displaying_product_attributes');
function displaying_product_attributes() {
global $product;
$MLW = $product->get_attribute('pa_main-lift-web');
$LP = $product->get_attribute('pa_leg-pads');
$stab = $product->get_attribute('pa_stabilizer-waist');
$yoke = $product->get_attribute('pa_yoke');
echo "<font size='1pt' ><center> MLW $MLW /</font>";
echo "<font size='1pt'> LP $LP /</font>";
echo "<font size='1pt'> Stab $stab /</font>";
echo "<font size='1pt'> Yoke $yoke</center></font>";
}