Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Checkout Success: How Can I Modify Code to Also Collect and Display Order Total

    Checkout Success: How Can I Modify Code to Also Collect and Display Order Total?????

    // find out the last order number generated for this customer account

    $orders_query = "SELECT * FROM " . TABLE_ORDERS . "
    WHERE customers_id = :customersID
    ORDER BY date_purchased DESC LIMIT 1";

    $orders_query = $db->bindVars($orders_query, ':customersID', $_SESSION['customer_id'], 'integer');

    $orders = $db->Execute($orders_query);

    $orders_id = $orders->fields['orders_id'];

    // use order-id generated by the actual order process
    // this uses the SESSION orders_id, or if doesn't exist, grabs most recent order # for this cust (needed for paypal et al).
    // Needs reworking in v1.4 for checkout-rewrite

    $zv_orders_id = (isset($_SESSION['order_number_created']) && $_SESSION['order_number_created'] >= 1) ? $_SESSION['order_number_created'] : $orders_id;

    $orders_id = $zv_orders_id;


    I need this information passed into a Java Script... Is that possible if the Java Script is not in the CheckoutSucess php files? How would I do that... pass information from the php to a javascript?

    Thank you,

    Shrimp
    Last edited by DrByte; 21 May 2010 at 11:40 PM. Reason: strikethru added, since the code would be a bad choice

  2. #2
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Checkout Success: How Can I Modify Code to Also Collect and Display Order Total

    Okay... found this information http://www.zen-cart.com/forum/showthread.php?t=131900

    How do I get that into a javascript?

  3. #3
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Checkout Success: How Can I Modify Code to Also Collect and Display Order Total

    Let's back WAY up for a bit ... and answer this question first: WHY?
    .

    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.

  4. #4
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Checkout Success: How Can I Modify Code to Also Collect and Display Order Total

    Why? Doing A/B testing on a paid badge service. They say their badge increases order totals and conversions. Need to pass that information into their A/B testing script

  5. #5
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Checkout Success: How Can I Modify Code to Also Collect and Display Order Total

    Okay, yes, the commissions details are what you need, as per the link you posted.
    The code you posted originally would have been a poor choice.

    As for getting it into javascript, you'll have to echo the PHP values into the right spots of the script to get them to appear where needed.
    .

    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.

  6. #6
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Checkout Success: How Can I Modify Code to Also Collect and Display Order Total

    Do you mean it is as simple as this?


    [FONT=Times New Roman]<!-- Begin Page Conversion -->[/FONT]
    [FONT=Times New Roman]<script language="javascript" type="text/javascript">[/FONT]
    [FONT=Times New Roman]<!--[/FONT]

    [FONT=Times New Roman]// Details[/FONT]
    [FONT=Times New Roman]var amTotalOrder = '<?php echo $order_summary['order_subtotal'];?> ';[/FONT]
    [FONT=Times New Roman]var amOrderId = '<?php echo $order_summary['order_number'];?> ';[/FONT]

  7. #7
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Checkout Success: How Can I Modify Code to Also Collect and Display Order Total

    I think the answer to the last question is yes

 

 

Similar Threads

  1. calling the order total on checkout success , also coupons
    By electricshoe in forum General Questions
    Replies: 10
    Last Post: 26 Jan 2013, 02:11 AM
  2. Including Total order Amount and Items on Checkout Success Page
    By brihan in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 28 Feb 2012, 05:48 PM
  3. A variable total order discount ... and also how to change prices en masse
    By mikajlo in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 8 Nov 2006, 05:07 AM

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