Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Jul 2010
    Location
    uk
    Posts
    4
    Plugin Contributions
    0

    help question Nochex not clear cart after succesful order (before_process not called)

    HI ALL

    I am running the last 1.39d, with the nochex modules (from nochex update). Php 5.2.

    I am having a strange problem, that after nochex returns back to the checkout_success page the cart/comments/etc is not cleared. (so all order processing has been successful, and success page is shown and everyone gets all the right emails and the order is created)

    It seems to me that the before_process overriden function doesn't get called. (From what I can gather this is the function that clears the Session["cart"] No debug log produced with the debug module

    I have check out the site running under 1.38a, everything runs as it should, cart cleared. I have run beyond compare (diff) between the two versions, checked all the changes, (note: I applied no changes to the nochex code, although they are different as nochex dropped from core in 1.39)

    Other payments systems work, like cheque.

    Being a professional coder, although PHP is not my main language, I'm finding very hard to debug this problem. So I need some pointers on how to debug zen cart.

    I've tried dumping variables to flat file with no success, if I could do that it would help.

    I was also looking to find in which order payment functions get called, am I looking in the right place. Where does the cart get normally cleared?

    any pointers?

    Phil

  2. #2
    Join Date
    Jul 2010
    Location
    uk
    Posts
    4
    Plugin Contributions
    0

    Idea or Suggestion Re: Nochex not clear cart after succesful order (before_process not called)

    Well, I think most of my assumptions were wrong, and before_process() doesn't seem to get called at all for nochex. I really couldn't find out the reason or where the change should go. And to limit me wasting my whole life on this I did what all coders do, I created a kludge. It's not bad as kudges go.

    A small observational class that clears the cart and associated data on reaching successful checkout

    The autoloader, place in includes/auto_loaders
    PHP Code:
    <?php
    // load the clearcart class 
    // This looks like an example I once saw
    // July 2010 - Phil Chandler

    $autoLoadConfig[10][] = array('autoType'=>'class',
                                  
    'loadFile'=>'observers/class.ClearCart.php');
    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
                                  
    'className'=>'ClearCart',
                                  
    'objectName'=>'ClearCart');
    ?>
    the class

    PHP Code:
    <?php

    /*
     * Observer Class for clearing cart after successful nochex transaction
     * July 2010 - Phil Chandler
    */
    class ClearCart extends base {


      
    // Attach for notifies
      
    function ClearCart() {
         
    $this->attach($this, array('NOTIFY_HEADER_END_CHECKOUT_SUCCESS'));
      }

      
    // Update when notified
      
    function update(&$class$eventID) {

        if ( 
    $_SESSION['payment'] == 'nochex_apc')
        {
        
    $_SESSION['cart']->reset(true);
            unset(
    $_SESSION['sendto']);
            unset(
    $_SESSION['billto']);
            unset(
    $_SESSION['shipping']);
            unset(
    $_SESSION['payment']);
            unset(
    $_SESSION['comments']);
            unset(
    $_SESSION['cot_gv']);
        }
       }

    }
    ?>

    This could be used for clearing out the cart for any reason, but here it's just for nochex. The problem seems to exist on a freshly create 1.39 system.

    I hope this will save some one else some time in the future. If you do know why nochex fails to clearout the cart and/or a fix please let me know.

    Phil

  3. #3
    Join Date
    May 2006
    Posts
    35
    Plugin Contributions
    0

    Default Re: Nochex not clear cart after succesful order (before_process not called)

    Thanks for contacting me Phil... I have the addditional problem of the cart not seeing the order at all. I have deleted all the nochex files and the sql and reinstalled from scratch.

    I think there is some data missing or some files missing for 1.3.9d to work...

    Cat

  4. #4
    Join Date
    Jul 2010
    Posts
    15
    Plugin Contributions
    0

    Default Re: Nochex not clear cart after succesful order (before_process not called)

    Thanks for the message, this looks great, could you tell me where I need to place the code?

    Thanks

  5. #5
    Join Date
    Jul 2007
    Posts
    45
    Plugin Contributions
    0

    Default Re: Nochex not clear cart after succesful order (before_process not called)

    Thanks Phil, do both pieces of code go into includes/auto_loaders?

  6. #6
    Join Date
    Jul 2010
    Location
    uk
    Posts
    4
    Plugin Contributions
    0

    Default Re: Nochex not clear cart after succesful order (before_process not called)

    Hi

    Sorry, I thought it was obvious, but obviously not

    the auto loaders code should be place in a file called "config.ClearCart.php" and place is the <root>/includes/auto_loaders

    the class code should be placed in a file called "class.ClearCart.php" and placed in <root>/includes/classes/observers


    Any trouble please post to this thread.

    Phil


    Quote Originally Posted by philchand View Post
    Well, I think most of my assumptions were wrong, and before_process() doesn't seem to get called at all for nochex. I really couldn't find out the reason or where the change should go. And to limit me wasting my whole life on this I did what all coders do, I created a kludge. It's not bad as kudges go.

    A small observational class that clears the cart and associated data on reaching successful checkout

    The autoloader, place in includes/auto_loaders
    PHP Code:
    <?php
    // load the clearcart class 
    // This looks like an example I once saw
    // July 2010 - Phil Chandler

    $autoLoadConfig[10][] = array('autoType'=>'class',
                                  
    'loadFile'=>'observers/class.ClearCart.php');
    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
                                  
    'className'=>'ClearCart',
                                  
    'objectName'=>'ClearCart');
    ?>
    the class

    PHP Code:
    <?php

    /*
     * Observer Class for clearing cart after successful nochex transaction
     * July 2010 - Phil Chandler
    */
    class ClearCart extends base {


      
    // Attach for notifies
      
    function ClearCart() {
         
    $this->attach($this, array('NOTIFY_HEADER_END_CHECKOUT_SUCCESS'));
      }

      
    // Update when notified
      
    function update(&$class$eventID) {

        if ( 
    $_SESSION['payment'] == 'nochex_apc')
        {
        
    $_SESSION['cart']->reset(true);
            unset(
    $_SESSION['sendto']);
            unset(
    $_SESSION['billto']);
            unset(
    $_SESSION['shipping']);
            unset(
    $_SESSION['payment']);
            unset(
    $_SESSION['comments']);
            unset(
    $_SESSION['cot_gv']);
        }
       }

    }
    ?>

    This could be used for clearing out the cart for any reason, but here it's just for nochex. The problem seems to exist on a freshly create 1.39 system.

    I hope this will save some one else some time in the future. If you do know why nochex fails to clearout the cart and/or a fix please let me know.

    Phil

  7. #7
    Join Date
    Jul 2007
    Posts
    45
    Plugin Contributions
    0

    Default Re: Nochex not clear cart after succesful order (before_process not called)

    Hello Phil

    Thanks for thinking I'm that knowledgeable! Unfortunately I'm just a retailer who uses Zen Cart so anything to do with the coding leaves me completely clueless. I've used Zen Cart since 2006, I just don't have the time to learn anything above the normal operation of the site and adding very simple mods. I suspect that the same for a lot of us.

    Thanks for the explanation I'll do that, I really appreciate your effort on this.

  8. #8
    Join Date
    May 2006
    Posts
    35
    Plugin Contributions
    0

    Default Re: Nochex not clear cart after succesful order (before_process not called)

    That seems to clear the cart

    Only thing I don't get now is email of confirmation of order from the admin section of the cart - although I can see the order in admin...

    Thanks,

    Cat

  9. #9
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Nochex not clear cart after succesful order (before_process not called)

    I used this code on a 1.3.9e cart, and it broke the checkout process. When I click Continue on the Step 1 of 3 checkout page, it goes to a blank page. If I remove these two files, the checkout works perfectly again, except that it does not clear the shopping cart.

    Any ideas why this would be happening?

    Thanks!
    Danielle

  10. #10
    Join Date
    Dec 2010
    Posts
    1
    Plugin Contributions
    0

    Default Nochex Shopping Cart

    Hi there I have uploaded the Nochex shopping cart upgrade I was sent from Nochex and an APC Upgrade. My problem is this: In test mode my transaction goes through fine and I received an email frommy site, with what my customer has ordered. In Live, I get the Nochex confirmation, but no email from my website stating what my customer has ordered. Can anyone help??? Thanks Sean

    Ps: Uisng Version v1.3.8h

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Cart not empying after checkout with nochex
    By tjrayner in forum Addon Payment Modules
    Replies: 4
    Last Post: 10 Jul 2010, 11:16 AM
  2. NoChex not giving order details
    By irishshopper in forum Addon Payment Modules
    Replies: 3
    Last Post: 31 May 2010, 12:34 AM
  3. Checkout does not clear the shopping cart
    By generalexotics in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Dec 2009, 06:08 AM

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