Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. add_action( 'woocommerce_after_shop_loop_item', 'display_size_attribute', 5 );
  2. function display_size_attribute() {
  3. global $product;
  4.  
  5. if ( $product->is_type('variable') ) {
  6. $array_colori = $product->get_attribute('pa_color');
  7. $array_taglie = $product->get_attribute('pa_sizes');
  8. echo '<span class="attributi_colori">' . implode(",", $array_colori) . '</span>';
  9. echo '<span class="attributi_taglie">' . implode(",", $array_taglie) . '</span>';
  10. }
  11.  
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement