You are here

function _uc_importer_export_manufacturers in Ubercart 5

Export manufacturers as XML.

1 call to _uc_importer_export_manufacturers()
uc_importer_export in uc_importer/uc_importer.module
Constructs the XML representation of the store from the ids given.

File

uc_importer/uc_importer.module, line 489
XML product importer and exporter.

Code

function _uc_importer_export_manufacturers($manufacturers) {
  $xml = '<manufacturers>';
  foreach ($manufacturers as $tid) {
    $manufacturer = uc_manufacturer_load($tid);
    $xml .= '<manufacturer>';
    $xml .= '<id>' . $manufacturer->tid . '</id>';
    $xml .= '<name>' . htmlspecialchars($manufacturer->name, ENT_QUOTES, "UTF-8") . '</name>';
    $xml .= isset($manufacturer->url) && !empty($manufacturer->url) ? '<url>' . $manufacturer->url . '</url>' : '';
    $xml .= isset($manufacturer->phone_no) && !empty($manufacturer->phone_no) ? '<phone_no>' . $manufacturer->phone_no . '</phone_no>' : '';
    $xml .= isset($manufacturer->fax_no) && !empty($manufacturer->fax_no) ? '<fax_no>' . $manufacturer->fax_no . '</fax_no>' : '';
    $xml .= uc_importer_invoke('export', 'manufacturer', $tid);
    $xml .= '</manufacturer>';
  }
  $xml .= '</manufacturers>';
  return $xml;
}