WC_Product::get_price_excluding_tax function is deprecated
-
I’m getting this error message:
[02-Jan-2022 22:52:14 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.I have literally gone and deactivated all my site plugins, changed to Twenty-Twenty One theme and still I’m getting this error. Only thing I haven’t deactivated is Woocommerce (for obvious reasons).
Any insight?
-
I’m also encountering this:
[02-Jan-2022 20:50:39 UTC] The WC_Order_Item_Product::offsetSet function is deprecated since version 4.4.0.
Hi @kissmylegs
Thanks for sharing the error messages.
In order to check your configuration and assist you further, could you please share a copy of your site’s System Status?
You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”. Once you’ve done that, paste it here in your response.
### WordPress Environment ### WordPress address (URL): https://kissmylegs.ca Site address (URL): https://kissmylegs.ca WC Version: 6.0.0 REST API Version: ? 6.0.0 WC Blocks Version: ? 6.3.3 Action Scheduler Version: ? 3.3.0 WC Admin Version: ? 2.9.4 Log Directory Writable: ? WP Version: 5.8.2 WP Multisite: – WP Memory Limit: 2 GB WP Debug Mode: – WP Cron: ? Language: en_US External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.4.26 PHP Post Max Size: 2 GB PHP Time Limit: 3000 PHP Max Input Vars: 10000 cURL Version: 7.80.0 OpenSSL/1.1.1l SUHOSIN Installed: – MySQL Version: 5.6.41-84.1 Max Upload Size: 2 GB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 6.0.0 WC Database Prefix: wp_ Total Database Size: 203.89MB Database Data Size: 169.92MB Database Index Size: 33.97MB wp_woocommerce_sessions: Data: 1.02MB + Index: 0.03MB + Engine MyISAM wp_woocommerce_api_keys: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_order_items: Data: 1.48MB + Index: 0.68MB + Engine MyISAM wp_woocommerce_order_itemmeta: Data: 11.96MB + Index: 6.69MB + Engine MyISAM wp_woocommerce_tax_rates: Data: 0.00MB + Index: 0.01MB + 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: 1.28MB + Index: 0.83MB + 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.34MB + Index: 0.38MB + Engine InnoDB wp_admin_columns: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_cm_popfly_history: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_commentmeta: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_comments: Data: 3.10MB + Index: 1.03MB + Engine MyISAM wp_failed_jobs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_groups_capability: Data: 0.00MB + Index: 0.02MB + Engine MyISAM wp_groups_group: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_groups_group_capability: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_groups_user_capability: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_groups_user_group: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_huge_itslider_images: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_huge_itslider_params: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_huge_itslider_sliders: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mailchimp_carts: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_options: Data: 4.12MB + Index: 0.94MB + Engine MyISAM wp_pimwick_gift_card: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_pimwick_gift_card_activity: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_postmeta: Data: 81.78MB + Index: 15.88MB + Engine MyISAM wp_posts: Data: 49.02MB + Index: 1.98MB + Engine MyISAM wp_pptrack_codes: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_queue: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_redirection_404: Data: 0.09MB + Index: 0.04MB + Engine MyISAM wp_redirection_groups: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_redirection_items: Data: 0.02MB + Index: 0.04MB + Engine MyISAM wp_redirection_logs: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_social_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_termmeta: Data: 0.02MB + Index: 0.02MB + Engine MyISAM wp_terms: Data: 0.01MB + Index: 0.02MB + Engine MyISAM wp_term_relationships: Data: 0.45MB + Index: 0.81MB + Engine MyISAM wp_term_taxonomy: Data: 0.01MB + Index: 0.01MB + Engine MyISAM wp_tinvwl_analytics: Data: 0.11MB + Index: 0.06MB + Engine InnoDB wp_tinvwl_items: Data: 0.08MB + Index: 0.00MB + Engine InnoDB wp_tinvwl_lists: Data: 0.05MB + Index: 0.00MB + Engine InnoDB wp_usermeta: Data: 2.52MB + Index: 1.03MB + Engine MyISAM wp_users: Data: 0.12MB + Index: 0.09MB + Engine MyISAM wp_wcpdf_invoice_number: Data: 0.04MB + Index: 0.03MB + Engine MyISAM wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 1.52MB + Index: 0.63MB + Engine InnoDB wp_wc_order_stats: Data: 0.16MB + Index: 0.17MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.11MB + Index: 0.13MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 1.52MB + Index: 1.05MB + Engine InnoDB 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.02MB + Index: 0.02MB + Engine InnoDB 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.01MB + Index: 0.01MB + Engine MyISAM wp_wfConfig: Data: 2.17MB + 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: 2.13MB + Index: 0.42MB + Engine MyISAM wp_wfHits: Data: 1.70MB + Index: 0.40MB + Engine MyISAM wp_wfHoover: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfIssues: Data: 0.01MB + Index: 0.01MB + Engine MyISAM wp_wfKnownFileList: Data: 1.13MB + Index: 0.13MB + Engine MyISAM wp_wfLiveTrafficHuman: Data: 0.01MB + Index: 0.01MB + Engine MyISAM wp_wfLocs: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_wfLogins: Data: 0.38MB + Index: 0.07MB + 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.01MB + Index: 0.00MB + Engine MyISAM wp_wfPendingIssues: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfReverseCache: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfSNIPCache: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfStatus: Data: 0.10MB + Index: 0.05MB + Engine MyISAM wp_wfTrafficRates: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_woocommerce_square_customers: Data: 0.01MB + Index: 0.02MB + Engine MyISAM wp_wotv_woo_track_info: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ycd_subscribers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_yith_wcwl: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_yith_wcwl_lists: Data: 0.00MB + Index: 0.01MB + Engine MyISAM ### Post Type Counts ### attachment: 8195 cm-ad-item: 10 custom_css: 1 customize_changeset: 2 nav_menu_item: 122 oembed_cache: 17 options: 1 page: 55 post: 3 product: 3594 product_variation: 3706 revision: 3679 shop_coupon: 124 shop_order: 3190 shop_order_refund: 15 symbol_main_slider: 1 wcbox: 1 wcps: 1 woocarousel: 1 wpcf7_contact_form: 10 ycdcountdown: 3 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (30) ### Canada Post Shipping For WooCommerce: by Small Fish Analytics Inc. – 2.9.4 CM Pop-Up banners for WordPress: by CreativeMindsSolutions – 1.5.4 Admin Columns: by AdminColumns.com – 4.4.4 Contact Form 7: by Takayuki Miyoshi – 5.5.3 Jilt for WooCommerce: by Jilt – 1.7.12 Nav Menu Roles: by Kathy Darling – 2.0.1 PW WooCommerce Gift Cards: by Pimwick LLC – 1.196 Restrict Widgets: by dFactory – 1.3.1 Sezzle WooCommerce Payment: by Sezzle – 4.0.0 Show-Hide/Collapse-Expand: by Bunte Giraffe – 1.2.5 Page Builder by SiteOrigin: by SiteOrigin – 2.15.3 SiteOrigin Widgets Bundle: by SiteOrigin – 1.28.0 Tawk.to Live Chat: by Tawkto – 0.6.0 TI WooCommerce Wishlist: by TemplateInvaders – 1.29.0 Advanced Editor Tools (previously TinyMCE Advanced): by Automattic – 5.6.0 TrustedSite: by TrustedSite – 1.1.2 Under Construction: by WebFactory Ltd – 3.89 Orders Tracking for WooCommerce: by VillaTheme – 1.1.10 Variation Swatches for WooCommerce: by Emran Ahmed – 1.1.19 WooCommerce Extended Coupon Features FREE: by Soft79 – 3.2.8 WOOCS - WooCommerce Currency Switcher: by realmag777 – 1.3.7.3 WooCommerce 'Email Money Transfer' Gateway: by Massoud Shakeri BlazingSpider – 2.3.3 WooCommerce My Account Widget: by PEP – 0.6.6 WooCommerce PDF Invoices & Packing Slips: by Ewout Fernhout – 2.11.1 Woocommerce Products Per Page: by Jeroen Sormani – 1.2.6 Role Based Price For WooCommerce: by Varun Sridharan – 3.3.7 WooCommerce Square: by WooCommerce – 2.7.0 WooCommerce: by Automattic – 6.0.0 Wordfence Security: by Wordfence – 7.5.7 WP-PageNavi: by Lester 'GaMerZ' Chan – 2.94.0 ### Inactive Plugins (5) ### Classic Editor: by WordPress Contributors – 1.6.2 Gutenberg: by Gutenberg Team – 12.2.0 Mailchimp for WooCommerce: by Mailchimp – 2.5.4 Redirection: by John Godley – 5.1.3 WPC Fly Cart for WooCommerce: by WPClever – 4.2.3 ### Must Use Plugins (1) ### SSO: by Garth Mortensen Mike Hansen – 0.3 ### Settings ### API Enabled: ? Force SSL: ? Currency: CAD (CAD$) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) pw gift card (pw-gift-card) 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: #490 - /shop/ Cart: #491 - /cart/ Checkout: #492 - /checkout/ My account: #493 - /my-account/ Terms and conditions: #653 - /terms/ ### Theme ### Name: Top Shop Child Version: 1.0.0 Author URL: https://wordpress.com Child Theme: ? Parent Theme Name: TopShop Parent Theme Version: 1.3.35 Parent Theme Author URL: https://kairaweb.com/ WooCommerce Support: ? ### Templates ### Overrides: topshop-child/myaccount/dashboard.php ### Jilt ### Plugin Version: 1.7.12 Jilt API Version: v2 Jilt API Authentication Method: OAuth Jilt API Connected: ? Linked to Jilt: ? Enabled: ? WooCommerce API: ? ### Square ### Environment: Production Tokenization Enabled: – Debug Mode: Off ### TI WooCommerce Wishlist Templates ### Overrides: – ### Status report information ### Generated at: 2022-01-02 21:07:46 -07:00
- This reply was modified 2 years, 10 months ago by KissMyLegs.
Hi @kissmylegs,
Thanks for sending over the system report. You mentioned this in your initial post:
I have literally gone and deactivated all my site plugins, changed to Twenty-Twenty One theme and still I’m getting this error. Only thing I haven’t deactivated is Woocommerce (for obvious reasons).
Just to be clear, did you deactivate all of the plugins at the same time so that only WooCommerce and the Twenty Twenty-one theme are active?
There is a plugin called String Locator that can be used to find text in a WordPress site. You could use it to search for
get_price_excluding_tax
and it should take you to the function that’s calling it.It does exist in these places in WooCommerce. You’ll want to see if you can find any references to it outside of WooCommerce.
Let us know what you find out and we’ll go from there.
So, I had a look around and don’t see anywhere else that is using just “get_price_excluding_tax” on it’s own. I see lots of places where/and assume that something like @Product->get_price_excluding_tax() is calling the Woocommerce “get_price_excluding_tax” function, which has a check function inside for deprecated functions… unless I’m wrong, it seems your function is just outputting a warning message letting me know the OLD “get_price_excluding_tax()” function is deprecated and to use the new function. At the moment, there doesn’t seem to be any issues. Just a friendly reminder about a deprecated function.
Thanks for recommending the string locator plugin…that was hugely helpful.
Dave
Glad to hear it – thanks for letting us know!
I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.
close, sorry
- This reply was modified 2 years, 6 months ago by KissMyLegs.
Hello @kissmylegs!
I believe you got this sorted. Right?
If you have another issue that needs help then I recommend creating a new thread. → https://www.ads-software.com/support/plugin/woocommerce/#new-topic-0
Cheers!
- The topic ‘WC_Product::get_price_excluding_tax function is deprecated’ is closed to new replies.