I installed WooCommerce and have 3 variable products, however I'd like to add the variation "language". I don't want to add as meta information for the products (in the gui), but I would like to use a hook, so I can say that every variable product has a language variation - english and german. I tried using the filter woocommerce_display_product_attributes:

add_filter('woocommerce_display_product_attributes', function($atts, $product) {
  $product_attributes = $product->get_attributes();
  $languages = new WC_Product_Attribute();
  return [
}, 10, 2);

Can someone help me out with this? I would be really grateful!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.