[Bug Report] You-cannot-add-another notice displayed with html code
-
Attempting to add a second item to cart for a product with “Limit purchases to 1 item per order” turned on produces this issue:
The “View cart” link in the “You cannot add another…” notice is displayed with the “<a href=…” code visible instead of actually being a link.
This is visible in both the cart page and the mini cart.
WooCommerce v. 7.6.0
WordPress v. 6.2
Twenty Twenty-Three theme v. 1.1-
This topic was modified 3 years ago by
wpac.
-
This topic was modified 3 years ago by
-
Hi @wpac
Thanks for reaching out!
I understand that you are seeing an error message on your cart page when trying to add a second product after adding a product that is limited to one purchase only, correct?
I replicated the scenario on my personal site running on the default Storefront theme, however, I am unable to reproduce the issue on my end. As you can see below, I am still able to add several products to my cart even though I have added a product that is limited to one purchase only.

To better picture what you are referring to here, can you please share with us a clear screenshot of what you see on your end so that we could address you more effectively?
If you don’t already have a screenshot service installed, you can try https://snipboard.io. You can share the direct link to the image as a response to this topic.
Furthermore, for us to investigate this further, can you please try to switch to the default Storefront theme and only WooCommerce plugin is enabled, repeat the steps above of adding another product to your cart 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 share your System Status Report, that will help us further troubleshoot.
You can find it via
WooCommerce > Status. SelectGet system reportand thenCopy for support. Once you’ve done that, you can paste it into your reply here.If you could also 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.
Let us know how it goes!
,
Hi @xue28 , thanks for responding. I meant attempting to add the same product again, not a different product. The message is supposed to come up. That’s not the problem. The problem is that it comes up along with html code instead of a link.
Also, the message keeps returning if I close it from the mini cart. If I close it from the proper cart, it goes away until I add another product twice. Then, it will display the new message along with all the old ones.

