v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
This is what I started with:
Code: Select all
public function autocomplete()
{
$json = array();
$this->load->model($this->folder.'/'.$this->extension);
$results = $this->{'model_'.$this->folder.'_'.$this->extension}->getProducts($this->request->get['keyword']);
$this->load->model('tool/image');
foreach ($results as $result) {
$json[] = array(
'id' => $result['product_id'],
'status' => $result['status'],
'image' => $this->model_tool_image->resize(($result['image'] ? $result['image'] : 'no_image.png'), 80, 80),
'name' => strip_tags(html_entity_decode($result['name'].' - '.$result['sku'], ENT_QUOTES, 'UTF-8')));
}
$sort_order = array();
foreach ($json as $key => $value) {
$sort_order[$key] = $value['name'];
}
array_multisort($sort_order, SORT_ASC, $json);
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
Code: Select all
public function autocomplete()
{
$json = array();
if (isset($this->request->get['keyword'])) {
$this->load->model($this->folder.'/'.$this->extension);
$filter_data = array(
'keyword' => $this->request->get['keyword'],
'start' => 0,
'limit' => 10);
$results = $this->{'model_'.$this->folder.'_'.$this->extension}->getProducts($filter_data);
$this->load->model('tool/image');
foreach ($results as $result) {
$json[] = array(
'id' => $result['product_id'],
'status' => $result['status'],
'image' => $this->model_tool_image->resize(($result['image'] ? $result['image'] : 'no_image.png'), 80, 80),
'name' => strip_tags(html_entity_decode($result['name'].' - '.$result['sku'], ENT_QUOTES, 'UTF-8')));
}
}
$sort_order = array();
foreach ($json as $key => $value) {
$sort_order[$key] = $value['name'];
}
array_multisort($sort_order, SORT_ASC, $json);
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
This:
Code: Select all
'name' => strip_tags(html_entity_decode($result['name'].' - '.$result['sku'], ENT_QUOTES, 'UTF-8')));
Code: Select all
'name' => strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')));
Thanks.
v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
Must be your modification / your hack workaround.
It is a simple task - change the 5 to whatever number you want and add a scroll with css.
Search the marketplace - I am pretty sure OSWorX made a free mod for it.
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
https://www.opencart.com/index.php?rout ... _license=0
instead which did create the settings input and worked on all the inputs except this extension that I need it for. It didn't work on this extension because this extension didn't have the limit on it in the controller in the first place to act on. So I put the limit in but still not the result I was looking for. Either way, I found the reason. This developer put the limit in the model query so I changed it there and all is good now.
Do you happen to see the problem with my second issue?
v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
Since you found an extension that could solve your issue, please add: [SOLVED] at the beginning of the subject line on your first post. However, an alternative could of been used by adding an event trigger in this case.Joe1234 wrote: ↑Tue May 17, 2022 6:01 pmI tried osworx's and his didn't work for me for whatever reason on ANY of my inputs it didn't create the setting input, so I used
https://www.opencart.com/index.php?rout ... _license=0
instead which did create the settings input and worked on all the inputs except this extension that I need it for. It didn't work on this extension because this extension didn't have the limit on it in the controller in the first place to act on. So I put the limit in but still not the result I was looking for. Either way, I found the reason. This developer put the limit in the model query so I changed it there and all is good now.
Do you happen to see the problem with my second issue?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 326 guests