/** * Loads the order status list data */ public function getOrderStatusListAction() { $values = PlentymarketsImportController::getOrderStatusList(); $values[0] = array('status' => 0, 'name' => '---'); ksort($values); $this->View()->assign(array('success' => true, 'data' => array_values($values))); }
protected function getStatus($table, $group) { $rows = Shopware()->Db()->query(' SELECT id, description as `name`, group_concat(pos.plentyID) plentyID FROM `s_core_states` sws left join ' . $table . ' pos ON pos.`shopwareID` = sws.id WHERE sws.`group` = "' . $group . '" group by sws.id ORDER BY sws.`position` ')->fetchAll(); $plentyMU = PlentymarketsImportController::getOrderStatusList(); foreach ($rows as &$row) { if ($row['plentyID']) { $plentyIds = explode(',', $row['plentyID']); $names = array(); foreach ($plentyIds as $plentyId) { $plentyId = str_replace('.0', '', $plentyId); $names[] = $plentyMU[$plentyId]['name']; } $row['plentyName'] = implode(', ', $names); } else { $row['plentyName'] = ''; } } return $rows; }