I want to add the discount line to an XML link.
I tried a lot, but i dont know what im doing..

if($item == 'discount'){$xml .= ''.htmlspecialchars($order['discount']).''."\n";}
Example: 31.03 (this value is percentage discount)
I want this line to the corn link:
HERE IS THE LINE:

HERE IS THE CODE-.
Code: Select all
<?php
class ModelExtensionModuleXMLExportOrder extends Model {
public function XMLFolder(){
return DIR_SYSTEM.'../xml/';
}
public function XMLFile(){
return DIR_SYSTEM.'../xml/xml_export_order.xml';
}
public function exportOrders($export_items) {
$xml = '';
$xml .= '<'.'?xml version="1.0" encoding="UTF-8"'.'?'.'>'."\n";
$xml .= '<ORDERS>'."\n";
$xml .= '<DATE_CREATED>'.date("Y-m-d H:i",time()).'</DATE_CREATED>'."\n";
$filter = $export_items['filter'];
$price_with_code = false;
/*
if(isset($filter['currency_code']) AND $filter['currency_code'] == 1){
$price_with_code = true;
}
*/
if(isset($filter['order_status']) AND $filter['order_status'] != "-"){
$filter_sql[] = "order_status_id = '".(int)$filter['order_status']."'";
}
if(isset($filter['order_date_start']) || isset($filter['order_date_stop'])){
if(isset($filter['order_date_start']) AND $filter['order_date_start'] != ""){
$filter_sql[] = "date_added >= '".$filter['order_date_start']." 00:00:00'";
}
if(isset($filter['order_date_stop']) AND $filter['order_date_stop'] != ""){
$filter_sql[] = "date_added <= '".$filter['order_date_stop']." 23:59:59'";
}
}
if(isset($filter['order_store']) AND $filter['order_store'] != "-"){
$filter_sql[] = "store_id = '".(int)$filter['order_store']."'";
}
$export_items['xml_export_order_items'][] = 'products';
$sql = "SELECT * FROM `" . DB_PREFIX . "order` WHERE 1 = 1";
if(isset($filter_sql)){
$sql .= " AND ".implode(" AND ",$filter_sql);
}
$query = $this->db->query($sql);
if($query->rows){
foreach($query->rows as $order){
$xml .= '<ORDER>'."\n";
if(isset($export_items['xml_export_order_items'])){
foreach($export_items['xml_export_order_items'] as $item){
if($item == 'order_id'){
$xml .= '<ORDER_ID>'.htmlspecialchars($order['order_id']).'</ORDER_ID>'."\n";
}
/*HERE IS THE LINE*/
if($item == 'discount'){$xml .= '<CUSTOMER_DISCOUNT>'.htmlspecialchars($order['discount']).'</CUSTOMER_DISCOUNT>'."\n";}