Fatal error in credit_cards.php
This is a strange one! When I put something in my cart and try to checkout (from a ZenCart installation v1.3.0.2 on www.skeptic.org.uk/shop) I get the following error:
Fatal error: Call to a member function on a non-object in [zen cart installation]/includes/languages/english/credit_cards.php on line 57
The strange thing is, I consistently see the error when I do this from a particular location (work) but when I tried to reproduce the problem at home it worked perfectly. This is completely reproducible, not intermittent.
Even more interesting, if I connect from work via a proxy the problem disappears. So it's not simply a problem with the software on my work PC (Win2k, IE6 SP1), nor with the time of day or cookies. It seems it must be a speed or firewall issue.
Re: Fatal error in credit_cards.php
More information:
I installed Firefox and tried that and the problem disappeared. So I tried clearing the cache in IE6 and that made no difference. But clearing cookies in IE6 DID apparently fix the problem. So it appears it was a cookie problem after all (maybe I should change the title of this thread?).
So, the question is, how was the bad cookie created, and why wasn't the error recoverable? Sadly I don't think I can recover the offending cookie now but if the problem recurs I will post it.
Re: Fatal error in credit_cards.php
1. What addons/contributions do you have installed?
2. It's likely referring to the $template object, which is not (normally) set based on anything cookie-related, unless you have some sort of multi-template-handling addon etc installed.
Re: Fatal error in credit_cards.php
I don't have any template handling addons installed. The template I use is copied from "classic", with only minor modifications, most notably the charset is changed to utf-8, the width changed to 100%, the colour changed to blue and metric units (kg instead of lbs) used throughout.
I've also modified the e-mail templates to remove links to graphics (because they get blocked by mail clients such as Outlook) but I don't think they're involved in any way here.
The only addon module I have installed is "order_total", for applying discounts based on the total number of items in the cart. I don't think that would have been invoked yet at this stage of the checkout process.
I wonder if the bad cookie was an old one left over from a previous version of Zen Cart? I don't normally access the cart from work so it's possible the cookie was quite old.
Re: Fatal error in credit_cards.php
The error is back! And this time none of the solutions I mentioned above work. Help!
(It's happening consistently on three different installations)
The line that produces the error is:
define('IMAGE_CC_ENABLED_VISA', zen_image($template->get_template_dir('cc1.gif', DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . 'cc1.gif'));
Re: Fatal error in credit_cards.php
Update - after clearing ALL cookies in BOTH IE6 and Firefox the problem went away again. Hmm.
Re: Fatal error in credit_cards.php
I'm getting the same error intermittantly, with the credit_cards.php file listed in the error message. It's not just happening to me, its also happening to a large number of customers. Is there a fix for this, or any idea's on why its happening?
Quite disheartened as I love the zen cart, however, I can't use it if my customers can't access the site.
Of those customers that I know are trying to access the site, I'd say close on 50% of them are unable to and it's not one single network causing the problem, as they are all connecting from various countries. (Previously worked for an ISP so checked that.)
Clearing cookies and cache does solve the problem, however, those that are visiting from a search engine link, I can't tell them that, they believe the site is down, and continue on their way.
the site can be found at http://www.timerealms.net/thyme4you
running ver 1.3.7
I've checked the other thread, with the sessions.php fix in it, and this is already present in the code.
Re: Fatal error in credit_cards.php
if there is another file calling another template then what can be done?
Fatal error: Call to a member function get_template_dir() on a non-object
Re: Fatal error in credit_cards.php
Hello there.
I just installed the portuguese language pack, and when i choose the portuguese language in the dropdown menu in admin pannel, i get this same error:
Fatal error: Call to a member function get_template_dir() on a non-object in (...)/admin/includes/languages/portugues/credit_cards.php on line 46
The file is there, both in the /admin/includes/languages/portugues and includes/languages/portugues. Any help?
Ps: I can work in the admin panel with no problems in english, but is annoying...
Re: Fatal error in credit_cards.php
The admin language files should not include a credit_cards.php file, nor any code that tries to load it.
The credit_cards.php file is for the store-front only.