• Resolved iamcassim

    (@iamcassim)


    Hi,
    Hope you’re doing well.
    The reason of this thread is that I am facing an issue about adding the products to the cart page as a Guest User.

    Actually, When I am logged In and wanted to place an order on my website while clicking the “Add to cart” button it adds the product to the cart successfully But, When I try to add a product to cart/ place an order as a guest it takes me to the cart page and shows a dialogue “Cart is empty” “Return to the shop”.

    Plz advice, Thanks very much.
    Best Regards,
    Cassim Zafar

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi @iamcassim,

    The reason of this thread is that I am facing an issue about adding the products to the cart page as a Guest User. Actually, When I am logged In and wanted to place an order on my website while clicking the “Add to cart” button it adds the product to the cart successfully But, When I try to add a product to cart/ place an order as a guest it takes me to the cart page and shows a dialogue “Cart is empty” “Return to the shop”.

    From what I understand, you’re having trouble adding products to your cart as a guest on your WooCommerce site. Everything seems to work fine when you’re logged in, but when you try to use the cart as a guest, it shows up as empty. Let’s see if we can fix this problem together!

    Here are some troubleshooting steps you can try:

    1. Update all your plugins and themes: Ensure all your plugins and themes are up-to-date. An old plugin or theme might be conflicting with WooCommerce.
    2. Review Guest Checkout Settings: In the Guest Checkout section, ensure the “Allow customers to place orders without an account” box is ticked. You can find this option under WooCommerce > Settings > Accounts & Privacy > Guest Checkout.
    3. Plugin Conflict: Try deactivating all plugins except WooCommerce and see if the issue persists. If it doesn’t, reactivate your plugins one by one to identify the conflicting ones.
    4. Theme Conflict: Try switching to a default WordPress theme like Storefront and check if the issue remains. If it doesn’t, your theme might be the problem. Here’s a helpful guide on how to test for conflicts: ?? How to Test for Plugin and Theme Conflicts.
    5. Turn on Debugging: If the issue continues, activate debugging in WordPress. This can help pinpoint the problem. Add these lines to your wp-config.php file:
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );

    This will create a debug.log file in your wp-content directory, logging any PHP errors or notices. For a more detailed guide on enabling debugging in WordPress, you can visit this link: ?? Debugging in WordPress

    If the issue continues after trying these steps, please share more details, like the exact error messages you see when debug mode is on. This will help us identify and solve the problem more effectively.

    We’d also appreciate it if you could share your site’s System Status report. This will help us understand your site’s setup better and identify the problem. You can find it via WooCommerce > Status. Select Get system report and then Copy for support.

    Lastly, please share any fatal error logs (if any) under WooCommerce > Status > Logs.

    Once you have all this information, you can 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.

    Thread Starter iamcassim

    (@iamcassim)

    .

    • This reply was modified 1 year, 1 month ago by Jan Dembowski.
    • This reply was modified 1 year, 1 month ago by iamcassim.
    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @iamcassim

    Please do not post large code or responses like that here, it doesn’t work after ~10 lines or so. It broke this topic formatting into a mess.

    If you need share that data please use https://gist.github.com/ or https://pastebin.com/ or the like instead and post the link to that paste.

    Thread Starter iamcassim

    (@iamcassim)

    I apologize

    Thread Starter iamcassim

    (@iamcassim)

    Below is the link where you can check the system status.
    Please check and Advice, Thanks very much.
    https://pastebin.com/embed_js/5qmb3UvK

    Thread Starter iamcassim

    (@iamcassim)

    Anyone there?
    Please help me in finding the issue.??

    Hi @iamcassim,

    Below is the link where you can check the system status. Please check and Advice.

    Thanks for sharing your system status report. I see that you are using the Twenty Twenty-One Child theme and several plugins.

    The first thing I noticed is that many of your WooCommerce templates are outdated. This could be causing the issue with adding products to the cart as a guest user. To fix this, please update your theme and child theme to the latest version and make sure all your templates are up-to-date. Don’t worry, we’ve got a handy guide to help you out with this: ?? Fixing Outdated WooCommerce Templates.

    Also, please ensure that the “Allow customers to place orders without an account” option is enabled under WooCommerce > Settings > Accounts & Privacy > Guest Checkout.

    Image Link: https://snipboard.io/gb2U1N.jpg

    If the issue persists after updating your templates and checking the Guest Checkout setting, it may be a plugin conflict. Try deactivating all plugins except WooCommerce and see if the issue persists. If it doesn’t, reactivate your plugins one by one to identify the conflicting ones. Here’s a helpful guide on how to test for conflicts: ?? How to Test for Plugin and Theme Conflicts.

    If none of the above steps resolve the issue, please enable WP_DEBUG and WP_DEBUG_LOG in your wp-config.php file. This will create a debug.log file in your wp-content directory, logging any PHP errors or notices. Please share any error messages you see when debug mode is on.

    I hope this helps! Let me know if you have any other questions.

    Thread Starter iamcassim

    (@iamcassim)

    But there is no update required for child theme and was required for the parent theme which I did already.

    Hi @iamcassim,

    But there is no update required for child theme and was required for the parent theme which I did already.

    Thank you for your quick response.

    Even though there is no update required for the child theme, sometimes the files in the child theme can become out of sync with the parent theme, especially if the parent theme has been updated. This can cause issues like the one you’re experiencing.

    To ensure this isn’t the case, please check your child theme’s WooCommerce template files. If they are outdated or not in sync with the parent theme, it could cause issues. Here’s a guide on how to do that: ?? Fixing Outdated WooCommerce Templates.

    If after checking and updating (if necessary) the child theme’s WooCommerce templates the issue still persists, it might be related to a plugin conflict. Please try deactivating all plugins except WooCommerce and see if the issue persists. If it doesn’t, reactivate your plugins one by one to identify the conflicting ones.

    If none of these solutions work, enabling WP_DEBUG and WP_DEBUG_LOG in your wp-config.php file will help us further diagnose the issue. This will log any PHP errors or notices that might be causing the issue.

    Please share any error messages you see when debug mode is on. This will help us identify and solve the problem more effectively.

    We appreciate your patience and cooperation in this matter. We’re here to help you get this sorted.

    Thread Starter iamcassim

    (@iamcassim)

    I have fixed the outdated templates for woo commerce but still facing the same issue.

    Hi @iamcassim,

    I have fixed the outdated templates for woo commerce but still facing the same issue.

    Thank you for the update and for taking the time to fix the outdated templates. I’m sorry to hear that you’re still experiencing the same issue.

    Given that the problem persists, it’s likely that there may be a conflict with one of your plugins. Please try deactivating all plugins except for WooCommerce to see if the issue still occurs. If it does not, reactivate your plugins one by one. This should help to identify if a specific plugin is causing the conflict.

    If the issue still persists after checking for plugin conflicts, the next step would be to enable debugging in WordPress. This can help us identify any underlying issues that may be causing the problem.

    To enable debugging, add the following lines to your wp-config.php file:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );

    This will create a debug.log file in your wp-content directory, which will log any PHP errors or notices. Once you’ve enabled debugging, try to reproduce the issue by adding a product to the cart as a guest. If any errors are logged in the debug.log file, please share them with us.

    Finally, could you share any fatal error logs (if any) under WooCommerce > Status > Logs?

    Once you’ve gathered 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.

    Thank you for your patience and cooperation as we work to resolve this issue. We’re here to help you get this sorted out.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Unable to add product as a guest but it adds the product when WP is logged IN’ is closed to new replies.