• Resolved declicben

    (@declicben)


    Hi,

    On the vendors page ([dokan-stores] shortcode) could we put by default a random sort order, when we arrive on this page?

    Best Regards

    • This topic was modified 7 months ago by declicben.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support roshni07

    (@roshni07)

    Hello @declicben,

    I am really sorry to inform you that the change is not possible by default. But yes, there is an alternative way.

    In order to add the custom code, please navigate through
    wp-content/plguins/dokan-lite/templates/store-lists.php,
    find line number 51, you will see an action hook:

    do_action( ‘dokan_before_seller_listing_loop’, $sellers );

    Use this action hook to write the code for rearranging the stores depending on the sorting criteria within the functions.php file of your child theme. So that your modification exists over plugin update.

    Thanks 🙂

    Roshini, This is a great start to helping the hundreds of people with this issue. Is it possible to provide a little more guidance such as parameters for setting the store sort order. I think most people would like to be able to: (In order of importance)

    *Custom Sort – Set an order by field on the vendor list page

    1. Alphabetical
    2. Featured on top
    3. Number of products
    4. Newest vendors on top rather than bottom

    I have spent twenty hours researching how to perform this and this is the first thing I found even referring to how to customize this list. There are no viable plugins that fix this.

    Hello @npetrie5933 ,

    I understand your expectation but unfortunately, as we do not have a built-in solution for that, we will submit a feature request to our developers to work on it.

    You may want to look at the file – \dokan-lite\templates\store-lists-filter.php and explore how the current sorting has been deployed.

    Basically the store list order is generating from this root function – \dokan-lite\includes\Vendor\Manager.php – see get_vendors() function. Here you will see the order is set to ASC so it shows from old to new.

    I will suggest to allow these parameters to sort in the shortcode.

    Thank you 🙂

    Thank you for this guidance, in some cases, you do have walkthroughs on customizations like this. It would be helpful if you do put a developers guide together to explain the structure of the file system and what not. You have lots of configuration information but not much on behind the scenes.

    Regards,
    Nate

    Hello @npetrie5933 ,

    Thanks for your suggestion.

    Yes, I am already compiling the information regarding the customization that I provided here. Also, my other colleagues will contribute and we can hopefully present them in a better way.

    Regards,
    Rashed.

    The ‘ASC’ option in – \dokan-lite\includes\Vendor\Manager.php works, but the “registered” option in get_vendors() is the part that would be key here.
    Is there anything like ‘total_orders’ that would work here?
    Regards,

    Hello @manuelm1209 ,

    It looks like we have an option for total_orders which is named as Most popular in sort by option.

    You will see it has been used here – \dokan-lite\includes\Vendor\StoreListsFilter.php see function sort_by_options().

    Also, the total_orders is defined here – \dokan-lite\includes\Vendor\StoreListsFilter.php see function filter_query_from().

    I have not tested this extensively so I am unable to guarantee if it will work out of the box. You may want to debug a bit.

    Thank you 🙂

    Hello

    Is there a way to do this via a shortcode?

    Thanks

    Hello @proshop ,

    At the moment the shortcode for this solution is not available.

    Thank you 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.