Search code examples
wordpresswoocommerceproduct-variationscustom-field-type

Woocommerce: How to display a table with different content for each Product Variation?


I would like to display a small table listing the bulk prices for each particular product variation. The table will only appear when the variation is selected, much like the variation's SKU. I am alright with the table either being in the woocommerce_product_meta_end(hook) or in one of the product tabs.

I am aware that custom fields can be created for each variation under 'edit product': http://www.remicorson.com/woocommerce-custom-fields-for-variations/. I would like to create a custom 'wp-editor' field where I can create the table for each variation using HTML, so would appreciate if anyone can help me on this.

Thanks in advance.


Solution

  • It might be easier than you think, without requiring custom fields! When you edit the product there is an additional "Description" field for each variation. This will be displayed when the customer selects that option - usually under the drop-down menu where you select the variation. The field isn't very big, but it does accept HTML.