woocommerce / storefront

Official theme for WooCommerce
https://wordpress.org/themes/storefront/
972 stars 471 forks source link

Product Pagination includes draft items. #1411

Closed mikebronner closed 4 years ago

mikebronner commented 4 years ago

Prerequisites (mark completed items with an [x]):

Describe the bug When duplicating an existing product, and saving it in draft status, so as not to show up in the catalog, it will still appear in the WooCommerce pagination (previous and next links on product pages). It is not showing up in the catalog itself. When clicking on the previous button to access the item (that is in draft mode), we get the expected "Oops, not found." error.

Expected behavior Draft-status products should not show in woo_pagination.

Actual behavior Draft-status products are showing in woo_pagination.

Steps to reproduce the bug (We need to be able to reproduce the bug in order to fix it.) Steps to reproduce the bug:

  1. Create a product, set it to draft status.
  2. Enable WooCommerce pagination in Customization.
  3. Create another product and publish it.
  4. Visit the published product, and notice that the draft product is showing in pagination.

Screenshots

Screen Shot 2020-07-02 at 9 52 59 AM Screen Shot 2020-07-02 at 9 53 13 AM Screen Shot 2020-07-02 at 9 53 57 AM

Isolating the problem (mark completed items with an [x]):

WordPress Environment We use the WooCommerce System Status Report to help us evaluate the issue. Without this report we won't be able to fully evaluate this issue.

