Support

Account

Home Forums General Issues Adding custom field to product category page Reply To: Adding custom field to product category page

  • You need to supply ACF with the post ID, in this case that is the product ID.

    https://stackoverflow.com/questions/27385920/woocommerce-get-current-product-id

    
    add_action('woocommerce_shop_loop_item_title', 'custom_pre_title');
    function custom_pre_title(){
      global $product;
      $id = $product->get_id();
      $field_value = get_field('field_name', $id);
    }