You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hi,
I have some products with selection options that my customers search for but the selection options do not show up in search results e.g. Titan Badge has selection options of 20 different titles like 'Buddy, Attendance. Librarian etc. these titles are not searchable.
Is there a way to add a new section in the back end so I can add keywords that will be picked up by the site search?
I was thinking a new section in 'Inventory Items-Options' just above 'Custom Data' to add search words (Site Specific Search Keywords) with two sections 'Product Code/ID and Keywords' that will be included in the search table but are NOT also in the Meta-Keywords section.
How hard would this be to implement?
Cheers,
Bruce.
Last edited by west4 (11-06-2019 07:32:53)
Offline
Use Raw DB Admin to add a new column to the ecom_prod table. I suggest a CLOB/TEXT column so it will take a bunch of input. Populate with data as needed. Then edit the top of {private}/apps/ecom/ECOM_Prod/ECOM_Prod.php. There you will see:
var $prodsearchfields_adv = array('id', 'name', 'prodnum', 'catfeatgridname', 'keywords'); var $prodsearchfields_ajax = array('id', 'name', 'prodnum', 'catfeatgridname');
Add your new column to both arrays. FYI: In version 9.1.0 the 'keywords' field is in both arrays. (pending release)
Offline
Assuming your column name is 'customkeywords', and it was set up as a clob/text type field, execute these two statements:
UPDATE core_columndefs SET crequired where id='ecom_prod.customkeywords'
ALTER TABLE ecom_prod CHANGE COLUMN customkeywords customkeywords TEXT DEFAULT NULL
Offline
Hi Nick,
A problem was encountered while executing the SQL statement submitted. The error was reported as: The MySQLi extension encountered a problem submitting an SQL statement. MySQLi reported the error as: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where id='ecom_prod.prod_keywords' ALTER TABLE ecom_prod CHANGE COLUMN prod_k' at line 1. The following SQL statement was submitted: UPDATE core_columndefs SET crequired where id='ecom_prod.prod_keywords' ALTER TABLE ecom_prod CHANGE COLUMN prod_keywords TEXT DEFAULT NULL
syntax error.
Bruce.
Offline
Those are two different statements. Execute:
UPDATE core_columndefs SET crequired=0 where id='ecom_prod.prod_keywords'
Then execute:
ALTER TABLE ecom_prod CHANGE COLUMN prod_keywords prod_keywords TEXT DEFAULT NULL
Offline
Hi Nick,
A problem was encountered while executing the SQL statement submitted. The error was reported as: The MySQLi extension encountered a problem submitting an SQL statement. MySQLi reported the error as: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where id='ecom_prod.prod_keywords'' at line 1. The following SQL statement was submitted: UPDATE core_columndefs SET crequired where id='ecom_prod.prod_keywords'
But the second line will enter ok, but without changing the compulsory state.
Cheers,
Bruce.
Last edited by west4 (11-12-2019 10:13:17)
Offline
I apologize for the syntax error. The SQL should be:
UPDATE core_columndefs SET crequired=0 where id='ecom_prod.prod_keywords'
I updated the post above as well.
Offline
Nick,
Still an issue...
A problem was encountered while executing the SQL statement submitted. The error was reported as: The MySQLi extension encountered a problem submitting an SQL statement. MySQLi reported the error as: Unknown column 'id' in 'where clause'. The following SQL statement was submitted: UPDATE core_columndefs SET crequired=0 where id='ecom_prod.prod_keywords'
Offline
UPDATE core_columndefs SET crequired=0 WHERE cid='ecom_prod.prod_keywords'
think it should be cid not id
Last edited by zanart (11-12-2019 11:14:18)
Offline