Post by PaskSant » Tue Sep 21, 2021 10:07 pm

At the moment the search critieria is based only on description and i would like to add also the Model.
There are any methods ( also based on modify the code) that permits to do that? Which modifications?

Newbie

Posts

Joined
Sun Sep 05, 2021 6:06 pm

Post by straightlight » Tue Sep 21, 2021 11:03 pm

OC version. Parking request. Please have a look on the Marketplace or on Google to find out.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by thekrotek » Tue Sep 21, 2021 11:46 pm

If you know some coding, you can do it yourself. The modification is pretty simple.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by mikeinterserv » Wed Sep 22, 2021 1:19 am

You can use the product tags also on the general page of product edit.
Comma seperated list of whatever you want - That's what its for.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by PaskSant » Wed Sep 22, 2021 2:09 am

I think that the code part related to the search criteria is the following one:
<div class="checkbox">
<label class="checkbox-inline">
{% if sub_category %}
<input type="checkbox" name="sub_category" value="1" checked="checked" />
{% else %}
<input type="checkbox" name="sub_category" value="1" />
{% endif %}
{{ text_sub_category }}</label>
</div>

<div class="checkbox">
<label class="checkbox-inline">
{% if description %}
<input type="checkbox" name="description" value="1" id="description" checked="checked" />
{% else %}
<input type="checkbox" name="description" value="1" id="description" />
{% endif %}
{{ entry_description }}</label>
</div>
In order to have as searching criteria the description and the model, i would like to replace the sub_category but i don't understand if there is a variable for the model and which. Could you provide any suggestions?

Newbie

Posts

Joined
Sun Sep 05, 2021 6:06 pm

Post by paulfeakins » Wed Sep 22, 2021 6:41 pm

Search the extension store.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by by mona » Thu Sep 23, 2021 4:29 am

Default OC already searches on model (and more), it just uses an exact match:

Code: Select all

if (!empty($data['filter_name'])) {
				$sql .= " OR LCASE(p.model) = '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "'";
				$sql .= " OR LCASE(p.sku) = '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "'";
				$sql .= " OR LCASE(p.upc) = '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "'";
				$sql .= " OR LCASE(p.ean) = '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "'";
				$sql .= " OR LCASE(p.jan) = '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "'";
				$sql .= " OR LCASE(p.isbn) = '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "'";
				$sql .= " OR LCASE(p.mpn) = '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "'";
			}
ClearThinking has a great search extension - OpencartX is the same as ClearThinking

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


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by PaskSant » Thu Sep 23, 2021 4:29 pm

thanks a lot by mona

Newbie

Posts

Joined
Sun Sep 05, 2021 6:06 pm

Post by straightlight » Thu Sep 23, 2021 8:05 pm

PaskSant wrote:
Thu Sep 23, 2021 4:29 pm
thanks a lot by mona
Now that the issue has been solved, please add: [SOLVED] at the beginning of the subject line on your first post.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: alanjones and 93 guests