-
This reply was modified 3 years ago by
wpac.
WordPress Environment WordPress address (URL): Site address (URL): WC Version: 7.6.0 REST API Version: ✔ 7.6.0 WC Blocks Version: ✔ 9.8.4 Action Scheduler Version: ✔ 3.5.4 Log Directory Writable: ✔ WP Version: 6.2 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: 7.4.33 PHP Post Max Size: 64 MB PHP Time Limit: 60 PHP Max Input Vars: 5000 cURL Version: 7.84.0 OpenSSL/1.1.1p SUHOSIN Installed: – MySQL Version: 5.5.5-10.5.19-MariaDB-cll-lve Max Upload Size: 64 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ Database WC Database Version: 7.6.0 WC Database Prefix: wp_ Total Database Size: 14.00MB Database Data Size: 10.87MB Database Index Size: 3.13MB wp_woocommerce_sessions: Data: 0.03MB + 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.02MB + Index: 0.03MB + 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: 0.30MB + Index: 0.31MB + 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.19MB + Index: 0.16MB + Engine InnoDB wp_commentmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_jetpack_waf_blocklog: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_litespeed_url: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_litespeed_url_file: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_mailpoet_automations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailpoet_automation_runs: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailpoet_automation_run_logs: Data: 0.02MB + Index: 0.02MB + 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.03MB + 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.06MB + Engine InnoDB wp_mailpoet_stats_notifications: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_mailpoet_subscribers: Data: 0.02MB + Index: 0.13MB + 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: 4.47MB + Index: 0.16MB + Engine InnoDB wp_postmeta: Data: 0.14MB + Index: 0.06MB + Engine InnoDB wp_posts: Data: 1.45MB + Index: 0.06MB + 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_usermeta: Data: 0.06MB + 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.02MB + 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_order_coupon_lookup: 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.02MB + 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_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB Post Type Counts attachment: 9 custom_css: 1 customize_changeset: 13 feedback: 6 forum: 1 mailpoet_page: 1 page: 16 post: 3 product: 11 product_variation: 5 revision: 42 shop_coupon: 1 shop_order: 1 wp_block: 4 wp_global_styles: 2 wp_navigation: 3 wp_template: 4 wp_template_part: 5 wpforms: 1 Security Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ Active Plugins (8) Akismet Anti-Spam: by Automattic – 5.1 Jetpack Protect: by Automattic - Jetpack Security team – 1.3.0 Jetpack: by Automattic – 12.0 WooCommerce Payments: by Automattic – 5.7.0 WooCommerce Shipping & Tax: by WooCommerce – 2.2.4 WooCommerce: by Automattic – 7.6.0 WP Super Cache: by Automattic – 1.9.4 WP-Sweep: by Lester 'GaMerZ' Chan – 1.1.5 Inactive Plugins (3) Current Year and Symbols Shortcode: by KGM Servizi – 2.3.1 LiteSpeed Cache: by LiteSpeed Technologies – 5.4 MailPoet: by MailPoet – 4.12.2 Dropin Plugins (1) advanced-cache.php: advanced-cache.php Settings API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) subscription (subscription) variable (variable) variable subscription (variable-subscription) 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: ✔ Order datastore: WC_Order_Data_Store_CPT WC Pages Shop base: ❌ Page not set Cart: #12 - /cart/ Checkout: #13 - /checkout/ My account: #14 - /my-account/ Terms and conditions: #890 - /terms-and-conditions/ Theme Name: Twenty Twenty-Three Version: 1.1 Author URL: https://wordpress.org 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: – Subscriptions WCS_DEBUG: ✔ No Subscriptions Mode: ✔ Live Subscriptions Live URL: Subscriptions-core Library Version: 5.5.0 Subscription Statuses: – WooCommerce Account Connected: ❌ No Store Setup Country / State: United States (US) — California Subscriptions by Payment Gateway Payment Gateway Support Admin Enabled Features: activity-panels analytics coupons customer-effort-score-tracks import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing multichannel-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 woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page Disabled Features: block-editor-feature-enabled minified-js new-product-management-experience product-variation-management settings Daily Cron: ✔ Next scheduled: 2023-04-25 20:34:37 -07:00 Options: ✔ Notes: 63 Onboarding: completed WooCommerce Payments Version: 5.7.0 Connected to WPCOM: Yes Blog ID: 160535589 Account ID: - Action Scheduler Complete: 816 Oldest: 2023-04-16 11:27:08 -0700 Newest: 2023-04-25 05:44:47 -0700 Failed: 3 Oldest: 2023-04-16 14:31:09 -0700 Newest: 2023-04-18 00:05:02 -0700 Pending: 1 Oldest: 2023-04-25 14:34:33 -0700 Newest: 2023-04-25 14:34:33 -0700 Status report information Generated at: 2023-04-25 06:31:04 -07:00 `I’ve also noticed that after you make an attempt to add a product twice that’s been restricted to one purchase, the “Redirect to the cart page after successful addition” ceases to work, even when you add a different product that’s not in your cart.
Hi @wpac
Thanks for providing further information about your issue here.
I replicated the scenario on my personal site running on the default Storefront theme, however, I am unable to reproduce the issue on my end. This is what I see when trying to add a product again to my cart unlike your screenshot above.

+
I’ve also noticed that after you make an attempt to add a product twice that’s been restricted to one purchase, the “Redirect to the cart page after successful addition” ceases to work, even when you add a different product that’s not in your cart.
On my end, I was unable to reproduce this issue as well. I would suggest performing the suggestions above and repeating the steps you mentioned here until you find the conflicting plugin which causes the issue here.
Please give it a try and let us know how that goes!
Thanks, @xue28. I’ve found the conflicting plugin: WooCommerce Shipping & Tax. Fortunately, it’s not one that I need.
Hi @wpac
I’m glad you were able to find the conflicting plugin here and disabling it resolved the issue, correct?
I will be marking this thread as resolved. Should you have further inquiries, kindly create a new topic here.
Meanwhile, if you have a moment to spare, we would love it if you could share your thoughts with us by leaving a review or feedback. Your experience and feedback are important to help us improve and ensure we’re always providing the best possible support.
Thanks!
-
This reply was modified 3 years ago by
The topic ‘[Bug Report] You-cannot-add-another notice displayed with html code’ is closed to new replies.