Okay
  Public Ticket #3293298
categories limit and categories allowed
Closed

Comments

  •  4
    Martin started the conversation

    I wish to add 2 features for 

    Configurable Features and Limits by Group / Package

    categories limit and categories allowed

  •  2,218
    WebWizards replied

    Hi Martin,

    Thank you for your feedback,


    We will consider adding these in future updates,


    If that can help, I can provide you with a PHP hook so you can set a categories limit programmatically (by vendor group ID).


    Kind regards,

    Stefan

  •  4
    Martin replied

    Yes please provide PHP hook if I can processing. Thanks for help

  •  2,218
    WebWizards replied

    You can add the following PHP code snippet to your site:

    add_action('marketking_dashboard_head', function(){
        $user_id = get_current_user_id();
        $vendorgroup = intval(get_user_meta( $user_id, 'marketking_group', true ));
        if ($vendorgroup === 123){
            ?>
            <script>
                jQuery(document).ready(function(){
                    jQuery("#marketking_select_categories").select2("destroy");
                    jQuery("#marketking_select_categories").select2({
                        maximumSelectionLength: 3
                    });
                });
            </script>
            <?php
        }
        
    });
    

    This sets a limit of 3 categories for vendors with the group with ID 123.

  •  4
    Martin replied

    Because the categories data is large, difficult to setting include categories at vendor group section.

    How can it code here PHP with include and exclude function? add up to the code of categories limit you provided. Thanks for help!

    ----------------------------------------------------

    I put the code at SNIPPET works fine.

    It not work at the Child Theme: functions.php, it can be ignored.

  •   WebWizards replied privately
  •  4
    Martin replied

    It is perfect solution PHP with include and exclude function!

    Thank you very much Stefan!