Forums / General Questions / Change credit card error message at top of page

Change credit card error message at top of page

Locked

Started by windrush on 7 Jan 2009, 9:09 PM · Views: 4,354

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
7 Jan 2009, 9:09 PM
#1
windrush avatar

windrush

New Zenner

Join Date:
Jan 2009
Posts:
1
Plugin Contributions:
0

Change credit card error message at top of page

When someone enters an incorrect credit card number durring checkout they are taken back to this page "https://www.store.com/index.php?main_page=checkout_payment&error_message=There+has+been+an+error+processing+your+credit+card.+Please+try+again.15%2FNo+such+Issuer"

Does anyone know how to change the appearance of this error message that is at the top of the page to make it more noticeable, example red background color? I don't see any css styles applied to this specific page area that I can change.

Thanks in advance for your help.

8 Jan 2009, 4:05 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Change credit card error message at top of page

That will be one of the "Message Stacks" in your css

Zen-Venom Get Bitten

10 Jun 2009, 6:45 AM
#3
shaztesting avatar

shaztesting

New Zenner

Join Date:
Jun 2009
Posts:
71
Plugin Contributions:
0

Re: Change credit card error message at top of page

I have changed all the message stacks and none of the change that error message (at the absolute top of the page). I checked the source and it is displayed without at div or span tags. there is no way to style it without adding those tags.

Which php file is it kept in? The reply seems to come from the payment gateway but there must be a solution to this.

https://www.store.com/index.php?main_page=checkout_payment&error_message=%20-%20Your+credit+card+could+not+be+authorized+for+this+reason.+Please+correct+any+information+and+try+again+or+contact+us+for+further+assistance.&zenid=g8knmj1d59fqhgpfriqbblln63

<div id="mainWrapper">

 - Your credit card could not be authorized for this reason. Please correct any information and try again or contact us for further assistance.

<!--bof-header logo and navigation display-->

<div id="headerWrapper">
11 Jun 2009, 12:09 AM
#5
shaztesting avatar

shaztesting

New Zenner

Join Date:
Jun 2009
Posts:
71
Plugin Contributions:
0

Re: Change credit card error message at top of page

thanks for your help. I did manage to locate where the error massage is saved.

however whenever i add span tags (<span id="warning"></span>) within the php it crashes the entire cart. (500 error)

is there a special way to add span tags? where is it safe to place it?

Line #39 : define('MODULE_PAYMENT_DIRECTONE_TEXT_DECLINED_MESSAGE', 'Your credit card could not be authorized for this reason. Please correct any information and try again or contact us for further assistance.');

Line #300 : zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . $response_text . ' - ' . urlencode(MODULE_PAYMENT_DIRECTONE_TEXT_DECLINED_MESSAGE), 'SSL', true, false));

thanks.

30 Jun 2009, 11:46 PM
#6
checheconleche avatar

checheconleche

New Zenner

Join Date:
Jun 2007
Posts:
14
Plugin Contributions:
0

Re: Change credit card error message at top of page

I am having the same difficulty in attempting to style the declined or error output of the payjunction module. I am wondering how the $messageStack works, do I need to declare it somewhere else. If someone could explain the syntax of $messageStack and add_session(what, what, what) it would really help. Or if someone knows of another payment module that is a good example of this that would be great also.

} else if ($response['dc_response_code']) {
$messageStack->add_session('checkout_payment',DONT KNOW WHAT TO PUT HERE , 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));

1 Jul 2009, 3:47 AM
#7
checheconleche avatar

checheconleche

New Zenner

Join Date:
Jun 2007
Posts:
14
Plugin Contributions:
0

Re: Change credit card error message at top of page

Hey Shaztesting,

After messing with this for a while I believe I have an option for you, kinda messy but I think I got it working.

I went into tpl_header.php and found the code that outputs the error message. (the center "if" statement below)

<?php // Display all header alerts via messageStack: if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) { echo htmlspecialchars(urldecode($_GET['error_message'])); } if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) { echo htmlspecialchars($_GET['info_message']); } else { } ?>

I cut that out of there and wrapped a div tag around it , called it "ccError" and then moved it to the very botttom of the tpl_header.php file, just above the closing php tag. See the code below.

<div id="ccError"> <?php if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) { echo htmlspecialchars(urldecode($_GET['error_message'])); } ?> </div><!--end cc error-->

This way, when that error occurs, it displays below the header rather than at the top, and I can make it big and red. The drawback is that any other error that occurs will also appear with the same style, but I am going to try it for a while and see if it works allright.

Ideally I would like to insert that error within the main page, but I am lost on how to incorporate it into the table layout at this point. Maybe one of the masters can let me know if this is BAD for a reason I have overlooked, but hopefully they are too busy testing the beta of version 2:D

9 Dec 2010, 7:31 PM
#8
ethical avatar

ethical

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Change credit card error message at top of page

hate to drag up an old thread, but this was never really answered. I have changed the css for messagestack yet it does not affect the size, colour etc for the error messages that display in the cart. Can someone please enlighten me as to where these error messages are getting styled. I've searched through the developers toolkit, to no avail, I can't find what files are affecting this style.

I just want to change the Size fot he error message text.

Thanks

John