Critical error on single product page
-
My website started showing this strange error recently which I have been unable to resolve. When I try to view a product, it returns a critical error.
I’ve done some troubleshooting and I realized the theme is the culprit. I have also checked the error log and I saw that this specific line of code is causing the error:
Uncaught Error: Call to a member function is_in_stock() on string in /home/u306409103/domains/apdbrestore.com/public_html/wp-content/themes/custom-theme/woocommerce/single-product.php:45 Stack trace: #0
When you check that line, it says:
<?php if( !$product->is_in_stock() ) : ?> <div class="outofstock"> <img src="<?php echo imgfolder('out-of-stock.png'); ?>" alt="Out of Stock"> </div> <?php endif; ?>
To be specific the error is pointing towards the first line:
<?php if( !$product->is_in_stock() ) : ?>
I know the problem is coming from here but don’t know what next to do. What statement can I use here to do away with this error?
Thanks
The page I need help with: [log in to see the link]
-
Hi @nas9286
Thank you for reaching out!
The error seems to be generated from your theme.
In order for us to get a better understanding of your site setup, could you please share a copy of your website’s System Status Report?
You can get it by navigating to the
WooCommerce / Status
section of your site. Once there, click on theGet system report
button and then copy it by clicking on theCopy for support
button. Then paste it here in a comment.Thanks for your response. Here is the system status:
### WordPress Environment ### WordPress address (URL): https://apdbrestore.com Site address (URL): https://apdbrestore.com WC Version: 6.9.3 REST API Version: ? 6.9.3 WC Blocks Version: ? 8.3.2 Action Scheduler Version: ? 3.4.0 Log Directory Writable: ? WP Version: 6.0.2 WP Multisite: – WP Memory Limit: 2 GB WP Debug Mode: – WP Cron: ? Language: en_US External object cache: – ### Server Environment ### Server Info: LiteSpeed PHP Version: 8.0.23 PHP Post Max Size: 512 MB PHP Time Limit: 120 PHP Max Input Vars: 5000 cURL Version: 7.71.0 OpenSSL/1.1.1d SUHOSIN Installed: – MySQL Version: 10.5.12-MariaDB-cll-lve Max Upload Size: 512 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 6.9.3 WC Database Prefix: wp_ Total Database Size: 92.14MB Database Data Size: 74.50MB Database Index Size: 17.64MB wp_woocommerce_sessions: Data: 0.08MB + Index: 0.00MB + 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.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_order_itemmeta: Data: 0.00MB + Index: 0.01MB + 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_actionscheduler_actions: Data: 2.52MB + Index: 0.77MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 1.52MB + Index: 0.34MB + Engine InnoDB wp_aepc_custom_audiences: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_aepc_logs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_aioseo_cache: Data: 0.16MB + Index: 0.03MB + Engine InnoDB wp_aioseo_notifications: Data: 0.06MB + Index: 0.06MB + Engine InnoDB wp_aioseo_posts: Data: 0.14MB + Index: 0.02MB + Engine InnoDB wp_bulkgate_module: Data: 0.06MB + Index: 0.00MB + Engine InnoDB wp_cl_abandon_cart: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_cl_campaign_history: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_cl_email_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.13MB + Index: 0.09MB + Engine InnoDB wp_duplicator_pro_entities: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_duplicator_pro_packages: Data: 0.14MB + Index: 0.02MB + Engine InnoDB wp_e_events: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_fsmpt_email_logs: Data: 0.17MB + Index: 0.00MB + Engine InnoDB wp_gf_addon_feed: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_gf_draft_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_gf_entry: Data: 0.08MB + Index: 0.03MB + Engine InnoDB wp_gf_entry_meta: Data: 0.25MB + Index: 0.22MB + Engine InnoDB wp_gf_entry_notes: Data: 0.08MB + Index: 0.03MB + Engine InnoDB wp_gf_form: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gf_form_meta: Data: 0.08MB + Index: 0.00MB + Engine InnoDB wp_gf_form_revisions: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_form_view: Data: 0.14MB + Index: 0.13MB + Engine InnoDB wp_gf_rest_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gglcptch_allowlist: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_hustle_entries: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_hustle_entries_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_hustle_modules: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_hustle_modules_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_hustle_tracking: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailchimp_carts: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mailchimp_jobs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mainwp_stream: Data: 0.23MB + Index: 0.48MB + Engine InnoDB wp_mainwp_stream_meta: Data: 1.52MB + Index: 0.84MB + Engine InnoDB wp_mo_openid_linked_user: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_options: Data: 54.39MB + Index: 9.05MB + Engine InnoDB wp_postmeta: Data: 4.52MB + Index: 2.94MB + Engine InnoDB wp_posts: Data: 1.52MB + Index: 0.31MB + Engine InnoDB wp_rank_math_internal_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_rank_math_internal_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_smsalert_booking_reminder: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_smsalert_renewal_reminders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_sms_send: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_sms_subscribes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_sms_subscribes_group: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_smush_dir_images: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_tm_taskmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_tm_tasks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_usermeta: Data: 0.16MB + Index: 0.06MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_user_registration_sessions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_admin_notes: Data: 0.04MB + Index: 0.00MB + Engine MyISAM wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.01MB + Engine MyISAM wp_wc_category_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine MyISAM wp_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_coupon_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_product_lookup: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_order_stats: Data: 0.02MB + Index: 0.03MB + Engine MyISAM wp_wc_order_tax_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.01MB + Index: 0.02MB + Engine MyISAM wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB 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.02MB + Index: 0.00MB + Engine InnoDB wp_wfblocks7: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wfconfig: Data: 1.52MB + Index: 0.00MB + Engine InnoDB wp_wfcrawlers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wffilechanges: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wffilemods: Data: 0.23MB + Index: 0.00MB + Engine InnoDB wp_wfhits: Data: 0.06MB + Index: 0.05MB + Engine InnoDB wp_wfhoover: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wfknownfilelist: Data: 2.52MB + Index: 0.00MB + Engine InnoDB wp_wflivetraffichuman: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wflocs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wflogins: Data: 0.02MB + Index: 0.03MB + Engine InnoDB 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 InnoDB wp_wfpendingissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wfreversecache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfsnipcache: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wfstatus: Data: 0.13MB + Index: 0.09MB + Engine InnoDB wp_wftrafficrates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpfm_backup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wpvivid_options: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wsal_metadata: Data: 0.23MB + Index: 0.33MB + Engine InnoDB wp_wsal_occurrences: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_yoast_indexable: Data: 0.36MB + Index: 0.30MB + Engine InnoDB wp_yoast_indexable_hierarchy: Data: 0.06MB + Index: 0.05MB + Engine InnoDB wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_yoast_seo_links: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_yoast_seo_meta: Data: 0.09MB + Index: 0.00MB + Engine InnoDB ### Post Type Counts ### acf-field: 179 acf-field-group: 14 acoplw_badges: 1 acoplw_prod_list: 1 attachment: 505 awl-labels: 1 careers: 12 careers-list: 1 custom_css: 2 customize_changeset: 21 elementor_library: 1 faqs: 6 galleries: 2 nav_menu_item: 18 oceanwp_library: 1 oembed_cache: 7 page: 29 post: 13 product: 74 product_variation: 2 products: 12 restorations: 18 revision: 42 services: 3 shop_coupon: 1 shop_order: 358 testimonials: 2 user_registration: 1 wcs_ruleset: 1 wp_global_styles: 1 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (22) ### ACF to REST API: by Aires Gon?alves – 3.3.3 WooCommerce added to cart popup (Ajax): by XootiX – 1.5 Advanced Custom Fields PRO: by Delicious Brains – 5.10.2 All in One SEO: by All in One SEO Team – 4.2.5.1 Better REST API Featured Images: by Braad Martin – 1.2.1 Cart Lift - Abandoned Cart Recovery for WooCommerce and EDD: by RexTheme – 3.1.3 Elementor: by Elementor.com – 3.7.7 Facebook Chat Plugin - Live Chat Plugin for WordPress: by Meta – 2.5 Flexible Shipping: by Octolize – 4.14.1 FluentSMTP: by FluentSMTP & WPManageNinja Team – 2.2.0 Gravity Forms: by Gravity Forms – 2.6.7 CAOS: by Daan from Daan.dev – 4.4.4 Kadence WooCommerce Email Designer: by Kadence WP – 1.5.6 Ocean Extra: by OceanWP – 2.0.4 Super Socializer: by Team Heateor – 7.13.38 User Registration: by WPEverest – 2.2.2 Payments via PayMongo for WooCommerce: by CynderTech – 1.10.0 Checkout Field Editor for WooCommerce: by ThemeHigh – 1.7.2 WooCommerce Google Analytics Integration: by WooCommerce – 1.5.14 WooCommerce: by Automattic – 6.9.3 WP Fastest Cache: by Emre Vona – 1.0.5 WPS Hide Login: by WPServeur NicolasKulka wpformation – 1.9.6 ### Inactive Plugins (2) ### User Role Editor: by Vladimir Garagulya – 4.63.1 WooCommerce Product Add-ons: by WooCommerce – 4.9.0 ### Settings ### API Enabled: – Force SSL: – Currency: PHP (?) 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: – Enforce Approved Product Download Directories: – ### WC Pages ### Shop base: #7 - /shop-2/ Cart: #3640 - /cart-2/ Checkout: #9 - /checkout-2/ My account: #3641 - /my-account-3/ Terms and conditions: #679 - /terms-conditions/ ### Theme ### Name: WordPress Theme Version: 2.0 Author URL: https://www.sytian-productions.com/ 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 ### Overrides: custom-theme/woocommerce/archive-product.php custom-theme/woocommerce/auth/footer.php custom-theme/woocommerce/auth/form-grant-access.php custom-theme/woocommerce/auth/form-login.php custom-theme/woocommerce/auth/header.php custom-theme/woocommerce/cart/cart-empty.php custom-theme/woocommerce/cart/cart-item-data.php custom-theme/woocommerce/cart/cart-shipping.php custom-theme/woocommerce/cart/cart-totals.php custom-theme/woocommerce/cart/cart.php custom-theme/woocommerce/cart/cross-sells.php custom-theme/woocommerce/cart/mini-cart.php custom-theme/woocommerce/cart/proceed-to-checkout-button.php custom-theme/woocommerce/cart/shipping-calculator.php custom-theme/woocommerce/checkout/cart-errors.php custom-theme/woocommerce/checkout/form-billing.php custom-theme/woocommerce/checkout/form-checkout.php custom-theme/woocommerce/checkout/form-coupon.php custom-theme/woocommerce/checkout/form-login.php custom-theme/woocommerce/checkout/form-pay.php custom-theme/woocommerce/checkout/form-shipping.php custom-theme/woocommerce/checkout/order-receipt.php custom-theme/woocommerce/checkout/payment-method.php custom-theme/woocommerce/checkout/payment.php custom-theme/woocommerce/checkout/review-order.php custom-theme/woocommerce/checkout/terms.php custom-theme/woocommerce/checkout/thankyou.php custom-theme/woocommerce/content-product.php custom-theme/woocommerce/content-single-product.php custom-theme/woocommerce/content-widget-price-filter.php custom-theme/woocommerce/content-widget-product.php custom-theme/woocommerce/content-widget-reviews.php custom-theme/woocommerce/emails/admin-cancelled-order.php custom-theme/woocommerce/emails/admin-failed-order.php custom-theme/woocommerce/emails/admin-new-order.php custom-theme/woocommerce/emails/customer-completed-order.php custom-theme/woocommerce/emails/customer-invoice.php custom-theme/woocommerce/emails/customer-new-account.php custom-theme/woocommerce/emails/customer-note.php custom-theme/woocommerce/emails/customer-on-hold-order.php custom-theme/woocommerce/emails/customer-processing-order.php custom-theme/woocommerce/emails/customer-refunded-order.php custom-theme/woocommerce/emails/customer-reset-password.php custom-theme/woocommerce/emails/email-addresses.php custom-theme/woocommerce/emails/email-customer-details.php custom-theme/woocommerce/emails/email-downloads.php custom-theme/woocommerce/emails/email-footer.php custom-theme/woocommerce/emails/email-header.php custom-theme/woocommerce/emails/email-order-details.php custom-theme/woocommerce/emails/email-order-items.php custom-theme/woocommerce/emails/email-styles.php custom-theme/woocommerce/emails/plain/admin-cancelled-order.php custom-theme/woocommerce/emails/plain/admin-failed-order.php custom-theme/woocommerce/emails/plain/admin-new-order.php custom-theme/woocommerce/emails/plain/customer-completed-order.php custom-theme/woocommerce/emails/plain/customer-invoice.php custom-theme/woocommerce/emails/plain/customer-new-account.php custom-theme/woocommerce/emails/plain/customer-note.php custom-theme/woocommerce/emails/plain/customer-on-hold-order.php custom-theme/woocommerce/emails/plain/customer-processing-order.php custom-theme/woocommerce/emails/plain/customer-refunded-order.php custom-theme/woocommerce/emails/plain/customer-reset-password.php custom-theme/woocommerce/emails/plain/email-addresses.php custom-theme/woocommerce/emails/plain/email-customer-details.php custom-theme/woocommerce/emails/plain/email-downloads.php custom-theme/woocommerce/emails/plain/email-order-details.php custom-theme/woocommerce/emails/plain/email-order-items.php custom-theme/woocommerce/global/breadcrumb.php custom-theme/woocommerce/global/form-login.php custom-theme/woocommerce/global/quantity-input.php custom-theme/woocommerce/global/sidebar.php custom-theme/woocommerce/global/wrapper-end.php custom-theme/woocommerce/global/wrapper-start.php custom-theme/woocommerce/loop/add-to-cart.php custom-theme/woocommerce/loop/loop-end.php custom-theme/woocommerce/loop/loop-start.php custom-theme/woocommerce/loop/no-products-found.php custom-theme/woocommerce/loop/orderby.php custom-theme/woocommerce/loop/pagination.php custom-theme/woocommerce/loop/price.php custom-theme/woocommerce/loop/rating.php custom-theme/woocommerce/loop/result-count.php custom-theme/woocommerce/loop/sale-flash.php custom-theme/woocommerce/myaccount/dashboard.php custom-theme/woocommerce/myaccount/downloads.php custom-theme/woocommerce/myaccount/form-add-payment-method.php custom-theme/woocommerce/myaccount/form-edit-account.php custom-theme/woocommerce/myaccount/form-edit-address.php custom-theme/woocommerce/myaccount/form-login.php version 4.1.0 is out of date. The core version is 6.0.0 custom-theme/woocommerce/myaccount/form-lost-password.php custom-theme/woocommerce/myaccount/form-reset-password.php custom-theme/woocommerce/myaccount/lost-password-confirmation.php custom-theme/woocommerce/myaccount/my-account.php custom-theme/woocommerce/myaccount/my-address.php custom-theme/woocommerce/myaccount/my-downloads.php custom-theme/woocommerce/myaccount/my-orders.php custom-theme/woocommerce/myaccount/navigation.php custom-theme/woocommerce/myaccount/orders.php custom-theme/woocommerce/myaccount/payment-methods.php custom-theme/woocommerce/myaccount/view-order.php custom-theme/woocommerce/notices/error.php version 3.5.0 is out of date. The core version is 3.9.0 custom-theme/woocommerce/notices/notice.php version 3.5.0 is out of date. The core version is 3.9.0 custom-theme/woocommerce/notices/success.php version 3.5.0 is out of date. The core version is 3.9.0 custom-theme/woocommerce/order/form-tracking.php version 3.6.0 is out of date. The core version is 6.5.0 custom-theme/woocommerce/order/order-again.php custom-theme/woocommerce/order/order-details-customer.php version 3.4.4 is out of date. The core version is 5.6.0 custom-theme/woocommerce/order/order-details-item.php version 3.7.0 is out of date. The core version is 5.2.0 custom-theme/woocommerce/order/order-details.php version 3.7.0 is out of date. The core version is 4.6.0 custom-theme/woocommerce/order/order-downloads.php custom-theme/woocommerce/order/tracking.php custom-theme/woocommerce/product-searchform.php custom-theme/woocommerce/single-product/add-to-cart/external.php custom-theme/woocommerce/single-product/add-to-cart/grouped.php version 3.4.0 is out of date. The core version is 4.8.0 custom-theme/woocommerce/single-product/add-to-cart/simple.php custom-theme/woocommerce/single-product/add-to-cart/variable.php custom-theme/woocommerce/single-product/add-to-cart/variation-add-to-cart-button.php custom-theme/woocommerce/single-product/add-to-cart/variation.php custom-theme/woocommerce/single-product/meta.php custom-theme/woocommerce/single-product/photoswipe.php custom-theme/woocommerce/single-product/price.php custom-theme/woocommerce/single-product/product-attributes.php custom-theme/woocommerce/single-product/product-image.php custom-theme/woocommerce/single-product/product-thumbnails.php custom-theme/woocommerce/single-product/rating.php custom-theme/woocommerce/single-product/related.php version 3.0.0 is out of date. The core version is 3.9.0 custom-theme/woocommerce/single-product/review-meta.php custom-theme/woocommerce/single-product/review-rating.php custom-theme/woocommerce/single-product/review.php custom-theme/woocommerce/single-product/sale-flash.php custom-theme/woocommerce/single-product/share.php custom-theme/woocommerce/single-product/short-description.php custom-theme/woocommerce/single-product/stock.php custom-theme/woocommerce/single-product/tabs/additional-information.php custom-theme/woocommerce/single-product/tabs/description.php custom-theme/woocommerce/single-product/tabs/tabs.php version 2.4.0 is out of date. The core version is 3.8.0 custom-theme/woocommerce/single-product/title.php custom-theme/woocommerce/single-product/up-sells.php custom-theme/woocommerce/single-product-reviews.php version 3.6.0 is out of date. The core version is 4.3.0 custom-theme/woocommerce/single-product.php custom-theme/woocommerce/content-product_cat.php version 2.6.1 is out of date. The core version is 4.7.0 custom-theme/woocommerce/taxonomy-product_cat.php version 1.6.4 is out of date. The core version is 4.7.0 custom-theme/woocommerce/taxonomy-product_tag.php version 1.6.4 is out of date. The core version is 4.7.0 Outdated Templates: ? Learn how to update ### Admin ### Enabled Features: activity-panels analytics coupons customer-effort-score-tracks experimental-products-task experimental-import-products-task experimental-fashion-sample-products experimental-product-tour shipping-smart-defaults shipping-setting-tour homescreen marketing mobile-app-banner navigation onboarding onboarding-tasks remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices wc-pay-promotion wc-pay-welcome-page Disabled Features: minified-js new-product-management-experience settings Daily Cron: ? Next scheduled: 2022-09-26 07:16:10 +08:00 Options: ? Notes: 100 Onboarding: completed ### Action Scheduler ### Complete: 2,461 Oldest: 2022-09-05 10:40:10 +0800 Newest: 2022-09-26 08:17:07 +0800 Failed: 1 Oldest: 2022-09-25 18:05:06 +0800 Newest: 2022-09-25 18:05:06 +0800 Pending: 6 Oldest: 2022-09-26 08:19:01 +0800 Newest: 2022-10-02 08:00:00 +0800 ### Status report information ### Generated at: 2022-09-26 08:17:23 +08:00
Hi @nas9286
Thanks for sharing the System Status Report.
Your theme overrides a huge number of WooCommerce templates, and some overrides are outdated. Please refer to our documentation on how to update outdated templates: https://woocommerce.com/document/fix-outdated-templates-woocommerce/
Please let us know if the issue persists even after updating outdated templates.
Finally got the solution to this problem and in case anyone stumbles across this, all I had to do was to update how to get the reference post ID because the existing one is deprecated already.
<?php global $product; $product = wc_get_product( $post->ID ); $stock_quantity = get_post_meta($post->ID, '_stock', true); //var_dump($product->get_stock_status()); ?> <?php if ($product->get_stock_status() != 'instock') : ?> <div class="outofstock"> <img src="<?php echo imgfolder('out-of-stock.png'); ?>" alt="Out of Stock"> </div> <?php endif; ?>
This had nothing to do with outdated templates override.
- The topic ‘Critical error on single product page’ is closed to new replies.