Support » Plugin: WooCommerce » adding custom fields to additional information tab

  • Resolved rmsgreig

    (@rmsgreig)


    Hello, I am trying to customise the products-attrubute.php but it doesn’t look like changes I make in my child theme are showing up. I want to add some custom fields to the additional information tab. I’ve created the custom fields using advance custom fields and used

    <tr>
    <td> is this showing up? ” alt=”supplier_name” /> </td><td></td>
    </tr>

    to test pulling the information through.
    but nothing
    my folder structure is mytheme/woocommerce/single-product/products-attribute.php which I believe is the correct structure?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Fernando

    (@fhaps)

    Automattic Happiness Engineer

    @rmsgreig I don’t have much advice when it comes to editing that template directly, but I’m just curious: is there a reason you didn’t add these additional fields through product attributes?

    Any attributes that you add to your products will show up in that Additional Information tab.

    So, for example, you can add an attribute called Supplier name with a value of Textiles Pro, and this is how it would look like on the product page: http://cld.wthms.co/ohkoZZ

    Hopefully that helps!

    Hello.
    Sometimes, there is a need of adding additional information on custom fields, rather than attributes. One main reason (which I’ve never experienced on the many wooocommerce shos I bulit), is the following:
    We have dimensions and package dimensions in attributes and around 35k products.
    That made very long and slow query, as it was trying to get the matching of terms, term_relationship, bringing over 100k of rows on each query.. which was very bad.

    So we moved it to custom field and the query is much lighter now

    @seldimi did you found any solution

    I have overrided the template.. it wasn’t possible with hook

    @seldimi did you mean single-attribute.php in woocommerce I try that with <?php echo get_post_meta( $product->get_id(), ‘_diameter’, true ); ?> without successes

    I`m trying to get diameter for every variation from pre maid custom fields just above the dimensions

    • This reply was modified 1 year, 4 months ago by Bobkata.
    • This reply was modified 1 year, 4 months ago by Bobkata.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘adding custom fields to additional information tab’ is closed to new replies.