Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2008
    Posts
    132
    Plugin Contributions
    0

    Default how to get the value of order total ?

    how to get the value of order total ?
    i don't know how use the class of order_total ,
    i want ot direct to get the value of order total .
    please help me ,thanks !
    forum.red-host.cn
    It is a platform for communicate about SEO, Online store.

  2. #2
    Join Date
    Aug 2008
    Posts
    132
    Plugin Contributions
    0

    Default Re: how to get the value of order total ?

    I have done .
    i change the total_order class ,write a funtion by myself,and return the value what i need .
    forum.red-host.cn
    It is a platform for communicate about SEO, Online store.

  3. #3
    Join Date
    Mar 2008
    Posts
    67
    Plugin Contributions
    0

    Default Re: how to get the value of order total ?

    brave :) ... well done :)

  4. #4
    Join Date
    Aug 2008
    Posts
    132
    Plugin Contributions
    0

    Default Re: how to get the value of order total ?

    I use this code:
    --------------------------------------------------------------------------------
    function process() {
    global $order;
    $order_total_array = array();
    if (is_array($this->modules)) {
    reset($this->modules);
    while (list(, $value) = each($this->modules)) {
    $class = substr($value, 0, strrpos($value, '.'));
    if (!isset($GLOBALS[$class])) continue;
    $GLOBALS[$class]->process();
    for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
    if (zen_not_null($GLOBALS[$class]->output[$i]['title']) && zen_not_null($GLOBALS[$class]->output[$i]['text'])) {
    $order_total_array[] = array('code' => $GLOBALS[$class]->code,
    'title' => $GLOBALS[$class]->output[$i]['title'],
    'text' => $GLOBALS[$class]->output[$i]['text'],
    'value' => $GLOBALS[$class]->output[$i]['value'],
    'sort_order' => $GLOBALS[$class]->sort_order);
    }
    }
    }
    }

    return $order_total_array;
    }
    --------------------------------------------------------------------------------
    change to that code:
    --------------------------------------------------------------------------------
    function total_price() {
    global $order;
    $output_string1 = '';
    $order_total_array = array();
    if (is_array($this->modules)) {
    reset($this->modules);
    while (list(, $value) = each($this->modules)) {
    $class = substr($value, 0, strrpos($value, '.'));
    if (!isset($GLOBALS[$class])) continue;
    //$GLOBALS[$class]->process();
    for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
    if (zen_not_null($GLOBALS[$class]->output[$i]['title']) && zen_not_null($GLOBALS[$class]->output[$i]['text'])) {
    $order_total_array[] = array('text' => $GLOBALS[$class]->output[$i]['value']);

    }
    }
    }
    }
    $output_string1= $order_total_array[2]['text'];
    return $output_string1;
    }

    --------------------------------------------------------------------------------
    but use that code has one problem .
    like this :
    --------------------------------------------------------------------------------

    Sub-Total: $21.31

    Sub-Total: $21.31

    Per Item (Best Way): $0.36

    Per Item (Best Way): $0.36

    Total: $21.66

    Total: $21.66


    it appear two total results,because the funtion(total_price) call $GLOBALS[$class]->process() .but don't use $GLOBALS[$class]->process(),it doesn't work .i only need this result(Total: $21.66)'s 21.66 .
    i have to know this order_total class how it work .
    who can help me ? find an easy way to have the total price result .
    Thanks .
    forum.red-host.cn
    It is a platform for communicate about SEO, Online store.

 

 

Similar Threads

  1. how do i get the order total?
    By agelec in forum Addon Payment Modules
    Replies: 1
    Last Post: 13 Oct 2011, 10:04 AM
  2. how to get the value of order total ?
    By greenlight in forum General Questions
    Replies: 1
    Last Post: 7 Feb 2009, 09:23 AM
  3. Can I get the total value of stock of my zen cart?
    By louie in forum General Questions
    Replies: 4
    Last Post: 30 Jun 2008, 01:07 PM
  4. 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
  5. How do I get the total price of the order?
    By volanttantes in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 29 Jun 2007, 12:52 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