Give error message when a user tries using multiple coupon codes.
-
Hi guys,
How do I throw a message when a user tries entering two coupon codes that I made for individual use only?
At the minute, if a customer tries entering more than one coupon code, it will just change to the latest one without letting them know that only one coupon code can be used.
Thanks in advance
-
Hi @pipin3000
You should tick the box
Individual use only
if you don’t want a coupon to be used in combination with other coupons. That’ll automatically display an error message if the user attempts to do so.
Link to image: https://snipboard.io/WL9oIg.jpgI hope this helps!
Hi Margaret
This is really odd because I have ticked that box already, this definitely used to be the case but not sure why recently it doesn’t work.
So when a user inputs a second discount code, the first one will get overridden and a success message “Coupon code applied successfully.” will appear.
Any thoughts on this?
Any function that I can use to do this manually perhaps?
Thanks
Hi @pipin3000
I’ve tried this on my test site which has the latest versions of WordPress, WooCommerce and Storefront (default theme), and I could not reproduce the same issue – an error message shows up when applying more than one coupon:
Link to image: https://snipboard.io/c4ADUf.jpg
You’ll first want to do a conflict test to determine if the issue is coming from a plugin/theme conflict. The best way to determine this is to:
- Temporarily switch your theme to Storefront
- Disable all plugins except for WooCommerce
- Test to see if the issue has been resolved
If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each, until you find the one causing conflict. You can find a more detailed explanation on how to do a conflict test here.
Hi Maykato
I have just disabled all plugins besides “Woocommerce” and switched over to storefront theme, this is on a staging website so I can do some testing.
The link is https://www.staging39.myconsumables.com/ and I am using coupon codes “test10” and “test20” and it’s still doing the same thing.
I have no scripts running, plugins or themes that could conflict with Woocommerce and cause this issue. Im extremely baffled.
Any suggestions?
hi @pipin3000
To troubleshot further, could you provide the following?
Screenshots of “test10” and “test20” settings: I recommend?https://snipboard.io?for easily sharing screenshots – please follow the instructions on the page, then paste the URL in this chat. It works with Chrome, Firefox, Safari, and Edge.
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.
https://snipboard.io/IEHRFN.jpg
https://snipboard.io/FYrUym.jpg
https://snipboard.io/k04PrC.jpg
https://snipboard.io/pD6F8b.jpg### WordPress Environment ### WordPress address (URL): https://www.staging39.myconsumables.com Site address (URL): https://www.staging39.myconsumables.com WC Version: 6.1.1 REST API Version: ? 6.1.1 WC Blocks Version: ? 6.5.2 Action Scheduler Version: ? 3.4.0 WC Admin Version: ? 3.0.3 Log Directory Writable: ? WP Version: 5.8.3 WP Multisite: – WP Memory Limit: 768 MB WP Debug Mode: – WP Cron: – Language: en_GB External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.4.27 PHP Post Max Size: 256 MB PHP Time Limit: 120 PHP Max Input Vars: 3000 cURL Version: 7.66.0 OpenSSL/1.1.1l-fips SUHOSIN Installed: – MySQL Version: 5.7.32-35-log Max Upload Size: 256 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 6.1.1 WC Database Prefix: pka_ Total Database Size: 143.06MB Database Data Size: 96.11MB Database Index Size: 46.95MB pka_woocommerce_sessions: Data: 1.17MB + Index: 0.02MB + Engine InnoDB pka_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pka_woocommerce_order_items: Data: 1.52MB + Index: 0.28MB + Engine InnoDB pka_woocommerce_order_itemmeta: Data: 13.52MB + Index: 11.03MB + Engine InnoDB pka_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pka_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_woocommerce_payment_tokenmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB pka_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_actionscheduler_actions: Data: 4.52MB + Index: 3.70MB + Engine InnoDB pka_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_actionscheduler_logs: Data: 2.52MB + Index: 3.03MB + Engine InnoDB pka_adtribes_my_conversions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_aioseo_notifications: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pka_aioseo_posts: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_atum_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_atum_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_atum_product_data: Data: 0.08MB + Index: 0.05MB + Engine InnoDB pka_bwf_actions: Data: 0.02MB + Index: 0.09MB + Engine InnoDB pka_bwf_action_claim: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_bwf_contact: Data: 0.31MB + Index: 0.23MB + Engine InnoDB pka_bwf_contact_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_bwf_funnelmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_bwf_funnels: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_bwf_optin_entries: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_bwf_wc_customers: Data: 0.36MB + Index: 0.06MB + Engine InnoDB pka_cartflows_ca_cart_abandonment: Data: 1.52MB + Index: 0.02MB + Engine InnoDB pka_cartflows_ca_email_history: Data: 0.20MB + Index: 0.30MB + Engine InnoDB pka_cartflows_ca_email_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_cartflows_ca_email_templates_meta: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_categorymeta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_chaty_contact_form_leads: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_cli_cookie_scan: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_cli_cookie_scan_categories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_cli_cookie_scan_cookies: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_cli_cookie_scan_url: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_cli_scripts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_comments: Data: 2.52MB + Index: 1.52MB + Engine InnoDB pka_duplicator_packages: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_mailchimp_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_member_catmeta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_monsterinsights_pageinsights_cache: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_ms_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_omnisend_logs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_options: Data: 4.41MB + Index: 0.30MB + Engine InnoDB pka_packlink_entity: Data: 14.52MB + Index: 0.00MB + Engine InnoDB pka_portfolio_catmeta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_postmeta: Data: 21.52MB + Index: 16.06MB + Engine InnoDB pka_posts: Data: 5.52MB + Index: 0.66MB + Engine InnoDB pka_product_catmeta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_rank_math_analytics_gsc: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pka_rank_math_analytics_objects: Data: 0.05MB + Index: 0.02MB + Engine InnoDB pka_rank_math_internal_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_rank_math_internal_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_shortpixel_folders: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_shortpixel_meta: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_snippets: Data: 0.05MB + Index: 0.00MB + Engine InnoDB pka_stock_log: Data: 0.36MB + Index: 0.00MB + Engine InnoDB pka_termmeta: Data: 0.11MB + Index: 0.16MB + Engine InnoDB pka_terms: Data: 0.06MB + Index: 0.03MB + Engine InnoDB pka_term_relationships: Data: 0.06MB + Index: 0.05MB + Engine InnoDB pka_term_taxonomy: Data: 0.06MB + Index: 0.06MB + Engine InnoDB pka_usermeta: Data: 2.52MB + Index: 4.03MB + Engine InnoDB pka_users: Data: 0.13MB + Index: 0.14MB + Engine InnoDB pka_wccs_conditions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wccs_condition_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB pka_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wc_customer_lookup: Data: 0.22MB + Index: 0.17MB + Engine InnoDB pka_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_wc_order_coupon_lookup: Data: 0.06MB + Index: 0.06MB + Engine InnoDB pka_wc_order_product_lookup: Data: 1.52MB + Index: 0.92MB + Engine InnoDB pka_wc_order_stats: Data: 0.25MB + Index: 0.25MB + Engine InnoDB pka_wc_order_tax_lookup: Data: 0.17MB + Index: 0.16MB + Engine InnoDB pka_wc_product_meta_lookup: Data: 0.08MB + Index: 0.09MB + Engine InnoDB pka_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_wdr_order_discounts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wdr_order_item_discounts: Data: 0.06MB + Index: 0.00MB + Engine InnoDB pka_wdr_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wfacp_stats: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pka_wfblockediplog: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wfblocks7: Data: 0.02MB + Index: 0.05MB + Engine InnoDB pka_wfconfig: Data: 0.48MB + Index: 0.00MB + Engine InnoDB pka_wfco_report_views: Data: 0.02MB + Index: 0.05MB + Engine InnoDB pka_wfcrawlers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wffilechanges: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wffilemods: Data: 4.52MB + Index: 0.00MB + Engine InnoDB pka_wfhits: Data: 0.14MB + Index: 0.05MB + Engine InnoDB pka_wfhoover: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_wfissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pka_wfknownfilelist: Data: 2.52MB + Index: 0.00MB + Engine InnoDB pka_wflivetraffichuman: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_wflocs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wflogins: Data: 0.45MB + Index: 0.16MB + Engine InnoDB pka_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wfnotifications: Data: 0.06MB + Index: 0.00MB + Engine InnoDB pka_wfob_stats: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pka_wfocu_event: Data: 0.02MB + Index: 0.05MB + Engine InnoDB pka_wfocu_event_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wfocu_session: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_wfpendingissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pka_wfreversecache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wfsnipcache: Data: 0.02MB + Index: 0.05MB + Engine InnoDB pka_wfstatus: Data: 0.17MB + Index: 0.13MB + Engine InnoDB pka_wftrafficrates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_woocommerce_square_customers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wpr_rucss_resources: Data: 3.52MB + Index: 0.06MB + Engine InnoDB pka_wpr_rucss_used_css: Data: 0.02MB + Index: 0.05MB + Engine InnoDB pka_wt_iew_action_history: Data: 0.19MB + Index: 0.00MB + Engine InnoDB pka_wt_iew_cron: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wt_iew_ftp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wt_iew_mapping_template: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_campaign: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_campaign_list: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_custom_field: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_email: Data: 0.05MB + Index: 0.00MB + Engine InnoDB pka_wysija_email_user_stat: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_email_user_url: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_form: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_list: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_queue: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_wysija_subscriber_ips: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_wysija_url: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_url_mail: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_user: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_wysija_user_field: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_user_history: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_wysija_user_list: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pka_yith_wcwl: Data: 0.06MB + Index: 0.02MB + Engine InnoDB pka_yith_wcwl_lists: Data: 0.05MB + Index: 0.03MB + Engine InnoDB pka_yoast_indexable: Data: 1.52MB + Index: 1.03MB + Engine InnoDB pka_yoast_indexable_hierarchy: Data: 0.14MB + Index: 0.25MB + Engine InnoDB pka_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pka_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pka_yoast_seo_links: Data: 0.08MB + Index: 0.03MB + Engine InnoDB ### Post Type Counts ### attachment: 223 custom_css: 1 elementor_library: 14 faq: 10 member: 5 nav_menu_item: 101 oembed_cache: 16 page: 21 porto_builder: 10 post: 1 postman_sent_mail: 250 product: 92 product_variation: 256 saswp: 1 schema: 2 seedprod: 1 shop_coupon: 76 shop_order: 2066 shop_order_refund: 19 wfacp_checkout: 2 wffn_ty: 2 wfocu_funnel: 2 wfocu_offer: 2 wpcf7_contact_form: 1 wpforms: 1 wysijap: 1 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (1) ### WooCommerce: by Automattic – 6.1.1 ### Inactive Plugins (41) ### Advanced Order Export For WooCommerce: by AlgolPlus – 3.2.2 Code Snippets: by Code Snippets Pro – 2.14.3 Download Plugins and Themes from Dashboard: by WPFactory – 1.8.1 Duplicator: by Snap Creek – 1.4.3 Flexible Shipping: by WP Desk – 4.11.2 Free shipping notification WooCommerce Pro: by PI Websolution – 1.4.7.1 GDPR Cookie Consent: by WebToffee – 2.0.8 Hide free shipping bar when cart empty: by PI Websolution – 1.1 Insert Headers and Footers: by WPBeginner – 1.6.0 Invoices for WooCommerce: by Bas Elbers – 3.1.9 Klarna On-Site Messaging for WooCommerce: by krokedil klarna – 1.6.0 Klarna Order Management for WooCommerce: by klarna krokedil – 1.6.8 Klarna Payments for WooCommerce: by krokedil klarna automattic – 2.8.1 MonsterInsights - Ads Addon: by MonsterInsights Team – 1.6.0 MonsterInsights - eCommerce Addon: by MonsterInsights Team – 8.3.0 MonsterInsights - Page Insights Addon: by MonsterInsights Team – 1.4.0 MonsterInsights Pro: by MonsterInsights – 8.3.0 Omnisend for Woocommerce: by Omnisend – 1.7.5 Packlink PRO Shipping: by Packlink Shipping S.L. – 3.2.5 Porto Theme - Functionality: by P-Themes – 2.2.2 Post SMTP: by Yehuda Hassine – 2.0.23 Product Feed ELITE for WooCommerce: by AdTribes.io – 3.2.5 Product Notices for WooCommerce: by CloudRedux – 1.1.1 REVIEWS.io for WooCommerce: by Reviews.co.uk – 0.20 SlingBlocks – Gutenberg Blocks by WooFunnels: by BuildWooFunnels – 1.0.0 Stock Manager for WooCommerce: by StoreApps – 2.8.3 Tidio Chat: by Tidio Ltd. – 5.0.0 Trustpilot-reviews: by Trustpilot – 2.5.888 WooCommerce Cart Abandonment Recovery: by CartFlows Inc – 1.2.13 WooCommerce Product Attachment: by theDotstore – 2.1.1 WooCommerce Stripe Gateway: by WooCommerce – 6.0.0 Woo Discount Rules: by Flycart – 2.3.12 Woo Discount Rules PRO 2.0: by Flycart – 2.3.12 WooFunnels Funnel Builder: by BuildWooFunnels – 1.11.1 WooFunnels Funnel Builder Pro: by BuildWooFunnels – 1.14.3 Wordfence Security: by Wordfence – 7.5.7 WPForms Lite: by WPForms – 1.7.2 WP Rocket: by WP Media – 3.10.6 YITH WooCommerce Ajax Search: by YITH – 1.14.0 YITH WooCommerce Wishlist: by YITH – 3.5.0 Yoast SEO: by Team Yoast – 17.9 ### Dropin Plugins (1) ### advanced-cache.php: advanced-cache.php ### Settings ### API Enabled: – Force SSL: – Currency: GBP (£) 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: – ### WC Pages ### Shop base: #7 - /shop/ Basket: #8 - /cart/ Checkout: #9 - /checkout/ My account: #10 - /my-account/ Terms and conditions: #2328 - /terms-conditions/ ### Theme ### Name: Storefront Version: 3.9.1 Author URL: https://woocommerce.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: – ### Action Scheduler ### Complete: 9,774 Oldest: 2021-12-25 09:39:39 +0000 Newest: 2022-01-24 15:58:01 +0000 Failed: 2 Oldest: – Newest: – Pending: 8 Oldest: 2022-01-24 16:03:01 +0000 Newest: 2022-02-06 00:01:29 +0000 ### Status report information ### Generated at: 2022-01-24 16:02:47 +00:00
Hi Maykato
Please let me know if I have done this right,
Thank you
Hey,
Could anyone help with this?
Thanks
Hi @pipin3000,
Thanks for reporting this issue!
It sounds like this may be a bug that you’ll want to report at GitHub. The developers use GitHub for issues like this one. You can open up a new bug report here:
https://github.com/woocommerce/woocommerce/issues/new/choose
Something similar was raised on this thread where developers confirmed it was working correctly at the front end and the issue only happened when admin created a manual order.
Using the latest WooCommerce core version apparently, it doesn’t work on the front end either, so you might want to reference that thread to allow developers to take a closer look.
Cheers.
- The topic ‘Give error message when a user tries using multiple coupon codes.’ is closed to new replies.