Cart count is not updating properly
-
Hey, there I have been facing an issue on my site that when we add any product to cart the cart count is being updated immediately however, when we remove any product from cart the cart count is not being updated without refreshing the page and that’s not good. I have used side cart woocommerce plugin.
I have tried deactivating all plugins excluding elementor, woocommerce and side cart woocommerce plugin but the issue wasn’t resolved. I have also tested the site on localhost to check if the issue is from server-side but on localhost also the same issue is occuring.
Kindly help me resolve the issue as soon as possible.The page I need help with: [log in to see the link]
-
Hi @kanwalshahzadi,
I have been facing an issue on my site that when we add any product to cart the cart count is being updated immediately however, when we remove any product from cart the cart count is not being updated without refreshing the page and that’s not good. I have used side cart woocommerce plugin.
From what I understand, you’re having issues with your cart count not updating properly when a product is removed from the cart, despite it updating correctly when a product is added. You’ve also mentioned that you’ve tried deactivating all plugins except for Elementor, WooCommerce, and the Side Cart WooCommerce plugin, and have tested the issue on localhost, but the problem persists.
I have checked your site and tried to replicate the issue you’re experiencing, however, everything seems to be functioning as expected on my end. It’s possible that this could be a cache issue or a conflict with your theme or another plugin.
Image Link: https://s5.gifyu.com/images/SiMLQ.gif
Here are a few steps you can take to troubleshoot this:
- Clear your browser cache and cookies: Sometimes outdated cache and cookies can cause issues with the functionality of your site.
- Try a different browser: If the issue is specific to your browser, using a different one may resolve it.
- Update your plugins: Make sure all your plugins, including the Side Cart WooCommerce plugin, are updated to the latest version.
- Check your theme: Sometimes themes can cause conflicts. Try switching to a default WordPress theme like Storefront and see if the issue persists. Here’s a helpful guide on how to test for conflicts: ?? How to Test for Plugin and Theme Conflicts.
- Use a different device or network: If the issue is related to your device or network, using a different one may help.
If none of these solutions work, could you please provide more details? Specifically, if there are any error messages, the exact steps you take before the issue occurs, and screenshots if possible. This will help us to further diagnose and resolve the issue. You can share screenshots at https://snipboard.io. Just follow the instructions on the page and paste the URL in your response.
We would also appreciate seeing your site’s System Status report. It can give us a clearer picture of your site’s setup and help us identify the problem. You can find the report under
WooCommerce > Status
. ChooseGet system report
and thenCopy for support
.If there are any fatal error logs, please share those as well. You can find them under
WooCommerce > Status > Logs
.Once you’ve collected this information, please paste it inside a Code block in your reply, or use https://pastebin.com to paste it and share the link with us.
Thanks for your patience and cooperation in this matter! We’re here to help you get this sorted.
Hi @bisratlearn,
The issue is happening on cart page. The way you are testing I have also tested It’s working fine in this way. Kindly go to cart page and remove the product from cart page not from side cart menu check this in this way.
Moreover, I have cleared the cache and also tested it in a different browser also in incognito. All the plugins are up-dated I have used the astra theme.
Best Regards,- This reply was modified 12 months ago by kanwalshahzadi.
- This reply was modified 12 months ago by kanwalshahzadi.
Here, is the system report
WordPress Environment WordPress address (URL): https://candyspoon.staging.jinnbyte-staging.com Site address (URL): https://candyspoon.staging.jinnbyte-staging.com WC Version: 8.3.1 REST API Version: ? 8.3.1 WC Blocks Version: ? 11.4.9 Action Scheduler Version: ? 3.6.4 Log Directory Writable: ? WP Version: 6.4.1 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ? Language: en_US External object cache: – Server Environment Server Info: LiteSpeed PHP Version: 8.1.25 PHP Post Max Size: 32 MB PHP Time Limit: 30 PHP Max Input Vars: 1000 cURL Version: 7.87.0 OpenSSL/1.1.1w SUHOSIN Installed: – MySQL Version: 10.3.39-MariaDB-cll-lve Max Upload Size: 32 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? Database WC Database Version: 8.3.1 WC Database Prefix: wp_ Total Database Size: 87.53MB Database Data Size: 80.70MB Database Index Size: 6.83MB wp_woocommerce_sessions: Data: 1.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.09MB + Index: 0.09MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 1.45MB + Index: 0.92MB + 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: 0.27MB + Index: 0.19MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_e_events: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_e_notes: Data: 0.02MB + Index: 0.17MB + Engine InnoDB wp_e_notes_users_relations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_e_submissions: Data: 0.02MB + Index: 0.27MB + Engine InnoDB wp_e_submissions_actions_log: Data: 0.02MB + Index: 0.11MB + Engine InnoDB wp_e_submissions_values: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gla_attribute_mapping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gla_budget_recommendations: Data: 0.22MB + Index: 0.14MB + Engine InnoDB wp_gla_merchant_issues: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gla_shipping_rates: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gla_shipping_times: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_automations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailpoet_automation_runs: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_mailpoet_automation_run_logs: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_mailpoet_automation_run_subjects: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_mailpoet_automation_triggers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailpoet_automation_versions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_custom_fields: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_dynamic_segment_filters: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_feature_flags: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_forms: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailpoet_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailpoet_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_newsletters: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_mailpoet_newsletter_links: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_mailpoet_newsletter_option: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_newsletter_option_fields: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_newsletter_posts: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_newsletter_segment: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_newsletter_templates: Data: 2.52MB + Index: 0.00MB + Engine InnoDB wp_mailpoet_scheduled_tasks: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_mailpoet_scheduled_task_subscribers: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_segments: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_mailpoet_sending_queues: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_mailpoet_settings: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_statistics_bounces: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailpoet_statistics_clicks: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_mailpoet_statistics_forms: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_statistics_newsletters: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_mailpoet_statistics_opens: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_mailpoet_statistics_unsubscribes: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_mailpoet_statistics_woocommerce_purchases: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_mailpoet_stats_notifications: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_mailpoet_subscribers: Data: 0.02MB + Index: 0.23MB + Engine InnoDB wp_mailpoet_subscriber_custom_field: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_subscriber_ips: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_subscriber_segment: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_mailpoet_subscriber_tag: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_mailpoet_tags: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_user_agents: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_user_flags: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 5.08MB + Index: 0.08MB + Engine InnoDB wp_postmeta: Data: 18.48MB + Index: 1.58MB + Engine InnoDB wp_posts: Data: 49.39MB + Index: 0.36MB + Engine InnoDB wp_rednaowooextraproduct_global_table: 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.02MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_orders: Data: 0.02MB + Index: 0.11MB + Engine InnoDB wp_wc_orders_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_addresses: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_operational_data: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB 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.05MB + Index: 0.09MB + 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.02MB + Index: 0.02MB + Engine InnoDB wp_woof_query_cache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woof_sd: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woof_sd_presets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpfm_backup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wt_guest_wishlists: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wt_wishlists: Data: 0.02MB + Index: 0.00MB + Engine InnoDB Post Type Counts attachment: 251 custom_css: 2 customize_changeset: 48 dft_cpo: 85 elementor_library: 16 mailpoet_page: 1 nav_menu_item: 6 page: 12 post: 8 product: 133 product_variation: 60 revision: 1514 shop_order: 90 wp_global_styles: 1 wp_navigation: 1 Security Secure connection (HTTPS): ? Hide errors from visitors: ? Active Plugins (12) Elementor Pro: by Elementor.com – 3.17.1 Elementor: by Elementor.com – 3.17.3 Envato Market: by Envato – 2.0.10 Extra Product Options for WooCommerce: by actpro – 3.0.3 Side Cart WooCommerce: by XootiX – 2.4.7 Extra product options For WooCommerce | Custom Product Addons and Fields: by ThemeHigh – 3.2.4 Variation Swatches for WooCommerce: by Emran Ahmed – 2.0.29 WooCommerce Stripe Gateway: by WooCommerce – 7.7.0 HUSKY - Products Filter Professional for WooCommerce: by realmag777 – 1.3.4.5 WooCommerce: by Automattic – 8.3.1 WP Mail SMTP: by WP Mail SMTP – 3.10.0 Wishlist for WooCommerce: by WebToffee – 2.0.9 Inactive Plugins (3) NitroPack: by NitroPack Inc. – 1.10.4 WP-Optimize - Clean, Compress, Cache: by David Anderson Ruhani Rabin Team Updraft – 3.2.22 WP Menu Cart: by WP Overnight – 2.14.2 Settings API Enabled: – Force SSL: – Currency: SSP (£) 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: ? HPOS feature screen enabled: – HPOS feature enabled: – Order datastore: WC_Order_Data_Store_CPT HPOS data sync enabled: – WC Pages Shop base: #8 - /shop/ Cart: #9 - /cart/ Checkout: #10 - /checkout/ My account: #11 - /my-account/ Terms and conditions: ? Page not set Theme Name: Astra Version: 4.3.1 (update to version 4.5.1 is available) Author URL: https://wpastra.com/about/?utm_source=theme_preview&utm_medium=author_link&utm_campaign=astra_theme 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: – Admin Enabled Features: activity-panels analytics product-block-editor coupons core-profiler customer-effort-score-tracks import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing mobile-app-banner navigation onboarding onboarding-tasks product-variation-management remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page Disabled Features: customize-store minified-js new-product-management-experience product-virtual-downloadable product-external-affiliate settings async-product-editor-category-field Daily Cron: ? Next scheduled: 2023-12-04 17:05:55 +00:00 Options: ? Notes: 76 Onboarding: completed Action Scheduler Complete: 987 Oldest: 2023-11-04 08:48:04 +0000 Newest: 2023-12-04 07:11:46 +0000 Failed: 2,115 Oldest: 2023-10-04 06:12:31 +0000 Newest: 2023-11-06 14:05:07 +0000 Pending: 3 Oldest: 2023-12-04 14:00:00 +0000 Newest: 2023-12-05 06:32:52 +0000 Status report information Generated at: 2023-12-04 10:51:34 +00:00
I have also tried updating the theme in local and tested but the issue wasn’t resolved.
Hey @kanwalshahzadi,
Thanks for sharing the SSR, nothing out of the ordinary seems to be standing out there.
I have gone to your site and am unable to replicate the issue as the cart updates immediately after removing an item from the cart (without the need to refresh the page):
Are you still experiencing this issue on your end? If so, I understand that clearing your browser cache has made no difference so please can you clarity the following:
- Does this occur with specific products?
- Does this require a specific amount of items added to the cart to replicate?
- Which browsers have you been able to replicate this behavior with?
In the meantime, can you reach out to your host and ask them to make sure that your
Cart
andCheckout
pages are excluded from being cached as this is a common reason for this type of behavior.Cheers!
Yes, I am still encountering the issue.
As you can see the cart is empty and the cart count is still one.
No it does not occur for specific products nor it requires specific amount of products.
I am testing it on chrome.
Kindly help me through this to resolve it as soon as possible.
Best Regards.Thanks for sharing further information about your issue here.
I was able to replicate it on my end using Google Chrome. I’ve already emptied the cart, however, the mini cart is still showing one item:
It looks like a third-party plugin or your theme might be causing the conflict here.
As a first step, please follow the instructions below to clear transients, site, server and browser cache:
- Clear all transients under WooCommerce > Status > Tools
- Have your host purge the site/server cache
- Clear your browser’s cache or try another browser or in incognito mode
Then, for us to investigate this further, can you please try to switch to the default Storefront theme and only WooCommerce plugin is enabled and see if this works?
If so, then this kind of problem is usually caused by your theme or a third-party plugin present on your site. We can run a conflict test to verify this. I’d recommend cloning your site to a staging environment and performing the tests described on this guide without modifying your live site or impacting customers. Many hosts provide staging facilities, so it’s worth checking in with them. It’s also possible to do it using the free WP Staging plugin.
If this was caused by a third-party plugin present on your site, it would be best to reach out to the developers for further assistance here.
If this did not resolve the issue, please provide the fatal error logs (if any) under
WooCommerce > Status > Logs
.You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.
Or, if you’d like someone else to do this work for you, our trusted partner, Codeable, has an offering where they will run this test for $150 USD. If there is time left, they will also fix the problems they found.
Let us know how it goes!
Hi @xue28,
I have followed the instructions below to clear transients, site, server and browser cache:- Cleared all transients under WooCommerce > Status > Tools
- I have also purged the site/server cache
- Clear your browser’s cache or tried another browser or in incognito mode
But the issue wasn’t resolved then to investigate this further, I have tried to switch to the default Storefront theme and all the plugins were activate too and the issue was resolved.
But that theme is client’s requirement I cannot use any other theme further my site is already in staging environment.
I think so the issue is happening due to a third-party plugin maybe due to side cart woocommerce can’t get it.
By the way, the fatal error logs (if any) underWooCommerce > Status > Logs
are: - 2023-11-08T14:39:21+00:00 CRITICAL Uncaught Error: Call to undefined function PHPMailer\PHPMailer\mail() in /home4/jinnbyte/candyspoon.staging/wp-includes/PHPMailer/PHPMailer.php:874 Stack trace: #0 /home4/jinnbyte/candyspoon.staging/wp-includes/PHPMailer/PHPMailer.php(1961): PHPMailer\PHPMailer\PHPMailer->mailPassthru() #1 /home4/jinnbyte/candyspoon.staging/wp-includes/PHPMailer/PHPMailer.php(1682): PHPMailer\PHPMailer\PHPMailer->mailSend() #2 /home4/jinnbyte/candyspoon.staging/wp-includes/PHPMailer/PHPMailer.php(1518): PHPMailer\PHPMailer\PHPMailer->postSend() #3 /home4/jinnbyte/candyspoon.staging/wp-includes/pluggable.php(546): PHPMailer\PHPMailer\PHPMailer->send() #4 /home4/jinnbyte/candyspoon.staging/wp-admin/includes/class-wp-automatic-updater.php(976): wp_mail() #5 /home4/jinnbyte/candyspoon.staging/wp-admin/includes/class-wp-automatic-updater.php(639): WP_Automatic_Updater->send_email() #6 /home4/jinnbyte/candyspoon.staging/wp-admin/includes/class-wp-automatic-updater.php(606): WP_Automatic_Updater->after_core_update() #7 /home4/jinnbyte/candyspoon.staging/wp-includes/update.php(852): WP_Automatic_Updater->run() #8 /home4/jinnbyte/candyspoon.staging/wp-includes/class-wp-hook.php(310): wp_maybe_auto_update() #9 /home4/jinnbyte/candyspoon.staging/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters() #10 /home4/jinnbyte/candyspoon.staging/wp-includes/plugin.php(517): WP_Hook->do_action() #11 /home4/jinnbyte/candyspoon.staging/wp-includes/update.php(292): do_action() #12 /home4/jinnbyte/candyspoon.staging/wp-includes/class-wp-hook.php(310): wp_version_check() #13 /home4/jinnbyte/candyspoon.staging/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters() #14 /home4/jinnbyte/candyspoon.staging/wp-includes/plugin.php(565): WP_Hook->do_action() #15 /home4/jinnbyte/candyspoon.staging/wp-cron.php(191): do_action_ref_array() #16 {main} thrown in /home4/jinnbyte/candyspoon.staging/wp-includes/PHPMailer/PHPMailer.php on line 874
Note: these are on my current theme Astra.
Kindly help me resolve the issue as soon as possible.
Best Regards,
Kanwal Shahzadi- This reply was modified 12 months ago by kanwalshahzadi.
I have tried to switch to the?default Storefront theme?and all the plugins were activate too and the issue was resolved.
But that theme is client’s requirement I cannot use any other theme further my site is already in staging environment.
I think so the issue is happening due to a third-party plugin maybe due to side cart woocommerce can’t get it.If I get you correctly here, the issue was resolved when you switched to the?default Storefront theme, correct? And, you can’t change the theme since it is your client’s requirement, right?
Name: Astra Version: 4.3.1 (update to version 4.5.1 is available) Author URL: https://wpastra.com/about/?utm_source=theme_preview&utm_medium=author_link&utm_campaign=astra_theme 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
Checking your SSR, I can see that you are using an outdated version of the Astra theme. Have you tried updating it and see if this resolves the issue?
Otherwise, if the error persists, I recommend that you reach out to the developers of the plugin for further assistance. They will be better equipped to help you resolve any issues you’re experiencing with the plugin.
All the best and hopefully, the issue will be fixed soon.
hi, I have tried updating the theme and there has been a critical error on the site I have restrored the site from server but now if I will update the theme it may affect the site but I have tried updating the theme on local environment and with the up-dated theme the issue wasn’t resolved.
I understand that the issue persists even after updating the theme on your site.
As mentioned above, this is a third-party plugin that we don’t provide support for based on our Support Policy. Please reach out to the developers of the plugin for further assistance.
All the best and hopefully, the issue will be fixed soon.
Hi, the third-party plugin support wasn’t responding I have been trying contacting them since yesterday but it’s of no use anyways you have supported and guided me a lot and this really means a lot.
Thank you so much for your guidance and I am glad to tell you that I have successfully resolved my issue using JavaScript code and some of Php functions which I have used for updating cart dynamically after every 5 second and finally the issue is sorted now.The code that I have used in functions.php is
add_action('wp_ajax_get_cart_count', 'custom_ajax_get_cart_count'); add_action('wp_ajax_nopriv_get_cart_count', 'custom_ajax_get_cart_count'); function custom_ajax_get_cart_count() { $cart_contents = WC()->cart->get_cart(); $unique_product_count = count($cart_contents); echo $unique_product_count; wp_die(); } function enqueue_custom_scripts() { wp_enqueue_script('custom-script', get_template_directory_uri() . '/custom.js', array('jquery'), null, true); wp_localize_script('custom-script', 'wc_cart_params', array('ajax_url' => admin_url('admin-ajax.php'))); } add_action('wp_enqueue_scripts', 'enqueue_custom_scripts');
and the code that I have used in custom.js file is
jQuery(document).ready(function($) { function updateCartCount() { $.ajax({ url: wc_cart_params.ajax_url, data: { action: 'get_cart_count' }, type: 'POST', success: function(data) { $('.xoo-wsc-sc-count').text(data); }, error: function(xhr, textStatus, errorThrown) { console.log('Error:', xhr, textStatus, errorThrown); } }); } // Call the updateCartCount function initially updateCartCount(); // Call the updateCartCount function periodically setInterval(updateCartCount, 5000); // Update every 5 seconds (adjust as needed) });
I am leaving this code here, so that if someone else facing this issue and they are not able to fix it trying all ways it would be helpful for them because I have spent more than 16 hours on this issue.
Thanks again to support.
Best Regards,
Kanwal Shahzadi- This reply was modified 12 months ago by kanwalshahzadi.
Hi @kanwalshahzadi,
I’m thrilled to hear that you’ve managed to resolve the issue on your own! Your dedication and problem-solving skills are commendable. Thank you for sharing your solution with us. I’m sure it will be of great help to others who might encounter the same problem.
I’ll go ahead and mark this thread as resolved. However, if you ever have more questions or issues in the future, don’t hesitate to kick off a new topic.
Hope you have a fantastic day!
Hello!
Mini Cart count is not updating properly on Cart page for me too. I Installed the fresh WP Version: 6.4.3 and WC Version: 8.6.1 and storefront (Version: 4.5.4) for testing purpose and try add this to the theme function.php this snippets but not working. I have no other plugin installed or theme just this 3 (wp,wc,storefront) fresh install.
function enqueue_wc_cart_fragments() { wp_enqueue_script( 'wc-cart-fragments' ); } add_action( 'wp_enqueue_scripts', 'enqueue_wc_cart_fragments' );
I found some post for similar problem where is maybe solved this problem use this code but in my case not working.
wp_enqueue_script( 'wc-cart-fragments' );
https://www.ads-software.com/support/topic/cart-fragments-not-updating/
https://www.ads-software.com/support/topic/elementor-mini-cart-widget-not-working-after-update/
I tried different wc and wp versions but the problem is same.
The default wp themes like twentytwentyfour dont have mini-cart in header when you are in Cart page so its not possible testing this problem.
- This reply was modified 8 months, 2 weeks ago by wpmanus4.
Hi @wpmanus4,
This thread is closed. Please feel free to start a new thread to handle your individual case there and sharing all the relevant details, and we tan take it from there.
Thanks!
-OP
- The topic ‘Cart count is not updating properly’ is closed to new replies.