• Hi.
    I need make 2 pages in store – men and women, with selection of goods by gender. On page for women – displayed only goods for woman and filter should apply this by default. I found hook in your plugin that should suit me – yith_wcan_query_vars_to_merge?

    /**
    * APPLY_FILTERS: yith_wcan_query_vars_to_merge
    *
    * Filters list of query vars to add to the query. - Фильтрует список переменных запроса, которые можно добавить в запрос.
    *
    * @param array $query_vars List of query vars
    *
    * @return array
    */
    $query_vars = apply_filters( 'yith_wcan_query_vars_to_merge', $this->get_query_vars() );

    Can you explain in what format the query parameter should be passed so that the hook works correctly?

    // Insert in function.php
    function modify_start_param_yith_wcan( $this->get_query_vars ) {

    if ( $this->is_main_query() && $this->post_type = 'product' ) {

    if(isset($_GET['female'])) {
    $this->query_vars = array(
    'key' => 'gender',
    'value' => 'women',
    'compare' => '=',
    'type' => 'string'
    )
    }
    };
    return $query_vars;
    }

    add_filter('yith_wcan_query_vars_to_merge', 'modify_start_param_yith_wcan');

    Will this be correct?

    Thanks in advance for your reply.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Pablo Pérez

    (@pperez001)

    Hi there,

    Checking your requirements, this filter won’t help you. You should create a category for “female” and another for “male” as it seems you want to use a custom taxonomy and our free version doesn’t support them.

    Creating those categories and including a preset with category filter, it will automatically select those filters upon reaching the page allowing to filter specific products.

    Let us know if you have any question.

    Thread Starter millerml

    (@millerml)

    I asked a pre-sale question to support paid version, here’s what they answered:

    upon confirming your use case with the developer team, they have informed it would not be possible with our plugin

    I realized that I need to look for another solution?

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