``` ### WordPress Environment ### WordPress address (URL): https://imaginethatcomics.com/wordpress Site address (URL): https://imaginethatcomics.com WC Version: 4.1.1 REST API Version: ✔ 1.0.7 WC Blocks Version: ✔ 2.5.16 Action Scheduler Version: ✔ 3.1.6 WC Admin Version: ✔ 1.1.3 Log Directory Writable: ✔ WP Version: ❌ 5.4.1 - There is a newer version of WordPress available (5.4.2) WP Multisite: – WP Memory Limit: 512 MB WP Debug Mode: ✔ WP Cron: – Language: en_US External object cache: – ### Server Environment ### Server Info: nginx/1.17.3 PHP Version: 7.4.0 PHP Post Max Size: 32 MB PHP Time Limit: 300 PHP Max Input Vars: 1000 cURL Version: 7.58.0 OpenSSL/1.1.1d SUHOSIN Installed: – MySQL Version: 8.0.18 Max Upload Size: 32 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 4.1.1 WC Database Prefix: itc_ Total Database Size: 10883.56MB Database Data Size: 10308.83MB Database Index Size: 574.73MB itc_woocommerce_sessions: Data: 4365.95MB + Index: 130.00MB + Engine InnoDB itc_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB itc_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB itc_woocommerce_order_items: Data: 5.52MB + Index: 1.52MB + Engine InnoDB itc_woocommerce_order_itemmeta: Data: 25.55MB + Index: 21.06MB + Engine InnoDB itc_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB itc_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB itc_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB itc_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB itc_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_actionscheduler_actions: Data: 4.02MB + Index: 3.25MB + Engine InnoDB itc_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_actionscheduler_logs: Data: 4.02MB + Index: 2.03MB + Engine InnoDB itc_amazon_accounts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_amazon_btg: Data: 0.20MB + Index: 0.20MB + Engine InnoDB itc_amazon_categories: Data: 0.02MB + Index: 0.03MB + Engine InnoDB itc_amazon_feed_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_amazon_feed_tpl_data: Data: 0.17MB + Index: 0.08MB + Engine InnoDB itc_amazon_feed_tpl_values: Data: 1.34MB + Index: 0.05MB + Engine InnoDB itc_amazon_feeds: Data: 74.06MB + Index: 0.00MB + Engine InnoDB itc_amazon_jobs: Data: 0.13MB + Index: 0.00MB + Engine InnoDB itc_amazon_listings: Data: 6.41MB + Index: 5.25MB + Engine InnoDB itc_amazon_log: Data: 640.92MB + Index: 11.52MB + Engine InnoDB itc_amazon_markets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_amazon_orders: Data: 229.55MB + Index: 0.53MB + Engine InnoDB itc_amazon_payment: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_amazon_profiles: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_amazon_reports: Data: 0.13MB + Index: 0.00MB + Engine InnoDB itc_amazon_shipping: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_amazon_stock_log: Data: 59.58MB + Index: 0.00MB + Engine InnoDB itc_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB itc_comments: Data: 24.55MB + Index: 20.08MB + Engine InnoDB itc_ebay_accounts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_ebay_auctions: Data: 268.58MB + Index: 2.13MB + Engine InnoDB itc_ebay_categories: Data: 2.52MB + Index: 3.03MB + Engine InnoDB itc_ebay_jobs: Data: 0.05MB + Index: 0.00MB + Engine InnoDB itc_ebay_log: Data: 2793.17MB + Index: 12.05MB + Engine InnoDB itc_ebay_messages: Data: 1.52MB + Index: 0.00MB + Engine InnoDB itc_ebay_orders: Data: 327.61MB + Index: 1.52MB + Engine InnoDB itc_ebay_payment: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_ebay_profiles: Data: 0.05MB + Index: 0.00MB + Engine InnoDB itc_ebay_shipping: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_ebay_sites: Data: 0.03MB + Index: 0.00MB + Engine InnoDB itc_ebay_stocks_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_ebay_store_categories: Data: 0.02MB + Index: 0.03MB + Engine InnoDB itc_ebay_transactions: Data: 263.52MB + Index: 4.55MB + Engine InnoDB itc_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_options: Data: 690.45MB + Index: 4.03MB + Engine InnoDB itc_postmark_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_postmeta: Data: 385.94MB + Index: 243.55MB + Engine InnoDB itc_posts: Data: 50.58MB + Index: 18.06MB + Engine InnoDB itc_term_relationships: Data: 10.52MB + Index: 6.50MB + Engine InnoDB itc_term_taxonomy: Data: 0.31MB + Index: 0.34MB + Engine InnoDB itc_termmeta: Data: 0.28MB + Index: 0.36MB + Engine InnoDB itc_terms: Data: 0.28MB + Index: 0.34MB + Engine InnoDB itc_tm_taskmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB itc_tm_tasks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_usermeta: Data: 43.56MB + Index: 52.13MB + Engine InnoDB itc_users: Data: 2.52MB + Index: 4.55MB + Engine InnoDB itc_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_wc_customer_lookup: Data: 2.52MB + Index: 1.91MB + Engine InnoDB itc_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB itc_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB itc_wc_order_product_lookup: Data: 5.52MB + Index: 6.06MB + Engine InnoDB itc_wc_order_stats: Data: 3.52MB + Index: 3.47MB + Engine InnoDB itc_wc_order_tax_lookup: Data: 0.28MB + Index: 0.23MB + Engine InnoDB itc_wc_points_rewards_user_points: Data: 2.52MB + Index: 4.03MB + Engine InnoDB itc_wc_points_rewards_user_points_log: Data: 4.52MB + Index: 4.55MB + Engine InnoDB itc_wc_product_meta_lookup: Data: 2.52MB + Index: 5.11MB + Engine InnoDB itc_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB itc_woocommerce_pinterest: Data: 2.52MB + Index: 0.00MB + Engine InnoDB itc_woocommerce_pinterest_boards_mapping: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_woocommerce_pinterest_google_categories_mapping: Data: 0.02MB + Index: 0.02MB + Engine InnoDB itc_woocommerce_pinterest_google_product_categories: Data: 0.52MB + Index: 0.00MB + Engine InnoDB ### Post Type Counts ### attachment: 33919 customize_changeset: 21 jetpack_migration: 2 nav_menu_item: 1 page: 7 post: 7 product: 18571 revision: 2260 shop_coupon: 751 shop_order: 22619 shop_order_refund: 389 wc_stamps_label: 18833 wcct_countdown: 9 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (39) ### Titan Anti-spam & Security: by CreativeMotion – 7.0.3 Bugsnag Error Monitoring: by Bugsnag Inc. – 1.5.0 Bulk remove posts from category: by MasterNs – 3.0 Comic Importer: by Mike Bronner – 0.2.0 – Installed version not tested with active version of WooCommerce 4.1.1 Cookie Notice: by dFactory – 1.3.2 WooCommerce Coupon Generator: by Jeroen Sormani – 1.1.0 – Installed version not tested with active version of WooCommerce 4.1.1 Disable XML-RPC: by Philip Erb – 1.0.1 Finale - WooCommerce Sales Countdown Timer & Discount Plugin: by XLPlugins – 2.17.1 – Installed version not tested with active version of WooCommerce 4.1.1 Gutenberg: by Gutenberg Team – 7.9.1 Health Check & Troubleshooting: by The WordPress.org community – 1.4.4 Homepage Control: by WooThemes – 2.0.3 Limit Post Titles: by Cocoon Development Ltd – 1.0.2 Order / Coupon / Subscription Export Import Plugin for WooCommerce (BASIC): by WebToffee – 1.6.5 Postmark (Official): by Andrew Yates & Matt Gibbs – 1.12.4 Storefront Footer Bar: by WooThemes – 1.0.4 Storefront Hamburger Menu: by WooCommerce – 1.2.2 Storefront Powerpack: by WooCommerce – 1.4.15 Storefront Product Sharing: by WooCommerce – 1.0.6 Storefront Reviews: by WooCommerce – 1.0.4 – Installed version not tested with active version of WooCommerce 4.1.1 Title Remover: by WPGurus – 1.2.1 WP Twitter Auto Publish: by xyzscripts.com customized by Mike Bronner (GeneaLabs) for Imagine That! Comics – 999-custom User Role Editor: by Vladimir Garagulya – 4.54 User Switching: by John Blackbourn & contributors – 1.5.4 Product Customer List for WooCommerce: by Kokomo – 2.9.2 – Installed version not tested with active version of WooCommerce 4.1.1 WooCommerce Conditional Shipping and Payments: by SomewhereWarm – 1.8.0 Woocommerce Customizations: by Mike Bronner – 1.0.0 – Installed version not tested with active version of WooCommerce 4.1.1 WooCommerce Stripe Gateway: by WooCommerce – 4.4.0 – Installed version not tested with active version of WooCommerce 4.1.1 WooCommerce Google Analytics Integration: by WooCommerce – 1.4.21 WooCommerce MSRP Pricing: by Ademti Software Ltd. – 2.9.12 – Installed version not tested with active version of WooCommerce 4.1.1 WooCommerce PDF Invoices & Packing Slips: by Ewout Fernhout – 2.4.10 Pinterest for WooCommerce: by premmerce – 2.1.3 WooCommerce Points and Rewards: by WooCommerce – 1.6.18 – Installed version not tested with active version of WooCommerce 4.1.1 WooCommerce Shipment Tracking: by WooCommerce – 1.6.22 WooCommerce Stamps.com API integration: by WooCommerce – 1.3.18 WooCommerce: by Automattic – 4.1.1 (update to version 4.2.2 is available) WP-Lister Pro for Amazon: by WP Lab – 1.5.1 – Installed version not tested with active version of WooCommerce 4.1.1 WP-Lister Pro for eBay: by WP Lab – 2.5.2 – Installed version not tested with active version of WooCommerce 4.1.1 WP-Optimize - Clean, Compress, Cache: by David Anderson Ruhani Rabin Team Updraft – 3.0.19 Remove WooCommerce Connect Your Store Notice: by WPspring – 1.0.2 – Installed version not tested with active version of WooCommerce 4.1.1 ### Inactive Plugins (2) ### Query Monitor: by John Blackbourn – 3.6.0 Storefront Product Pagination: by WooThemes – 1.2.4 – Installed version not tested with active version of WooCommerce 4.1.1 ### Dropin Plugins (1) ### advanced-cache.php: advanced-cache.php ### Must Use Plugins (1) ### autoload.php: by – ### Settings ### API Enabled: ✔ Force SSL: ✔ Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) 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: #4 - / Cart: #5 - /cart/ Checkout: #6 - /checkout/ My account: #7 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Bookshop Version: 1.0.15 Author URL: https://woocommerce.com Child Theme: ✔ Parent Theme Name: Storefront Parent Theme Version: 2.5.6 – 2.5.7 is available Parent Theme Author URL: https://woocommerce.com/ WooCommerce Support: ✔ ### Templates ### Overrides: – ### Action Scheduler ### Complete: 11,922 Oldest: 2020-06-01 09:55:07 -0700 Newest: 2020-07-02 09:54:58 -0700 Failed: 2 Oldest: 2019-02-20 07:01:23 -0700 Newest: 2019-02-20 07:02:13 -0700 Pending: 1 Oldest: 2020-07-03 10:22:26 -0700 Newest: 2020-07-03 10:22:26 -0700 ```
haszari commented 4 years ago

Thanks for reporting this @mikebronner !

I've reproduced the issue on my test site.

Screen Shot 2020-07-03 at 12 00 46 PM

Linking in some other issues related to paging through products: #983 #1340 #1375