Display Specific Attributes where Short Description displays
-
I want to display 4 of my product attributes on archives where the short description usually is.
I came up with this code just to echo the values:
<div class="summary-attributes"> CPU: <?php echo wc_get_product()->get_attribute( 'pa_cpu' ); ?> RAM: <?php echo wc_get_product()->get_attribute( 'pa_guaranteed-ram' ); ?> Disk: <?php echo wc_get_product()->get_attribute( 'pa_disk' ); ?> Traffic: <?php echo wc_get_product()->get_attribute( 'pa_traffic' ); ?> </div>
But it seems WooCommerce templates are all functions and my PHP isn’t that good… so I have no idea how to make these four attributes show on archives where short description usually is…
I also want it to show on product pages where short description usually is as well. (There is a plugin for that, but it displays ALL attributes instead of just specific ones, plus it only shows on product pages but not archive pages.)
Greatly appreciate someone showing me where/how to accomplish this. Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Display Specific Attributes where Short Description displays’ is closed to new replies.