Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3812976
How to sort by Menu Order
Open

Comments

  •  3
    Trent started the conversation

    Hi there.

    Is it possible to disable the table header sorting on the "name" column.

    And then have the default sort order of the table to be the equivalent of menu_order. eg: the order you have dragged and dropped in the product attributes table in "configure terms".

    Thanks.

    =)

  •  1,355
    Dustin replied

    Hi Trent,

    Please add the custom code below. (How to add custom code? ↗):

    add_filter( 'wpcvt_datatable_params_arr', function ( $params ) {
    	$params['ordering'] = false;
    
    	return $params;
    } );

    Best regards,
    Dustin

  •  3
    Trent replied

    Hi Dustin.

    Thanks for this, your code disabled the TH sorting.

    The name column is still sorting by Title, is there a way to change this to the equivalent of "menu_order" eg. the order that is dragged and dropped in the product attributes table in "configure terms" ?

    Thanks.
    =)

  •  1,355
    Dustin replied

    They are variation tables, so they will be sorted by order in the variations list:

    6602507372.png

    Best regards,
    Dustin

  •  3
    Trent replied

    Ok.

    But this is not default WooCommerce behaviour.

    The ordering of variations is controlled (when not using a plugin like yours) via the product attributes table.

    See screenshots:

    1) The first shows the order with your plugin enabled, and yes if I drag and drop within the edit product as per your screenshot that order is respected.

    2) The Second shows when your plugin is disabled the order the variations appear within the select drop down.

    3) The third screenshot shows that the order of variations (when your plugin is disabled) is coming from the order that is dragged and dropped in the product attributes table in "configure terms"

    Q) It is my hope that your plugin can work as per the default WooCommerce behaviour/method. Possible? **

    ** In the past I have been on support with WooCommerce and they explained that the drag and drop ordering within the product is not actually used by default in WooCommerce. If you add attributes locally within the product and then make variations out of them, you have to change the pipe order within the attributes to change order (silly i know), and likewise if you use a product attribute group to create variations within a product, it's the drag and drop order in the product attributes table in "configure terms" that is used to control the order.

    Attached files:  001.png
      002.png
      003.png

  •  1,355
    Dustin replied

    In screenshots 2 and 3, this is the attribute "MTN 94" dropdown so that the items will be sorted based on the attribute terms list.

    However, our plugin lists all variations - not only singular attributes. You can imagine that when there is more than one attribute, each has its own arrangement. Which arrangement will be correct? https://demo.wpclever.net/woovt/product/variable-product-02/ 

    Even if we could rationalize how we order attributes, it’s not always easy to pick the exact variant at the top of the list. For example, you might want to put the best-selling red hat in size S at the top, but for the shirt, you’d like to put the blue shirt in size M at the top. That's where the arrangement of variations within each variable product (as it is now) comes into play.

    This is just a discussion with you. I understand your idea, but I cannot change the current functionality of our plugin to make it work like that.

    Best regards,
    Dustin

  •  3
    Trent replied

    Yes understood, your point is a very good one.

    Thanks for your help and explanations.

    Appreciated..!