Home Forums WoodMart support forum Products (grid or carousel)

Products (grid or carousel)

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #135077

    gugamac
    Participant

    Hi,

    i have a problem with the “Products (grid or carousel)” Element. The search for product ID (Data source List of ID´s) is nor working, when i type an ID, comes only pages/posts on the list and not the products ID list. Can you please help?

    Attachments:
    You must be logged in to view attached files.
    #135080

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it?

    Thank you in advance

    #135094

    gugamac
    Participant

    Hi, thanks for fast reply.

    #135095

    gugamac
    Participant

    this elements, please check screenshots

    Attachments:
    You must be logged in to view attached files.
    #135120

    Artem Temos
    Keymaster

    Please, send us your FTP access so we can check.

    #135222

    gugamac
    Participant

    check ftp

    thx

    #135269

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file

    function woodmart_action_autocomplete(){
        remove_filter( 'vc_autocomplete_woodmart_products_include_callback',    'vc_include_field_search', 10, 1 ); // Get suggestion(find). Must return an array
        add_filter( 'vc_autocomplete_woodmart_products_include_callback',   'vc_include_field_search_product', 10, 1 ); // Get suggestion(find). Must return an array
    }
    add_action( 'init', 'woodmart_action_autocomplete', 500 );
    function vc_include_field_search_product( $search_string ) {
        $query = $search_string;
        $data = array();
        $args = array(
            's' => $query,
            'post_type' => 'product',
        );
        $args['vc_search_by_title_only'] = true;
        $args['numberposts'] = -1;
        if ( 0 === strlen( $args['s'] ) ) {
            unset( $args['s'] );
        }
        add_filter( 'posts_search', 'vc_search_by_title_only', 500, 2 );
        $posts = get_posts( $args );
        if ( is_array( $posts ) && ! empty( $posts ) ) {
            foreach ( $posts as $post ) {
                $data[] = array(
                    'value' => $post->ID,
                    'label' => $post->post_title,
                    'group' => $post->post_type,
                );
            }
        }
        return $data;
    }
    #135427

    gugamac
    Participant

    looks like is working know. Thank you!! 🙂

    #135434

    Artem Temos
    Keymaster

    You are welcome!

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Products (grid or carousel)’ is closed to new replies.