Phoenix version 1.0.7.10
I have had a quick search but could not find an answer.
I am using the GTIN PI module and was wondering if there is a way to make the output of the module on the products page show in the search results. Currently if you search for any GTIN number on the website no results are found yet lots of products use this data.
If its not possible it would mean adding the number into the product description text which will work, but will take time.
Make EAN number searchable
-
14Steve14
- Senior Contributor
- Posts: 923
- Joined: Fri Oct 25, 2019 7:01 pm
- Phoenix Version: v1.0.9.1
- Has thanked: 17 times
- Been thanked: 103 times
Re: Make EAN number searchable
I may have found the answer to my own question after finding an old post on the old other website about the gtin numbers. Hopefully this is the right way of doing this. Hopefully someone will confirm.
In advanced_search_result.php change
to
In advanced_search_result.php change
Code: Select all
$where_str .= "pd.products_name LIKE '%" . tep_db_input($keyword) . "%' OR p.products_model LIKE '%" . tep_db_input($keyword) . "%' OR m.manufacturers_name LIKE '%" . tep_db_input($keyword) . "%'";Code: Select all
$where_str .= "pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model LIKE '%" . tep_db_input($keyword) . "%' OR p.products_gtin LIKE '%" . tep_db_input($keyword) . "%' OR m.manufacturers_name LIKE '%" . tep_db_input($keyword) . "%'";-
raiwa
- Certified Developer
- Posts: 1640
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Has thanked: 70 times
- Been thanked: 152 times
Re: Make EAN number searchable
You can do this in a siteWide hook. See this thread:
https://phoenixcart.org/forum/viewtopi ... =25&t=1474
The last message shows the code which should also fit your needs.
https://phoenixcart.org/forum/viewtopi ... =25&t=1474
The last message shows the code which should also fit your needs.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
14Steve14
- Senior Contributor
- Posts: 923
- Joined: Fri Oct 25, 2019 7:01 pm
- Phoenix Version: v1.0.9.1
- Has thanked: 17 times
- Been thanked: 103 times
Re: Make EAN number searchable
Cheers raiwa.raiwa wrote: ↑Fri Aug 05, 2022 11:39 am You can do this in a siteWide hook. See this thread:
https://phoenixcart.org/forum/viewtopi ... =25&t=1474
The last message shows the code which should also fit your needs.
I will look into this siteWide hook for the latest test site I am creating. On my old site the change works so for now will be left.
- burt
- Core Team
- Posts: 4554
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Make EAN number searchable
Another way would be to put the EAN number into the "keywords" input box [when adding/editing a product], then turn on keyword searching [ admin > modules > header tags > "product seo" > "enable keyword search" = true.
If you have loads of product that you would need to update (ie adding the EAN to the keywords input tag), then the method above advised by raiwa is the better option.
If you have loads of product that you would need to update (ie adding the EAN to the keywords input tag), then the method above advised by raiwa is the better option.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.