Advertisement
retoo

Produkt Attribute

Mar 15th, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  1. dd_action('woocommerce_shop_loop_item_title', 'wotom_show_attributes_title', 15);
  2. function wotom_show_attributes_title()
  3. {
  4.  global $product, $post;
  5.     $ab1 = $product->get_attribute ('pa_weingut');
  6.     $ab2 = $product->get_attribute ('pa_rebsorte');
  7.     $ab3 = $product->get_attribute ('pa_dac-lage');
  8.     $ab4 = $product->get_attribute ('pa_jahrgang');
  9.     echo "<div class='erste'><h1 class='shoppage_header1'>" . __($ab1,'woocommerce') . "</h1></div>";
  10.     echo "<div class='zweite'><h1 class='shoppage_header2'>" . __($ab2,'woocommerce') . "</h1></div>";
  11.     echo "<div class='dritte'><h2 class='shoppage_sub1'>&nbsp;" . __($ab3,'woocommerce') . "</h2></div>";
  12.     echo "<div class='vierte'><h2 class='shoppage_sub2'>&nbsp;" . __($ab4,'woocommerce') . "</h2></div>";
  13.     // Get the WC_Product_Variable instance Object
  14.    //$product = wc_get_product( $post->ID ); // Works for any product type
  15.    // Displaying the formatted "Min" - "Max" price range
  16. //echo $product->get_price_html();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement