Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[WP][WooCommerce] Add SKU next to Variation ID in Admin Metabox
// Add SKU next to variation ID
function display_sku_next_to_var_ids() {
<script type="text/javascript">
jQuery(function($) {
"use strict";
$(document).on('woocommerce_variations_loaded', function(event) {
var id = -1;
$('.woocommerce_variation.wc-metabox').each( function(index, elem) {
var var_id = $(elem).find('#variable_sku'+id).val();
$('h3 strong', this).after('<p style="display:inline;"> - SKU: <strong>'+var_id+'</strong></p>');
add_action( 'admin_print_scripts', 'display_sku_next_to_var_ids', 999);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment