• Resolved Tobija

    (@tobija)


    Sometimes after a variation of a variable product is purchased, the product shows the following message on the frontend and can not be ordered anymore:

    This product is currently out of stock and unavailable.

    Stock Management is enabled in Woocommerce Settings, and every single product variant contains the following necessary information:

    • Enabled checked
    • Manage Stock? checked
    • a Regular price set
    • Stock quantity is more than 0 (like 100 or sth)

    So nowhere is a hint that the product might be out of stock. The Stock column on the All Products listing is also green and shows the correct values.

    I searched inside the database but i could not find a single difference compared to variable products that display correctly. Main focus was on the following tables: wp_posts, wp_postmeta, wp_wc_product_meta_lookup, wp_wc_product_attributes_lookup

    The problem seems to be that woocommerce can not get any information on the product variations for the affected products. In the .variations_form element, the data-attribute data-product_variations is equal to an empty array (data-product_variations=”[]”).

    When going into the responsible code file (/plugins/woocommerce/includes/class-wc-product-variable.php) and looking at the function get_available_variations, I can log that the get_children() function returns an empty array and that the has_child() function returns false (while is_type(‘variable’) ist still true, as it should be).

    // around line 300
    /**
    	 * Get an array of available variations for the current product.
    	 *
    	 * @param string $return Optional. The format to return the results in. Can be 'array' to return an array of variation data or 'objects' for the product objects. Default 'array'.
    	 *
    	 * @return array[]|WC_Product_Variation[]
    	 */
    	public function get_available_variations( $return = 'array' ) {
    		if( $this->is_type('variable') ) {
    			$children_ids = $this->get_children();
    			if(empty($children_ids)) {
    					if(!$this->has_child()) {
    							echo 'The product has no children'; // THIS GETS LOGGED
    					}
    					else {
    							echo 'The product has children but they are not visible or not synced properly';
    					}
    			} else {
    					echo 'Children IDs: ' . implode(', ', $children_ids);
    			}
    		} else {
    				echo 'The product is not a variable product';
    		}

    The error can not be reproduced consistently but still occurs on quite a regular basis. That’s the reason why it’s really hard to debug and I can still not completely rule out a plugin/theme conflict. But when the error triggers and the product shows the “out of stock” message, I can switch to storefront theme and disable all plugins except woocommerce and the product still shows as out of stock.

    So my question for now is:
    There needs to be some sort of traceability when having every plugin disabled and using the default theme that allows me to see, what differentiates the out of stock product from a product that displays correctly. Is there a caching layer I need to check? or did I miss a database table that would contain the necessary information.

    Thank’s in advance for helping out. After spending around 15 hours researching and debugging this issue, I’m quite frustrated as you can imagine.

    System report:

    ` WordPress Environment
    
    WordPress address (URL): https://testing.haltbarmacherei.ch<br>Site address (URL): https://testing.haltbarmacherei.ch<br>WC Version: 8.0.1<br>REST API Version: ✔ 8.0.1<br>WC Blocks Version: ✔ 10.6.5<br>Action Scheduler Version: ✔ 3.6.1<br>Log Directory Writable: ✔<br>WP Version: 6.3<br>WP Multisite: –<br>WP Memory Limit: 256 MB<br>WP Debug Mode: –<br>WP Cron: ✔<br>Language: de_DE<br>External object cache: – Server Environment
    
    Server Info: Apache<br>PHP Version: 8.2.8<br>PHP Post Max Size: 256 MB<br>PHP Time Limit: 60<br>PHP Max Input Vars: 200000<br>cURL Version: 8.1.2<br>NSS/3.79
    
    SUHOSIN Installed: –<br>MySQL Version: 10.6.14-MariaDB<br>Max Upload Size: 256 MB<br>Default Timezone is UTC: ✔<br>fsockopen/cURL: ✔<br>SoapClient: ✔<br>DOMDocument: ✔<br>GZip: ✔<br>Multibyte String: ✔<br>Remote Post: ✔<br>Remote Get: ✔ Database
    
    WC Database Version: 8.0.1<br>WC Database Prefix: 1qVcX6wgl_<br>Total Database Size: 35.03MB<br>Database Data Size: 25.55MB<br>Database Index Size: 9.48MB<br>1qVcX6wgl_woocommerce_sessions: Data: 0.06MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_order_items: Data: 0.17MB + Index: 0.06MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_order_itemmeta: Data: 1.52MB + Index: 3.03MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_actionscheduler_actions: Data: 0.19MB + Index: 0.19MB + Engine InnoDB<br>1qVcX6wgl_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_actionscheduler_logs: Data: 0.16MB + Index: 0.13MB + Engine InnoDB<br>1qVcX6wgl_cmeb_email_list: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_cmeb_free_domains: Data: 0.13MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_cmeb_userlist: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_comments: Data: 0.31MB + Index: 0.09MB + Engine InnoDB<br>1qVcX6wgl_db7_forms: Data: 0.06MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_gglcptch_allowlist: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_gla_attribute_mapping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_gla_budget_recommendations: Data: 0.22MB + Index: 0.14MB + Engine InnoDB<br>1qVcX6wgl_gla_merchant_issues: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_gla_shipping_rates: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>1qVcX6wgl_gla_shipping_times: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_imagify_files: Data: 0.06MB + Index: 0.08MB + Engine InnoDB<br>1qVcX6wgl_imagify_folders: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_options: Data: 2.20MB + Index: 0.20MB + Engine InnoDB<br>1qVcX6wgl_postmeta: Data: 3.42MB + Index: 2.98MB + Engine InnoDB<br>1qVcX6wgl_posts: Data: 14.52MB + Index: 0.23MB + Engine InnoDB<br>1qVcX6wgl_redirection_404: Data: 0.16MB + Index: 0.08MB + Engine InnoDB<br>1qVcX6wgl_redirection_groups: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_redirection_items: Data: 0.02MB + Index: 0.09MB + Engine InnoDB<br>1qVcX6wgl_redirection_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>1qVcX6wgl_rm_fields: Data: 0.13MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_forms: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_front_users: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_login: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_login_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_paypal_fields: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_paypal_logs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_rows: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_sent_mails: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_sessions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_stats: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_submissions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_submission_fields: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_tabs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_tasks: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_rm_task_exe_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_usermeta: Data: 0.31MB + Index: 0.31MB + Engine InnoDB<br>1qVcX6wgl_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>1qVcX6wgl_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_wcpdf_packing_slip_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_wc_admin_notes: Data: 0.09MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_wc_admin_note_actions: Data: 0.08MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_wc_orders: Data: 0.02MB + Index: 0.11MB + Engine InnoDB<br>1qVcX6wgl_wc_orders_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_wc_order_addresses: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>1qVcX6wgl_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_wc_order_operational_data: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_wc_order_product_lookup: Data: 0.19MB + Index: 0.27MB + Engine InnoDB<br>1qVcX6wgl_wc_order_stats: Data: 0.06MB + Index: 0.05MB + Engine InnoDB<br>1qVcX6wgl_wc_order_tax_lookup: Data: 0.05MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB<br>1qVcX6wgl_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>1qVcX6wgl_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_yoast_indexable: Data: 0.08MB + Index: 0.09MB + Engine InnoDB<br>1qVcX6wgl_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>1qVcX6wgl_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>1qVcX6wgl_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>1qVcX6wgl_yoast_seo_links: Data: 0.02MB + Index: 0.03MB + Engine InnoDB Post Type Counts
    
    attachment: 79<br>b2bking_custom_role: 2<br>b2bking_group: 1<br>custom_css: 2<br>et_body_layout: 7<br>et_footer_layout: 1<br>et_header_layout: 1<br>et_pb_layout: 2<br>et_template: 16<br>et_theme_builder: 1<br>filter-field: 2<br>filter-set: 1<br>is_search_form: 1<br>nav_menu_item: 6<br>oembed_cache: 2<br>page: 13<br>post: 2<br>product: 38<br>product_variation: 44<br>revision: 456<br>shop_coupon: 3<br>shop_order: 275<br>wp_global_styles: 1<br>wpcf7_contact_form: 2<br>yith-wcbm-badge: 3 Security
    
    Secure connection (HTTPS): ✔<br>Hide errors from visitors: ✔ Active Plugins (25)
    
    Query Monitor: by John Blackbourn – 3.13.1<br>Product Stock Manager: by Addify – 1.0.5<br>Ban Hammer: by Mika Epstein – 3.1.2<br>Blackhole for Bad Bots: by Jeff Starr – 3.6<br>Cancel order request for WooCommerce: by PI Websolution – 1.3.3.13<br>Conditional Fields for Contact Form 7: by Jules Colle – 2.3.10<br>CF7 to Webhook: by Mário Valney – 2.3.0<br>Contact Form 7: by Takayuki Miyoshi – 5.8<br>Contact Form CFDB7: by Arshid – 1.2.6.7<br>Exclude Image Thumbnails From UpdraftPlus Backups: by Dream-Encode – 1.0.3<br>Filter Everything — WooCoomerce Product & WordPress Filter: by Andrii Stepasiuk – 1.7.15<br>reCaptcha by BestWebSoft: by BestWebSoft – 1.72<br>Google Listings and Ads: by WooCommerce – 2.5.2<br>Imagify: by Imagify – Optimize Images & Convert WebP – 2.1.1<br>Kadence WooCommerce Email Designer: by Kadence WP – 1.5.11<br>Loco Translate: by Tim Whitlock – 2.6.4<br>Redirection: by John Godley – 5.3.10<br>UpdraftPlus - Backup/Restore: by UpdraftPlus.Com<br>DavidAnderson – 1.23.9
    
    WP Menu Cart: by WP Overnight – 2.14.1<br>PDF Invoices & Packing Slips for WooCommerce: by WP Overnight – 3.5.6<br>WooCommerce: by Automattic – 8.0.1<br>Yoast SEO: by Team Yoast – 20.13<br>Custom Product Tabs for WooCommerce: by YIKES<br>Inc. – 1.8.4
    
    YITH WooCommerce Badge Management: by YITH – 2.19.0<br>zahls.ch Credit Cards, PostFinance and TWINT for WooCommerce: by siebenberge gmbh – 1.2.4 Inactive Plugins (4)
    
    All-in-One WP Migration: by ServMask – 7.77<br>All-in-One WP Migration Unlimited Extension: by ServMask – 2.52<br>WooCommerce Wholesale Prices: by Rymera Web Co – 2.1.8<br>WooCommerce Wholesale Prices Premium: by Rymera Web Co – 1.30.3 Dropin Plugins (1)
    
    db.php: Query Monitor Database Class (Drop-in) Settings
    
    API Enabled: ✔<br>Force SSL: –<br>Currency: CHF (CHF)<br>Currency Position: left_space<br>Thousand Separator: '<br>Decimal Separator: .<br>Number of Decimals: 2<br>Taxonomies: Product Types: external (external)<br>grouped (grouped)<br>simple (simple)<br>variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)<br>exclude-from-search (exclude-from-search)<br>featured (featured)<br>outofstock (outofstock)<br>rated-1 (rated-1)<br>rated-2 (rated-2)<br>rated-3 (rated-3)<br>rated-4 (rated-4)<br>rated-5 (rated-5)
    
    Connected to WooCommerce.com: ✔<br>Enforce Approved Product Download Directories: ✔<br>HPOS feature screen enabled: –<br>HPOS feature enabled: –<br>Order datastore: WC_Order_Data_Store_CPT<br>HPOS data sync enabled: – WC Pages
    
    Shop base: #22 - /shop/<br>Cart: #23 - /warenkorb/<br>Checkout: #24 - /kasse/<br>My account: #25 - /mein-konto/<br>Terms and conditions: #391 - /agb/ Theme
    
    Name: haltbarmacherei<br>Version: 4.17.3.1651764343<br>Author URL:<br>Child Theme: ✔<br>Parent Theme Name: Divi<br>Parent Theme Version: 4.22.0<br>Parent Theme Author URL: http://www.elegantthemes.com<br>WooCommerce Support: ✔ Templates
    
    Overrides: – Admin
    
    Enabled Features: activity-panels<br>analytics<br>product-block-editor<br>coupons<br>core-profiler<br>customer-effort-score-tracks<br>import-products-task<br>experimental-fashion-sample-products<br>shipping-smart-defaults<br>shipping-setting-tour<br>homescreen<br>marketing<br>mobile-app-banner<br>navigation<br>onboarding<br>onboarding-tasks<br>remote-inbox-notifications<br>remote-free-extensions<br>payment-gateway-suggestions<br>shipping-label-banner<br>subscriptions<br>store-alerts<br>transient-notices<br>woo-mobile-welcome<br>wc-pay-promotion<br>wc-pay-welcome-page
    
    Disabled Features: minified-js<br>new-product-management-experience<br>product-variation-management<br>settings<br>async-product-editor-category-field
    
    Daily Cron: ✔ Next scheduled: 2023-08-15 07:19:36 +02:00<br>Options: ✔<br>Notes: 148<br>Onboarding: completed Action Scheduler
    
    Complete: 496<br>Oldest: 2023-07-15 04:04:38 +0200<br>Newest: 2023-08-14 21:04:42 +0200
    
    Failed: 5<br>Oldest: 2023-01-25 10:08:06 +0100<br>Newest: 2023-06-02 11:36:58 +0200
    
    Pending: 2<br>Oldest: 2023-08-15 05:14:47 +0200<br>Newest: 2023-08-15 17:14:52 +0200 Status report information
    
    Generated at: 2023-08-14 21:15:44 +02:00<br>`
    • This topic was modified 1 year, 7 months ago by Tobija.

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

Viewing 15 replies - 16 through 30 (of 37 total)
  • I’m getting something similar yet different, though I feel it’s pretty much the same issue (eventually) as everyone else is having.

    For one of my clients, this is the 2nd week in a row (always on a Friday too..), that suddenly there is Fatal Error on one of the archive pages / any page that has any sort of archive component in it (i.e a slider with best selling products on HP).

    Now, when it first happened I tried many leads but even when I fixed it I wasn’t sure what was the cause.

    Basically, today I went straight to one of the last steps I took which was, finding the “problematic” product, editing and simply hitting “update” without really doing any change.

    I assume this somehow re-generates the variation however I’m not sure why they get the issue to begin with.

    Important to note that we are not talking about newly added products or something, simply the regular old products..

    I thought maybe this could give a lead to anyone searching for the actual issue as none of my explorings were successful… There is simply nothing wrong, as it seems.

    • This reply was modified 1 year, 4 months ago by talukio.
    Thread Starter Tobija

    (@tobija)

    Regarding object caches:
    I currently don’t use any external caching solution on the affected page. As far as I’m concerned, Divi does some caching by default, but since I managed to reproduce the error without Divi Theme active, I don’t think that’s related. Either way, I always tried to regularly clear all caches during testing.

    @talukio Yeah, seems somewhat related in that resaving the product fixes the issue. I think it would be really helpful to have an overview over the things that happen when resaving a product (in terms of the caches cleared, DB entries rewritten, hooks exposed to plugin developers, and so on). This way, we at least knew all the placed to look more closely. Of course I know, that there are quite complex things going on, especially when external plugins come into the mix.

    Thread Starter Tobija

    (@tobija)

    For me personally, I think the logical next step would be to setup a brand new dev env where I thoroughly test the issue by automating the process of placing orders. Since the error is really unreliable, that is the only way for me to test the issue at scale. But I don’t know, when I’ll get around to set that up.

    Does anyone of you have experience with automated testing in WordPress / WooCommerce? Are there tools or services that make it easier?

    Saif

    (@babylon1999)

    Hello @jdarbuckle @tobija,

    Thank you so much for the detailed explanation here!

    I’ve been trying to replicate this issue with a few test sites/configurations, but under no circumstance did the product variation go out of stock.

    I see you mention in the same doc that you were able to replicate it on a fresh installation of WooCommerce by importing a CSV file from the broken site. Could you please share more details about this along with the CSV file itself?

    Any additional feedback you can provide on this matter is highly appreciated!

    Does anyone of you have experience with automated testing in WordPress / WooCommerce? Are there tools or services that make it easier?

    Here are a few tools that can help, you can find more in the WooCommerce repository. :‎)

    https://github.com/woocommerce/wc-smooth-generator

    https://github.com/woocommerce/woocommerce-gateway-dummy

    Look forward to hearing back from you.

    @tobija – Were you using Object Cache? I WAS on the build where this happened twice, and I’ve officially disabled it. There is another thread on this topic where someone has brought that up as a potential issue again.

    @babylon1999 – I’ll have to return to this unfortunately, pretty in the weeds right now… But it will certainly become the highest priority if it happens again on a live site! I’ll return to my document and try and get you to that stripped down build where it happens 100% of time time. But same question to you, were you using Object Cache on that particular build? Might be an interesting common thread.

    • This reply was modified 1 year, 4 months ago by jdarbuckle.

    Hi there @jdarbuckle 👋

    I’ll have to return to this unfortunately, pretty in the weeds right now… But it will certainly become the highest priority if it happens again on a live site! I’ll return to my document and try and get you to that stripped down build where it happens 100% of time time. But same question to you, were you using Object Cache on that particular build? Might be an interesting common thread.

    Do let us know how it goes please, when you find some time to look into it again.

    In my own testing, where I also could not reproduce, Object Caching is set like so object-cache.php: Memcached.

    I hope that helps!

    Thread Starter Tobija

    (@tobija)

    Hi everyone

    After a long period of hoping that this bug would hopefully be fixed in a newer version, I have to come back to this. Unfortunately this is still a problem for my client.

    I’m now in the process of setting up a dev environment where I can automatically create orders so that I can test it on a large scale (as I still can’t reproduce the problem consistently). I will only be using WordPress, WooCommerce and the one WooCommerce plugin that I suspect is involved in this bug (WooCommerce Wholesale Prices). I’ll keep you updated with any new findings. I don’t think this is a core WooCommerce problem that would occur without any other parts (like plugins) interfering. (That’s why I’m happy to leave this thread marked as resolved).

    • This reply was modified 10 months, 4 weeks ago by Tobija.

    @tobija Are you using an object cache via a plugin or your hosting provider?

    Thread Starter Tobija

    (@tobija)

    @jdarbuckle No, I am not. Did disabling object cache solve the issue for you?

    @tobija Bummer. I mean I haven’t had it since. It was just a common thread I had put together across a couple different support forums. Was worth a shot 🙂

    Thread Starter Tobija

    (@tobija)

    @jdarbuckle It certainly was. Thank you so much for reaching out and trying to help. Glad to hear you haven’t had the problem since.

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @tobija,

    Thanks for the update. Please keep us posted with the tests on the staging site. We’re here to help in any way we can. You can also continue using the doc file to keep track of what’s been done.

    Thanks!
    -OP

    I’d love some updates on this as I have a client with the same issue, however using Elementor. In our case though the “Add to cart”-button simply and randomly disappears, and there is no “Out of stock message” like there normally is. The variations array is empty though.

    The common denominator that lead me here though is that updating the product without any changes fixes the issue. It is not consistent among products and we have not been able to recreate it manually.

    Since this is a big shop with hundreds of products and it’s happening on a live site, I wrote a Python script that checks all product pages HTML for the “Add to cart”-button element and reports back the URL:s where it’s missing, so we can find and update the products daily, but of course it’s a hassle. I tried automating it by having the script run every 5 minutes for a day or so, and was able to catch a window of when it happened with a five minute interval twice, but what’s really strange is that these were not products that had been bought recently or within the time frame. The variants are simply not loading.

    The reason for the Python script was I wanted to use this time frame to check access logs and possibly database logs, but since this build is on shared hosting our hosting provider is saying we can’t have logging turned on for more than a few minutes because it would take up too much resources. I guess that kind of logging on their end is server-wide so it’s logging for all or no one, in which case it makes sense they can’t have it on by default or for a longer period of time.

    The only common thing I have found in this very interesting thread so far is that my client is also using WooCommerce Wholesale Prices. Did you get anywhere with those tests @tobija ?

    One thing I am investigating is WP Cron and cron jobs in general because for us the two times I have been able to catch it happening has been on Mondays around lunch, but using WP Crontrol I have not been able to identify anything that seems related to that so it might just be a coincidence so far, and there are no cron jobs set up at the server level either.

    Thanks!

    • This reply was modified 7 months, 2 weeks ago by ispjstfu.
    • This reply was modified 7 months, 2 weeks ago by ispjstfu.

    Hi @ispjstfu,

    Sorry to hear that you are experiencing the same issue. However, to align with forum best practices, please create a new topic so that we can address your issue(s) separately.

    You can create a new thread here: https://wordpress.org/support/plugin/woocommerce/#new-topic-0

    Thanks for understanding!

    Sorry, I just wanted an update from the people who have talked about it here since I won’t be able to tag them in a new topic. It is too much work going over it all again so we’ll just leave it and continue on updating the affected products I guess.

    Thanks

    • This reply was modified 7 months, 2 weeks ago by ispjstfu.
Viewing 15 replies - 16 through 30 (of 37 total)
  • You must be logged in to reply to this topic.