Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1307
    Avatarthomsoon
    Supported

    Hello,

    How do I set the default style display for “List Type” instead of “Grid” in the store?

    #1314

    Hi there,

    Please add code:

    add_filter('wc_get_template_part', 'demo_change_template_part', 10, 3);
    
    function demo_change_template_part($template, $slug, $name) {
        $template = wc_get_template_part('content', 'product-list');
        if (isset($_GET['layout'])) {
            if ($slug == 'content' && $name == 'product' && $_GET['layout'] == 'grid') {
                $template = wc_get_template_part('content', 'product');
            }
        }
    
        return $template;
    }

    into file function.php in child-theme.

    If you need to help, please send Admin web account for me, I will check and help you.

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

You must be logged in to reply to this topic.