• Hello,

    I just hardcode your plugin on my side because I need to display only certain categories as tabs.

    Then, I am currently able to use the shortcode like this :

    [wtcpl-product-cat term_ids="107,104,137"]

    Here, look at my code :

     
    function wtcpl_load_products($atts) // see $atts
    {
    
        $atts = shortcode_atts( array(
            'term_ids'             => false
        ), $atts, 'woo-tabbed-category-product-listing' );
        $term_ids             = sanitize_text_field( $atts['term_ids'] ); // see $term_ids
    
        if (!is_admin()) {
            ob_start();
            $product_number = get_option('product_number');
            $column_number = get_option('column_number');
            ?>
            <div class="wtcpl_container">
                <div id="nav-holder">
                    <div class="wtcpl_category_nav" id="wtcpl_tabs">
                        <?php
    
        // If term_ids attribute
        if ( !empty( $term_ids ) ) {
    
                // Term string to array
                $include = $term_ids;
            } else { $include = ''; } // see $include
    
                        $args = array(
                            'number' => '',
                            'hide_empty' => 1,
                            'include' => $include // here we you this var
                        );

    Good idea right ?

    Many modules in themes or page builders allow people to filter only certain categories. What you think ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • hello MR.#onico0, can you tell me where the file i can add your code into, please?
    So many thanks.

    laurameeks

    (@laurameeks)

    I would like to tab only a single category of products, sorted by tags, or attributes or sub category. I cannot figure out how to do this?
    I have custom pages for each category that I display via shortcode on the page.
    Is this possible?
    example page
    https://ezkitcabs.com/shop-by-door-style/shaker-style-cabinets/shaker-white-cabinets/
    as you can see, I have a large number of products in each category, and I also need to use my created page to give my shoppers the information they need for the items.
    Can I add tabs to this list or how can I make the list easy to search?
    Regular search just give all categories and my customers need to shop and sort from a single category of products.
    Ive explored dozens of plugins and cannot figure out how to do this simple thing.

    • This reply was modified 6 years ago by laurameeks.

    hello MR. #onico0, How can i replace category tabs with a carousal ? Can you guide me with the code?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display only certain categories by passing it in the shortcode’ is closed to new replies.