Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'woocommerce_single_product_summary', 'mx_show_sku_variable', 5 );
- function mx_show_sku_variable(){
- global $product;
- if ( ! $product->is_type( 'variable' ) ) return;
- echo '<div class="sku_info"></div>';
- wc_enqueue_js( "
- $(document).on('found_variation', 'form.cart', function( event, variation ) {
- $('.sku_info').html(variation.sku);
- });
- " );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement