Support » Plugin: WooCommerce » Featured Products Not Working

  • Resolved ndbroughton

    (@ndbroughton)


    On the homepage of our site, the featured products only displays one product.

    The code we are using is
    <?php echo do_shortcode( '[featured_products per_page="8" columns="4" orderby="date" order="desc"]'); ?>

    Even just typing the normal shortcode directly on the page editor only returns one product.

    However, when we use the code

    <?php
            $args = array(
                'post_type' => 'product',
                'posts_per_page' => 12,
                'tax_query' => array(
                        array(
                            'taxonomy' => 'product_visibility',
                            'field'    => 'name',
                            'terms'    => 'featured',
                        ),
                    ),
                );
            $loop = new WP_Query( $args );
            if ( $loop->have_posts() ) {
                while ( $loop->have_posts() ) : $loop->the_post();
                    wc_get_template_part( 'content', 'product' );
                endwhile;
            } else {
                echo __( 'No products found' );
            }
            wp_reset_postdata();
        ?>

    it displays all featured products that we have. However, this solution does not work as we want them listed in a grid, not as an unordered list.

    • This topic was modified 1 year, 2 months ago by ndbroughton.
    • This topic was modified 1 year, 2 months ago by ndbroughton.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter ndbroughton

    (@ndbroughton)

    On a second look, it looks like the site is wrapping everything there within a comment for some reason, although I have no idea why it would be doing that. (screenshot) never mind this was from the other test i did and is NOT the issue

    • This reply was modified 1 year, 2 months ago by ndbroughton.
    • This reply was modified 1 year, 2 months ago by ndbroughton. Reason: add _blank
    • This reply was modified 1 year, 2 months ago by ndbroughton.
    Plugin Support Missy a11n

    (@m155y5)

    Automattic Happiness Engineer

    Hi @ndbroughton

    It looks like you’re using an outdated version of the shortcode.

    Please try the shortcode listed here: https://docs.woocommerce.com/document/woocommerce-shortcodes/#scenario-2-featured-products

    It would be something like [products limit="4" columns="2" visibility="featured" ]

    Thread Starter ndbroughton

    (@ndbroughton)

    Hey @m155y5,

    This did not solve the issue, and it continues to show only 1 product as it had before.

    Any ideas?

    Thanks!

    Plugin Support Missy a11n

    (@m155y5)

    Automattic Happiness Engineer

    Hi @ndbroughton – it’s possible this is related to your WooCommerce version, other plugins, or theme (more on how a theme might cause the problem with featured products here).

    To further help with troubleshooting, could I ask you to please share your System Status Report with us? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”. Once you’ve done that, you can paste it into your reply here.

    Thread Starter ndbroughton

    (@ndbroughton)

    @m155y5 Here is the site report.

    
    ### WordPress Environment ###
    
    WordPress address (URL): https://www.latentforensics.com
    Site address (URL): https://www.latentforensics.com
    WC Version: 3.9.2
    REST API Version: ✔ 1.0.7
    Log Directory Writable: ✔
    WP Version: 5.3.2
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: –
    WP Cron: ✔
    Language: en
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.3.14
    PHP Post Max Size: 400 MB
    PHP Time Limit: 300
    PHP Max Input Vars: 18000
    cURL Version: 7.62.0
    OpenSSL/1.0.2k
    
    SUHOSIN Installed: –
    MySQL Version: 5.6.47-cll-lve
    Max Upload Size: 400 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ❌ Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    
    ### Database ###
    
    WC Database Version: 3.9.2
    WC Database Prefix: wp_
    Total Database Size: 37.41MB
    Database Data Size: 26.58MB
    Database Index Size: 10.83MB
    wp_woocommerce_sessions: Data: 1.27MB + Index: 0.05MB + Engine MyISAM
    wp_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_order_items: Data: 0.63MB + Index: 0.27MB + Engine MyISAM
    wp_woocommerce_order_itemmeta: Data: 3.91MB + Index: 2.86MB + Engine MyISAM
    wp_woocommerce_tax_rates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_woocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_commentmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_comments: Data: 0.39MB + Index: 0.15MB + Engine MyISAM
    wp_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_masterslider_options: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_masterslider_sliders: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp_options: Data: 4.32MB + Index: 0.57MB + Engine MyISAM
    wp_postmeta: Data: 8.25MB + Index: 4.57MB + Engine MyISAM
    wp_posts: Data: 1.67MB + Index: 0.42MB + Engine MyISAM
    wp_prli_clicks: Data: 0.00MB + Index: 0.04MB + Engine MyISAM
    wp_prli_links: Data: 0.00MB + Index: 0.03MB + Engine MyISAM
    wp_prli_link_metas: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_termmeta: Data: 0.01MB + Index: 0.02MB + Engine MyISAM
    wp_terms: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_term_relationships: Data: 0.04MB + Index: 0.08MB + Engine MyISAM
    wp_term_taxonomy: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_UPCP_Catalogues: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_Catalogue_Items: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_Categories: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_Custom_Fields: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_Fields_Meta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_Items: Data: 0.03MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_Item_Images: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_SubCategories: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_Tagged_Items: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_Tags: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_Tag_Groups: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_UPCP_Videos: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_usermeta: Data: 1.74MB + Index: 0.93MB + Engine MyISAM
    wp_users: Data: 0.13MB + Index: 0.11MB + Engine MyISAM
    wp_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wc_product_meta_lookup: Data: 0.05MB + Index: 0.09MB + Engine MyISAM
    wp_wc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp_wc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfBlockedIPLog: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfBlocks7: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfConfig: Data: 1.23MB + Index: 0.01MB + Engine MyISAM
    wp_wfCrawlers: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfFileChanges: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfFileMods: Data: 1.39MB + Index: 0.28MB + Engine MyISAM
    wp_wfHits: Data: 0.35MB + Index: 0.07MB + Engine MyISAM
    wp_wfHoover: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfIssues: Data: 0.02MB + Index: 0.01MB + Engine MyISAM
    wp_wfKnownFileList: Data: 0.74MB + Index: 0.09MB + Engine MyISAM
    wp_wfLiveTrafficHuman: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfLocs: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp_wfLogins: Data: 0.18MB + Index: 0.05MB + Engine MyISAM
    wp_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wfNotifications: Data: 0.02MB + Index: 0.00MB + Engine MyISAM
    wp_wfPendingIssues: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfReverseCache: Data: 0.06MB + Index: 0.02MB + Engine MyISAM
    wp_wfSNIPCache: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wfStatus: Data: 0.09MB + Index: 0.05MB + Engine MyISAM
    wp_wfTrafficRates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp_wpfm_backup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    
    ### Post Type Counts ###
    
    attachment: 1102
    custom_css: 1
    customize_changeset: 4
    gs-logo-slider: 10
    logoshowcase: 11
    nav_menu_item: 17
    page: 9
    post: 2
    pretty-link: 1
    product: 592
    product_variation: 649
    revision: 227
    scheduled-action: 6
    shop_order: 2081
    wpcf7_contact_form: 2
    
    ### Security ###
    
    Secure connection (HTTPS): ✔
    Hide errors from visitors: ✔
    
    ### Active Plugins (26) ###
    
    AJAX Search for WooCommerce: by Damian Góra – 1.6.2
    Analytify - Gooogle Analytics Dashboard widget: by Team Analytify – 1.1.2
    Autoptimize: by Frank Goossens (futtta) – 2.6.1
    Contact Form 7: by Takayuki Miyoshi – 5.1.6
    Google XML Sitemaps: by Arne Brachhold – 4.1.0
    GS Logo Slider Lite: by GS Plugins – 1.8.5
    LoginPress - Customizing the WordPress Login: by WPBrigade – 1.4.2
    Master Slider: by averta – 3.5.8
    Pretty Links: by Blair Williams – 3.1.0
    Really Simple SSL: by Rogier Lankhorst
    Mark Wolters – 3.2.9
    
    Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.3
    String Locator: by Clorith – 2.3.1
    Sucuri Security - Auditing, Malware Scanner and Hardening: by Sucuri Inc. – 1.8.24
    Category Order and Taxonomy Terms Order: by Nsp-Code – 1.5.7.1
    Title Remover: by WPGurus – 1.2.1
    User Role Editor: by Vladimir Garagulya – 4.53
    WooCommerce: by Automattic – 3.9.2
    Wordfence Security: by Wordfence – 7.4.6
    WordPress Importer: by wordpressdotorg – 0.6.4
    Analytify - Google Analytics Dashboard: by Analytify – 3.0.0
    WordPress Database Backup: by Austin Matzko – 2.3.3
    WP Logo Showcase Responsive Slider: by WP OnlineSupport – 2.4.1
    WP reCaptcha Integration: by Jörn Lund – 1.2.1
    WP Responsive Menu: by MagniGenie – 3.1.4
    YITH WooCommerce Quick View: by YITH – 1.3.18
    YITH WooCommerce Request A Quote Premium: by YITH – 2.2.7
    
    ### Inactive Plugins (4) ###
    
    GA Google Analytics: by Jeff Starr – 20191109
    Stop WP Emails Going to Spam: by Fullworks – 1.1.3
    WP Mail SMTP: by WPForms – 1.8.1
    WP Super Cache: by Automattic – 1.7.1
    
    ### Must Use Plugins (1) ###
    
    installatron_hide_status_test.php: by  –
    
    ### Settings ###
    
    API Enabled: ✔
    Force SSL: –
    Currency: CAD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: simple (simple)
    grouped (grouped)
    variable (variable)
    external (external)
    
    Taxonomies: Product Visibility: exclude-from-search (exclude-from-search)
    exclude-from-catalog (exclude-from-catalog)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: –
    
    ### WC Pages ###
    
    Shop base: #97 - /shop/
    Cart: #98 - /cart/
    Checkout: #99 - /checkout/
    My account: #100 - /my-account/
    Terms and conditions: ❌ Page not set
    
    ### Theme ###
    
    Name: SixEightFive Commerce
    Version: 1.0.1
    Author URL: http://sixeightfive.ca/
    Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
    WooCommerce Support: ✔
    
    ### Templates ###
    
    Archive Template: Your theme has a woocommerce.php file
    you will not be able to override the woocommerce/archive-product.php custom template since woocommerce.php has priority over archive-product.php. This is intended to prevent display issues.
    
    Overrides: sixeightfive-commerce/woocommerce/emails/admin-new-order.php version 2.5.0 is out of date. The core version is 3.7.0
    Outdated Templates: ❌
    					
    					
    						Learn how to update
    
    ### Action Scheduler ###
    
    Complete: 6
    Oldest: 2020-02-17 14:25:27 -0500
    Newest: 2020-02-17 14:26:26 -0500
    
    Pending: 0
    Oldest: –
    Newest: –
    
    Canceled: 0
    Oldest: –
    Newest: –
    
    In-progress: 0
    Oldest: –
    Newest: –
    
    Failed: 0
    Oldest: –
    Newest: –
    
    
    Plugin Support Missy a11n

    (@m155y5)

    Automattic Happiness Engineer

    Thanks for sending that, @ndbroughton.

    It’s possible there’s a theme or plugin conflict interfering with the shortcode.

    Here are some troubleshooting steps you can take to test that:

    1.) To begin, please make sure that your theme and all plugins are up to date.

    2.) Try to deactivate all the plugins except for WooCommerce to see if the issue persists. If the problem goes away, re-activate and test each plugin to see if you can determine which plugin the problem originates from.

    3.) If the above does not resolve the issue, try switching your theme to the Storefront theme (https://woocommerce.com/storefront/) and see if it works correctly.

    Plugin Support Missy a11n

    (@m155y5)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please feel free to start a new thread.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Featured Products Not Working’ is closed to new replies.