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 !
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.
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.
brave :) ... well done :)
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.
Bookmarks