Forums / All Other Contributions/Addons / Store Credit addon problem - does not complete order when using coupon to zero

Store Credit addon problem - does not complete order when using coupon to zero

Views: 1,430

Results 1 to 14 of 14
19 Oct 2012, 5:49 AM
#1
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Store Credit addon problem - does not complete order when using coupon to zero

The CONTINUE_CHECKOUT_PROCEDURE "confirm the order" link does not show up on the Order Confirmation page (Step 3 of 3) if a discount coupon is used when the order total is zero. The link appears in every other instance to finalize the order. Even if the order total is zero, it works fine. But if I apply a discount coupon, the link to "confirm the order" does not appear and the order cannot be finalized. Once I remove the discount coupon, it works again. Why might someone want to use a discount coupon when their order total is already zero? Because they may be using store credit and they want to use less store credit.

Does anyone know why this might be happening? Does it have something to do with the store credit mod? For now, my only solution is to tell customers they cannot use a discount coupon when they use store credit to bring their order total to zero.

19 Oct 2012, 6:03 AM
#2
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: Store Credit addon problem - does not complete order when using coupon to zero

It only happens with store credit. Not a problem using gift certificates to bring order total to zero. Must be a bug with the store credit mod.

19 Oct 2012, 6:10 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Store Credit addon problem - does not complete order when using coupon to zero

Right, and I think the problem is that your addon is causing a PHP error which prevents the "rest of the page" from drawing, and thus you're encountering the same symptoms as a typical "blank page" issue: http://www.zen-cart.com/content.php?124-blank-page

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Oct 2012, 10:15 PM
#4
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: Store Credit addon problem - does not complete order when using coupon to zero

Thanks, Dr. Byte. I've re-uploaded all of the files to make sure that none were missing. When I checked my hosting control panel area, there is no entry in the server's errorlog of any PHP syntax error. I have not customized the addon at all, so there should be no customization errors. Anywhere else I should take a look?

19 Oct 2012, 10:22 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Store Credit addon problem - does not complete order when using coupon to zero

AvaAdorn:

When I checked my hosting control panel area, there is no entry in the server's errorlog of any PHP syntax error.
That's one place to look.

But if you look at the article I pointed you to, it tells you where Zen Cart logs the PHP errors it encounters. You need to look there too.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Oct 2012, 10:43 PM
#6
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: Store Credit addon problem - does not complete order when using coupon to zero

Thanks, I've checked there too. And the only errors logged there have to do with recaptcha_functions.php (from the Recaptcha addon that I added).

And this is the line that contains the error: echo $recaptcha->output();

I don't know PHP well enough to know what error is in that line. Do you see anything that looks incorrect?

I also did not make any changes to this file. It is the original file.

20 Oct 2012, 12:22 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Store Credit addon problem - does not complete order when using coupon to zero

Two things:

  1. What is the actual error message?
  2. Have you tried turning off the addin that's causing you problems?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Oct 2012, 1:30 AM
#8
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: Store Credit addon problem - does not complete order when using coupon to zero

This is the actual error message: [19-Oct-2012 22:17:09 UTC] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/public_html/admin/includes/functions/extra_functions/recaptcha_functions.php:128) in /home/public_html/includes/functions/sessions.php on line 114
[19-Oct-2012 22:17:09 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/admin/includes/functions/extra_functions/recaptcha_functions.php:128) in /home/public_html/admin/includes/init_includes/init_templates.php on line 28

My thought is, if I turn off the store credit addon, then I can't replicate the problem because I need to bring the order total to zero using store credit, right?

20 Oct 2012, 2:02 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Store Credit addon problem - does not complete order when using coupon to zero

AvaAdorn:

My thought is, if I turn off the store credit addon, then I can't replicate the problem because I need to bring the order total to zero using store credit, right?
I've never used the store-credit addon, so I can't help you there.
I'm trying to help you deal with actual error messages. Someone else can help you with the store-credit addon, perhaps someone who's using it.

