• Resolved ilfuso

    (@ilfuso)


    Hello,
    Is there the possibility to sort table data by price as a default, without the user having to press on the price column?
    It’s ok also via code.

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hakik Zaman

    (@hakik)

    Hi @ilfuso

    Thanks for reaching out to me. Unfortunately, right now it is not possible from plugin settings.

    Please try to place the below code block inside your child theme’s functions.php or as a snippet inside the Code Snippets plugin

    function pvt_auto_sort_support(){
    	if( is_product() ):
    ?>
    	<script type="text/javascript">
    		jQuery(document).ready(function( $ ){
    			// Your code in here
    			$("th.price_html").click(); 
    		});
    	</script>
    <?php	
    	endif;
    }
    add_action('wp_footer', 'pvt_auto_sort_support', 99);

    Hopefully, it will help.

    Thanks

    Plugin Author Hakik Zaman

    (@hakik)

    It’s been a while, I didn’t hear anything from you.

    So, I am changing its status as resolved.

    Feel free to create a new support thread if you face any issues.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sort table elements by default’ is closed to new replies.