• Resolved petervdeynde

    (@petervdeynde)


    Hi there,

    I’m having some trouble with a coupon code that’s restricted by email. When I try to use it on the shopping cart page, I get an error saying, “Enter a valid email address at checkout to use voucher code ‘mama10’.” Even when I enter a valid email address at checkout, the coupon still doesn’t apply to the price.

    Any idea why this might be happening? From what I understand, the coupon should apply, and then at checkout, it should verify if the email address is valid for the coupon.

    https://snipboard.io/Itu1nV.jpg

    Thanks!

    EDIT: I just noticed something – the coupon code does work when I’m logged in as a customer. So, when I’m logged in, the coupon gets applied correctly on the shopping cart page.

    • This topic was modified 9 months, 2 weeks ago by petervdeynde.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi @petervdeynde,

    Thank you for reaching out to us at WooCommerce Support. I understand you’re experiencing trouble with the coupon code. It’s interesting that the coupon code ‘mama10’ works when you’re logged in. This suggests that the coupon settings might be correct, but there could be a hiccup when it’s applied by non-logged-in users. Here are a few steps we can take to troubleshoot this:

    1. Check Email Restrictions: Please verify the email list under WooCommerce > Coupons > Edit Coupon to ensure it’s correct.
    2. Usage Restrictions: Look for any other conditions that might be blocking the coupon under the Usage Restriction tab.
    3. Plugin/Theme Conflict: Temporarily disable other plugins and switch to a default theme like Storefront to see if that resolves the issue.
    4. System Status: Go to WooCommerce > Status to check for any alerts.

    If the problem persists, please let me know if the coupon has any product/category restrictions or usage limits.

    Looking forward to your update.

    Thread Starter petervdeynde

    (@petervdeynde)

    Hi @afzalpansuvi ,

    Thanks for your help. I tried all the troubleshooting steps you suggested, but the problem is still there.

    I also tested with the classic WooCommerce cart page using the shortcode, but the same error happens when entering the coupon code.

    The only thing I noticed in the status report is that it says the shopping cart page doesn’t have the [woocommerce_cart] shortcode or WooCommerce cart block, even though it does have the WooCommerce cart block.

    Looking forward to your advice.

    Thanks!
    
    Status rapport:
    
    
    
    
     WordPress Environment
    
    WordPress address (URL): https://poppypresents.be
    Site address (URL): https://poppypresents.be
    WC Version: 8.9.1
    REST API Version: ? 8.9.1
    Action Scheduler Version: ? 3.7.4
    Log Directory Writable: ?
    WP Version: 6.5.3
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: nl_NL
    External object cache: ? Server Environment
    
    Server Info: Apache
    PHP Version: 8.2.19
    PHP Post Max Size: 256 MB
    PHP Time Limit: 300
    PHP Max Input Vars: 20000
    cURL Version: 7.74.0
    OpenSSL/1.1.1n
    
    SUHOSIN Installed: –
    MySQL Version: 5.7.44-49-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: 8.9.1
    WC Database Prefix: wp_
    Totale database grootte: 34.63MB
    Database gegevens grootte: 29.69MB
    Database index grootte: 4.94MB
    wp_woocommerce_sessions: Data: 0.14MB + 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.06MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_order_itemmeta: Data: 0.27MB + Index: 0.27MB + 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.05MB + 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.38MB + Index: 0.38MB + 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.17MB + Engine InnoDB
    wp_alp_pickup_location: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_comments: Data: 0.09MB + Index: 0.09MB + Engine InnoDB
    wp_duplicator_packages: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_mollie_pending_payment: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_options: Data: 5.09MB + Index: 0.19MB + Engine InnoDB
    wp_pimwick_gift_card: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_pimwick_gift_card_activity: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_postmeta: Data: 3.52MB + Index: 1.92MB + Engine InnoDB
    wp_posts: Data: 18.52MB + Index: 0.30MB + 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.06MB + Index: 0.05MB + Engine InnoDB
    wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_usermeta: Data: 0.09MB + Index: 0.06MB + Engine InnoDB
    wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_admin_notes: Data: 0.08MB + Index: 0.00MB + Engine InnoDB
    wp_wc_admin_note_actions: Data: 0.06MB + 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.05MB + 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.05MB + 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.06MB + 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_wfpklist_template_data: Data: 0.06MB + Index: 0.00MB + Engine InnoDB
    wp_wpforms_logs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wpforms_payments: Data: 0.02MB + Index: 0.14MB + Engine InnoDB
    wp_wpforms_payment_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wpforms_tasks_meta: 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 Post Type Counts
    
    attachment: 762
    custom_css: 2
    customize_changeset: 5
    mc4wp-form: 1
    nav_menu_item: 43
    page: 15
    post: 6
    product: 316
    product_variation: 59
    revision: 372
    shop_coupon: 9
    shop_order: 82
    shop_order_refund: 1
    wp_block: 1
    wp_global_styles: 2
    wp_navigation: 1
    wpforms: 2
    xlwcty_thankyou: 1 Security
    
    Secure connection (HTTPS): ?
    Hide errors from visitors: ? Active Plugins (22)
    
    Blocksy Companion (Premium): door CreativeThemes – 2.0.48
    Advanced Local Pickup for WooCommerce: door zorem – 1.6.4
    Akismet Anti-spam: Spam Protection: door Automattic - Anti-spam Team – 5.3.2
    Clone Woo Orders - Free by WP Masters: door WP Masters – 1.0.3
    Facebook for WooCommerce: door Facebook – 3.2.2
    Site Kit by Google: door Google – 1.127.0
    Kadence WooCommerce Email Designer: door Kadence WP – 1.5.12
    Custom Login Page Customizer: door Hardeep Asrani – 2.3.2
    MC4WP: Mailchimp for WordPress: door ibericode – 4.9.13
    Mollie Payments for WooCommerce: door Mollie – 7.5.3
    WooCommerce PDF-facturen, pakbonnen, leveringsbonnen en verzendlabels: door WebToffee – 4.5.1
    PW WooCommerce Gift Cards Pro: door Pimwick
    LLC – 1.481
    
    Stackable - Gutenberg Blocks: door Gambit Technologies
    Inc – 3.12.16
    
    Stock Exporter for WooCommerce: door PT Woo Plugins (by Webdados) – 1.3
    Transi?nten manager: door WPBeginner – 2.0.5
    W3 Total Cache: door BoldGrid – 2.7.2
    WC MyParcel Belgium: door Richard Perdaan – 4.5.5-beta
    NextMove Lite - Thank You Page for WooCommerce: door XLPlugins – 2.18.3
    PDF Invoices & Packing Slips for WooCommerce: door WP Overnight – 3.8.2
    WooCommerce: door Automattic – 8.9.1
    WP Mail SMTP: door WP Mail SMTP – 4.0.1
    WPForms Lite: door WPForms – 1.8.8.3 Inactive Plugins (1)
    
    Duplicator: door Duplicator – 1.5.9 Dropin Plugins ()
    
    advanced-cache.php: advanced-cache.php
    db.php: db.php
    object-cache.php: object-cache.php Settings
    
    API Enabled: –
    Force SSL: –
    Currency: EUR (€)
    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: –
    Enforce Approved Product Download Directories: –
    HPOS feature enabled: –
    Order datastore: WC_Order_Data_Store_CPT
    HPOS data sync enabled: – Logging
    
    Enabled: ?
    Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2
    Retention period: 30 dagen
    Level threshold: –
    Log directory size: 363 KB WC Pages
    
    Winkelbasis: #17 - /shop/
    Winkelwagen: ? Pagina heeft geen [woocommerce_cart] shortcode of het woocommerce/cart blok.
    Afrekenen: #19 - /checkout/
    Mijn account: #20 - /my-account/
    Algemene voorwaarden: #1596 - /algemene-voorwaarden/ Theme
    
    Name: Blocksy Child
    Version: (update naar versie 0 is beschikbaar)
    Author URL:
    Child Theme: ?
    Parent Theme Name: Blocksy
    Parent Theme Version: 2.0.48
    Parent Theme Author URL: https://creativethemes.com
    WooCommerce Support: ? Templates
    
    Overrides: blocksy/woocommerce/cart/cart.php
    blocksy/woocommerce/cart/mini-cart.php
    blocksy/woocommerce/content-widget-product.php
    blocksy/woocommerce/content-widget-reviews.php
    blocksy/woocommerce/myaccount/my-account.php
    blocksy/woocommerce/product-searchform.php
    blocksy/woocommerce/single-product/tabs/tabs.php Pimwick Plugins
    
    PW WooCommerce Gift Cards Pro: License key: PW-64df366c10b41
    Result: success
    Cached: 2024-05-23 Admin
    
    Enabled Features: activity-panels
    analytics
    product-block-editor
    coupons
    core-profiler
    customize-store
    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
    product-virtual-downloadable
    product-external-affiliate
    product-grouped
    product-linked
    product-pre-publish-modal
    product-custom-fields
    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: minified-js
    new-product-management-experience
    settings
    async-product-editor-category-field
    launch-your-store
    
    Daily Cron: ? Next scheduled: 2024-05-23 13:05:24 +00:00
    Options: ?
    Notes: 113
    Onboarding: completed Action Scheduler
    
    Afgerond: 1.174
    Oldest: 2024-04-22 13:32:46 +0000
    Newest: 2024-05-23 12:02:33 +0000
    
    Mislukt: 6
    Oldest: 2023-07-26 13:06:31 +0000
    Newest: 2024-05-23 11:45:13 +0000
    
    In afwachting: 9
    Oldest: 2024-05-23 16:38:44 +0000
    Newest: 2024-05-24 11:51:36 +0000 Status report information
    
    Generated at: 2024-05-23 12:20:42 +00:00
    
    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello petervdeynde

    Thank you for your reply.

    Let’s try these steps:

    1- Clear the cache in the W3 Total Cache plugin and then disable it completely.
    Usually, if something works when logged in and does not work when logged in, it means caching is at play.

    2- If the problem persists, create a new coupon with no usage limits and see if that behaves the same way as this one. This will clarify whether the problem is specific to this coupon or is occurring with all coupons.

    Also, could share a screenshot of the Usage Limits of the coupon?
    Here is our guide for the configuration of Coupons.

    I look forward to your response. ??

    Best regards.

    Thread Starter petervdeynde

    (@petervdeynde)

    Hi @doublezed2 Zubair Zaid,

    Thanks for your assistance.

    I had tried clearing the cache and disabling the caching plugin before, but it didn’t help. I tried again just to be sure, but still no luck. Now that you mention it, I do have Redis caching enabled on the server, so that might be a factor. It’s strange because the coupons have always worked perfectly before with Redis caching and the W3 Total Cache plugin enabled. This issue only started showing up recently.

    I also created a new coupon with no usage limits, and that one works fine, so it seems related to the allowed email address usage limit.

    Here are the screenshots of the Usage Limits for the coupon:

    https://snipboard.io/i68ovy.jpg

    https://snipboard.io/vqNxVp.jpg

    https://snipboard.io/IA2O8l.jpg

    Only the allowed email address is changed; the rest are just the standard settings.

    Looking forward to your thoughts!

    • This reply was modified 9 months, 2 weeks ago by petervdeynde.

    Hey, @petervdeynde!

    Thanks for the screenshots and information.

    Let me go back to the start for a second.

    Any idea why this might be happening? From what I understand, the coupon should apply, and then at checkout, it should verify if the email address is valid for the coupon.

    As I understand, the coupon has email restriction and the issue you are facing is that, when you are not logged in, you are not able to use it on the cart page, correct? But if you add it to the checkout after adding the correct email it works?
    If this is the case, please note that this is working as expected. If a coupon has an email restriction it should only work on the cart page if you are logged in. If you aren’t, the message asks you to add it to the checkout page.

    I also created a new coupon with no usage limits, and that one works fine, so it seems related to the allowed email address usage limit.

    I just tested this on my website and even without usage limits it did not work, which was expected.

    Did the coupon with email restriction, but no usage limits, work on the cart page while you were not logged in?

    Looking forward to your reply.

    Have a wonderful day!

    Thread Starter petervdeynde

    (@petervdeynde)

    Hello @carolm29 ,

    Thanks for your assistance.

    “As I understand, the coupon has email restriction and the issue you are facing is that, when you are not logged in, you are not able to use it on the cart page, correct? But if you add it to the checkout after adding the correct email it works?
    If this is the case, please note that this is working as expected. If a coupon has an email restriction it should only work on the cart page if you are logged in. If you aren’t, the message asks you to add it to the checkout page.”

    The issue with this is that I don’t have a coupon field on the checkout page where it should be, so there’s nowhere else to enter it except on the cart page.

    https://snipboard.io/9x3ckN.jpg

    Looking forward to your thoughts on this.

    • This reply was modified 9 months, 1 week ago by petervdeynde.
    Thread Starter petervdeynde

    (@petervdeynde)

    Hello,

    Thanks for the assistance. I found the problem! I missed a setting in the customizer that lets me hide or show the coupon code form on the checkout page. I’ve enabled it now, so customers can enter the coupon code at checkout along with the correct email address.

    Thanks and kind regards,

    Peter

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @petervdeynde,

    Thanks for the assistance. I found the problem! I missed a setting in the customizer that lets me hide or show the coupon code form on the checkout page. I’ve enabled it now, so customers can enter the coupon code at checkout along with the correct email address.

    Thank you for sharing those additional details, as those may help other merchants in the same situation.

    Feel free to start a new thread if you have any more questions.

    Cheers!
    -OP

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Coupon code not working in shopping cart’ is closed to new replies.