Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Order Total GV Not Working and Breaking in Admin

    Hi guys, ages since I upgraded now to 1.5.1 but only just noticed this since I went to add a new order total module.

    first I noticed that the admin side of order total is vroken and doesnt show the options to add and remove the modules then now ive gone and looked through checkout i notice that the gift voucher redeem bit has dissapeared, though I could have sworn this was working after my upgrade so a bit confused as to when this has gone wrong.

    the error I get is this when I go to the admin settings:
    [20-Aug-2013 10:08:59 UTC] PHP Fatal error: Call to a member function format() on a non-object in /home/site/public_html/includes/modules/order_total/ot_gv.php on line 49

    I have replaced the
    public_html/includes/modules/order_total/ot_gv.php
    file with a fresh copy from a new downlaod and it still does the same.

    any ideas whats causing this?

    thanks
    Phil Rogers
    A problem shared is a problem solved.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Order Total GV Not Working and Breaking in Admin

    Hmmmm...
    Try removing the class. part from line 12 of /admin/includes/init_includes/init_currencies.php:
    Code:
      require(DIR_FS_CATALOG . DIR_WS_CLASSES . 'class.currencies.php');
    .

    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.

  3. #3
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Order Total GV Not Working and Breaking in Admin

    No thats made no difference

    Its really weird. I've seen lots of posts seeming to be related to the same error but some of them are saying they fixed it by refreshing cache etc. I tried that and nothing changed but i really cant see how cache could affect the server function.

    It was defiantly working about a month a go as my wife processes internal orders using gift certificate redemption. and since her last one we not longer get the redemption part on the checkout payment page (assumably to do with this error).

    Like I said I only noticed the error when I went to enable a new order total module and the admin screen wasn't rendering properly and I checked the error log files to see the above error.

    I also removed the new order total mod incase it was that that was causing a conflict but it made no difference.

    when I renamed the ot_gv.php to ot_gv.bak the admin setting page comes back to life with the other mods etc but obviously this is no good as I no longer have the gift certificate stuff during checkout

    The only thing I wondered was a while back my host disabled some vulnerable functions on my server but I asked them to check that this would not cause this and they don't believe it could be.

    Any other suggestions? Really need the gv stuff for internal order processing.

    Cheers

    Phil
    Phil Rogers
    A problem shared is a problem solved.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Order Total GV Not Working and Breaking in Admin

    Well, the cause of that specific error message is that the $currencies variable isn't set correctly to be an object created from the currencies class.
    Perhaps that can guide you in your investigation of why your site is having 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.

  5. #5
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Order Total GV Not Working and Breaking in Admin

    I really don't have the first clue where to start looking. Would you be able to give me some suggestions on places to check? Maybe see if there is a way to debug to prove that by manually setting a variable or something to see if it fixes the problem?

    Really have no idea how this can have happened as nothing has been changed since it was last known to be working.
    Phil Rogers
    A problem shared is a problem solved.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Order Total GV Not Working and Breaking in Admin

    I suppose you could remedy it by making the following change to the beginning of line 49 in /includes/modules/order_total/ot_gv.php
    Code:
        if (IS_ADMIN_FLAG === FALSE) $this->checkbox = ... keep the rest of the line intact ...
    .

    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.

  7. #7
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Order Total GV Not Working and Breaking in Admin

    Quote Originally Posted by DrByte View Post
    I suppose you could remedy it by making the following change to the beginning of line 49 in /includes/modules/order_total/ot_gv.php
    Code:
        if (IS_ADMIN_FLAG === FALSE) $this->checkbox = ... keep the rest of the line intact ...
    OK that seems to have fixed it. very odd indeed.

    I can now access the admin options and its now started appearing in the checkout pages and credit is applied to the order when selected.

    Question is by adding that statement what is that doing? is that going to stop anyting else from working? and it still doesnt make sense as to why this needs changing all of a sudden?

    Seems to work though so is it safe to leave with your tweek do you think?
    Phil Rogers
    A problem shared is a problem solved.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Order Total GV Not Working and Breaking in Admin

    That change is safe, and is incorporated as part of the upcoming v1.6.0 release.
    .

    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.

  9. #9
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Order Total GV Not Working and Breaking in Admin

    ok cool thanks. very confused as to why its just suddenly needed this though?

    what is that line of code actually doing/for? and what is the addition that you got me to apply doing to it?

    hope you don't mind answering, I like to try and understand these things..
    Phil Rogers
    A problem shared is a problem solved.

  10. #10
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,550
    Plugin Contributions
    70

    Default Re: Order Total GV Not Working and Breaking in Admin

    There are a couple of issues here:
    1) class.currencies.php does not exist
    2) /admin/includes/init_includes/init_currencies.php is never included and is missing in /admin/includes/auto_loaders/config.core.php

    Possible fix:
    1) change class.currencies.php to currencies.php in /admin/includes/init_includes/init_currencies.php
    2) add the following to /admin/includes/auto_loaders/config.core.php:
    PHP Code:
      $autoLoadConfig[120][] = array('autoType'=>'init_script',
                                     
    'loadFile'=> 'init_currencies.php'); 
    DrByte, can you confirm this is okay to do?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 8 Apr 2015, 01:23 PM
  2. v139h Shipping, order total and payment modules not activated
    By devyani in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 1 Mar 2013, 11:14 AM
  3. Orders in Admin and order email not working
    By TeeGee in forum Upgrading from 1.3.x to 1.3.9
    Replies: 5
    Last Post: 28 Sep 2011, 05:36 PM
  4. Zencart order total does not match total at monsterpay
    By momoftwo in forum Addon Payment Modules
    Replies: 1
    Last Post: 12 Mar 2010, 02:33 PM
  5. Sub Total not matching actual total of products in order
    By PadreHomer in forum General Questions
    Replies: 0
    Last Post: 10 Sep 2008, 11:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR