Viewing 3 replies - 1 through 3 (of 3 total)
  • con

    (@conschneider)

    Engineer

    Hi there,

    I would say the Javascript answer in your Stackexchange post is the way to go. You can wrap the Javascript in a control statement that checks whether you are in the front end to only execute it there.

    Kind regards,

    Thread Starter WP Native

    (@nazreenexe)

    I’d much appreciate it if you could add that snippet here..

    🙏🙏

    I tried this snippet

    add_action( 'admin_footer', function(){
    	$screen       = get_current_screen();
    	$screen_id    = $screen ? $screen->id : '';
        if ( ! in_array( $screen_id, array( 'product', 'edit-product' ) ) )
        	return;
    ?>
        <script type="text/javascript">
            jQuery( function( $ ) {
                $( function() {
                    // Attribute ordering.
                    $( '.product_attributes' ).sortable({
                        items: '.woocommerce_attribute',
                        disabled: true
                    });
                    
                    $( '.woocommerce_attribute h3 .sort' ).css('cursor', 'pointer');
                 });
            });
        </script>
    <?php
    }, 999);

    I added the code into functions.php file

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Disable sortable UI for attributes’ is closed to new replies.