Whenever I try to calculate a discount in the checkout process, I get an alert:

"There were problems determinging if any discounts apply. Please try again shortly. If this does not resolve the issue, please call XXX to complete your order."

There are no error messages showing up in the Drupal logs.

Comments

ryangroe’s picture

Assigned: Unassigned » ryangroe
Status: Active » Postponed (maintainer needs more info)

Can you tell me a little more about your system?

1. Full Drupal version
2. Full Ubercart version
3. Database type and version
4. Existing discounts (brief summary of qualifying type, qualifying amount, discount type, discount amount for each)
5. Did you enter a code in the discounts box on the checkout page?

Also, can you please double check that you do not receive any errors in your PHP error log as well. After I get this information I will do my best to duplicate and correct this.

adam_b’s picture

I've updated to the module versions shown below. The checkout now appears to give a correct discount, unless I use the "Click to calculate discounts" button, in which case it gives the same "There were problems..." alert. I can't see any errors in any logs and it's not giving a standard Drupal error - rather an alert in a new window.

1. Drupal v6.10

2. Ubercart 6.x-2.0-beta5
- Ubercart Discounts (Alternative) 6.x-1.0-beta4

3. MySQL 5.0.67

4. Discounts
- Buy 5 handbooks, get 1 free
- Minimum quantity = 6
- Free items = 1
- Requires single product to qualify

5. No code - haven't figured out how to use that yet.

ryangroe’s picture

StatusFileSize
new5 KB

The alert box is necessary because the full page does not reload. I might make this a jQuery dialog box later.

I created a test JS file for you. This is meant just for you to debug this problem. Please rename your current uc_discounts.js file, put this in its place (remove the ".txt" that got added), clear your browser's cache, and try again. Then let me know what the alert error message says. Then put the original JS file back.

This file will not fix the problem. It is just meant for debugging.

adam_b’s picture

Done - the alert error message now says:

error2:There were problems determining if any discounts apply. Please try again shortly.
If this does not resolve the issue, please call [number] to complete your order.: TypeError: Object expected

ryangroe’s picture

Sorry, adam. I've been out of town. I am looking into this right now and I will have more information for you shortly.

ryangroe’s picture

StatusFileSize
new5.84 KB

Here is a new test file. This might fix the problem or it will hopefully provide additional information for debugging. Thank you for your patience.

adam_b’s picture

Okay, this appears to work for me now - the discounts are calculated correctly and I don't get error messages of any kind. One caveat - I'm not using any codes, so something else might appear - but for the moment it looks good.

Many thanks.

ryangroe’s picture

Great. I think the problem is that sometimes the AJAX call produces no results and now the JS code properly handles that case.

I will release this change as part of the new beta 5 to be released shortly.

ryangroe’s picture

Status: Postponed (maintainer needs more info) » Needs review

Please try beta 5 to see if this problem has been fixed.

ezra-g’s picture

Status: Needs review » Fixed

This has been committed, so I'm marking it as fixed ;).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

benstallings’s picture

I just upgraded Ubercart to 2.0 this morning and am now having the problem described in this thread: when a user goes to the checkout page, the error message pops up, and an "Enter discount codes" fieldset appears, despite the fact that there *aren't* currently any discounts available. I'm going to just disable the module for now.

benstallings’s picture

Status: Closed (fixed) » Active

Just realized I forgot to change the status to active above.

ezra-g’s picture

Status: Active » Closed (fixed)

Thanks for your interest here. This error showing up without discounts is a different issue from it showing up with discounts. Please file a new issue. Thanks!

pyxio’s picture

I just upgraded and am having the same problem :o(

pyxio’s picture

Will this be addressed anytime soon? Or must I revert to a different discounts module? Thanks. Kevin

pareen’s picture

Same problem with me. But I think it is a potential conflict with some other module. Using 6.x-2.4.

The popup says: error2: There were problems determining if any discounts apply....

pareen’s picture

I am facing this problem when discounts are on.

pareen’s picture

Status: Closed (fixed) » Active
StatusFileSize
new633.22 KB

Attaching a screenshot of firefox debug. It is a javascript problem. But I couldnt figure out whats causing it or how to rectify.

Site is at www.ancientyouthsecret.com if someone wants to check it live.

pareen’s picture

While doing some tests, I just noted that this error doesnt show up when the user is logged in. It shows up only when a user is not authenticated.

Any reason why this must be happening?