Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Get order value on checkout_success page

    I'm implementing some tracking code (to track the success of my email campaigns) and need to pass the order total (of the order just placed) to JavaScript.

    Does anyone know how I can grab the order total with PHP from the checkout_success page?

    Thanks in advance,

    Alex

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Get order value on checkout_success 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.

  3. #3
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Get order value on checkout_success page

    Thanks DrByte!

  4. #4
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Get order value on checkout_success page

    Ok, so I ran into a few problems.

    I was unable to create a variable (which could be accessed on the checkout_success page) containing the total order value.

    So, I decided to pass it to the checkout_success page in the query string.

    Currently I'm using the following code, on line 32 of the checkout_process header_php.php file.

    Code:
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS, 'amount=' . number_format($_SESSION['order_summary']['order_total'], '2', '.', ''), 'NONSSL'));
    While the above code correctly updates the query string it doesn't redirect to a regular http version of checkout_success.

    Is there a work around for this?

    Thanks in advance,

    Alex

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Get order value on checkout_success page

    Quote Originally Posted by Alex Clarke View Post
    I was unable to create a variable (which could be accessed on the checkout_success page) containing the total order value.
    Oops. If you're using v1.3.8/a then in your template you'll need to make a substitution:

    Instead of referring to the data using this:
    $_SESSION['order_summary']...

    Use this:
    $order_summary...

    ie: $order_summary['order_total']
    .

    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.

 

 

Similar Threads

  1. Wrong order number in checkout_success page with RealEx payment module
    By stuartmcmahon in forum Addon Payment Modules
    Replies: 5
    Last Post: 28 Sep 2010, 09:50 PM
  2. Order Details on Checkout_success page?
    By samar777 in forum General Questions
    Replies: 3
    Last Post: 19 Aug 2010, 01:07 AM
  3. how to get the value of order total ?
    By greenlight in forum General Questions
    Replies: 3
    Last Post: 8 Feb 2009, 03:20 AM
  4. how to get the value of order total ?
    By greenlight in forum General Questions
    Replies: 1
    Last Post: 7 Feb 2009, 09:23 AM
  5. How to get total sum of an order on checkout_success page?
    By breadfan in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 20 Feb 2008, 06:27 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