AvaAdorn:

This is the actual error message: [19-Oct-2012 22:17:09 UTC] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/public_html/admin/includes/functions/extra_functions/recaptcha_functions.php:128) in /home/public_html/includes/functions/sessions.php on line 114
[19-Oct-2012 22:17:09 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/admin/includes/functions/extra_functions/recaptcha_functions.php:128) in /home/public_html/admin/includes/init_includes/init_templates.php on line 28Those error messages mean you've got blank lines or invalid PHP code on line 128 of that admin recaptcha_functions.php file. Looking up the error message in the FAQs brings this article which explains the next steps: http://www.zen-cart.com/content.php?129-warning-headers-already-sent

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Oct 2012, 3:24 PM
#10
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: Store Credit addon problem - does not complete order when using coupon to zero

This is line 128 of the recaptcha_functions.php file: echo $recaptcha->output();

Do you see anything that looks incorrect? Maybe that it doesn't contain a closing ?>
Do you think that is what it needs? There are no blank lines before or after either.

Here's the code snippet from lines 126 to 130:

if (basename($_SERVER['PHP_SELF']) == 'index.php')
{
echo $recaptcha->output();
}
/* End of file */

I also did not make any changes to this file. It is the original file.

20 Oct 2012, 10:45 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Store Credit addon problem - does not complete order when using coupon to zero

I'm no expert on the recaptcha addon's inner workings. Questions about that should be directed to that plugin's support thread.
But the only reason there'd be an error on the line that does its output would be if that module were missing its necessary components (files).

So, if that's the module that's causing your errors, either remove it or fix it. And the first place to start when fixing a module that's not working properly is by triple-checking that you've actually installed it correctly. And the first place to do that is by making sure all its files have been uploaded, and of course taking care of whatever other requirements that module has ... such as whatever its documentation/instructions mention.
Plus, make sure the module you're using was designed for the version of Zen Cart you're using.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Oct 2012, 1:05 AM
#12
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Store Credit addon problem - does not complete order when using coupon to zero

You didn't say which store credit module you are using, we are using the old one (not with the rewards points) and that one also has a similar error but it does allow checkout. The error comes in that it won't set the credit to $0 but a strange long sequence of numbers and letters which is a math error so I have to go in and reset it to $0 after the sale. We don't use it very often so I have never been motivated to spend the time looking at the code to correct it.

But my guess is this is the type of problem you are having and the code needs to be debugged to set the credit value to $0 when it's depleted. What happens if there is a $10 credit and the order is $20? Will the checkout go through ok?


Zen Cart and it's community are the best!!

22 Oct 2012, 4:56 PM
#13
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: Store Credit addon problem - does not complete order when using coupon to zero

Thanks for the input.

I am using Store Credits and Rewards Points Module v.3.0.5. And in looking it up, it looks like there was an update to it just last month, v.3.1.3. However the bugs it fixes doesn't seem to have anything to do with what I'm seeing. Wonder if I should install the latest update? It does say it's compatible with Zen Cart v.1.3.9 (which is what I'm using).

If there is a $10 credit and the order is $20, the checkout works just fine. It works fine in every instance, whether a discount coupon is redeemed or not. So I don't think that is a problem with my version. The credit value also goes to $0 when it's depleted. The only error I see is the blank page/doesn't draw the rest of the page to confirm the order. And that only happens when there is enough store credit to cover the order and the order total goes to zero AND a discount coupon is redeemed.

23 Oct 2012, 2:14 AM
#14
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Store Credit addon problem - does not complete order when using coupon to zero

Definitely sounds like a php error with what you are describing. If you do this on a test server that is a clone of the live one, turn error reporting on in your php config file so it displays the errors on the page and let us know if there are any error messages and what they are. Seems like there's a logic problem when computing the discount and credit and a $0 balance.


Zen Cart and it's community are the best!!