$this->load->model('openbay/amazon_listing');
$this->load->language('openbay/amazon_listing');
$error = '';
if (empty($this->request->post['search_string'])) {
$error = $this->language->get('error_text_missing');
}
if (empty($this->request->post['marketplace'])) {
$error = $this->language->get('error_marketplace_missing');
}
if ($error) {
$json = array(
'data' => '',
'error' => $error,
);
} else {
$json = array(
'data' => $this->model_openbay_amazon_listing->search($this->request->post['search_string'], $this->request->post['marketplace']),
'error' => '',
);
}
$this->response->setOutput(json_encode($json));