glenskie16 Posted January 22, 2014 Share Posted January 22, 2014 okay i have a question. i would like to know where the array for the search is. i am trying to have it pull a number from another table and i cant find the array or the query for the search , im trying to get it to pull a part number along side the product that they searched for Link to comment Share on other sites More sharing options...
vekia Posted January 22, 2014 Share Posted January 22, 2014 array for the search is what you exactly mean by "array" ? Link to comment Share on other sites More sharing options...
glenskie16 Posted January 22, 2014 Author Share Posted January 22, 2014 (edited) like when i do a search it has an array of things it gets from the tables correct ? i need to edit that to grab something else from that table ... if im wrong then where exactly is the query and the output to the search ? would you like to see ? Edited January 22, 2014 by glenskie16 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 22, 2014 Share Posted January 22, 2014 so, you're looking for Search class, there is a function named "find" it returns: return array('total' => $total,'result' => $result_properties); /classes/Search.php Link to comment Share on other sites More sharing options...
glenskie16 Posted January 22, 2014 Author Share Posted January 22, 2014 okay so i have edited it and i would like to know how do i get the part number out of it now ? here is my code $sql = 'SELECT * FROM `'._DB_PREFIX_.'category_group` cg INNER JOIN `'._DB_PREFIX_.'category_product` cp ON cp.`id_category` = cg.`id_category` INNER JOIN `'._DB_PREFIX_.'category` c ON cp.`id_category` = c.`id_category` INNER JOIN `'._DB_PREFIX_.'product` p ON cp.`id_product` = p.`id_product` INNER JOIN `'._DB_PREFIX_.'product_part_number` ON p. `id_product` = `ID` '.Shop::addSqlAssociation('product', 'p', false).' WHERE c.`active` = 1 AND product_shop.`active` = 1 AND product_shop.`visibility` IN ("both", "search") AND product_shop.indexed = 1 AND cg.`id_group` '.(!$id_customer ? '= 1' : 'IN ( SELECT id_group FROM '._DB_PREFIX_.'customer_group WHERE id_customer = '.(int)$id_customer.' )'); do i need to echo it ? or add it to the array? Link to comment Share on other sites More sharing options...
glenskie16 Posted January 22, 2014 Author Share Posted January 22, 2014 im just trying to dump everything that is in the 'product_part_number' table that has the same id as the product_id .. Link to comment Share on other sites More sharing options...
vekia Posted January 23, 2014 Share Posted January 23, 2014 but this query is a part of... ? you included it somewhere? it's neessary to run this query, then in query return you will have an array of results, also results from your product_part_number table Link to comment Share on other sites More sharing options...
glenskie16 Posted January 23, 2014 Author Share Posted January 23, 2014 This query is a part of the find function. what i did what i added a line of code to the query which is this line of code INNER JOIN `'._DB_PREFIX_.'product_part_number` ON p. `id_product` = `ID` Im not sure if that is even correct but it does work . what i am trying to ask and now i see i wasnt very clear is what do i add to the code so when the product shows it also shows the part number which is in the "product_part_number" table? i dont know how to get it to display that part number ? do i need to add some code to the product-list.tpl file ? Link to comment Share on other sites More sharing options...
glenskie16 Posted January 23, 2014 Author Share Posted January 23, 2014 I was able to track the issue down further and the results array is getting the data from `'._DB_PREFIX_.'product_part_number` in the query, what I need now is to be able to put the results in the product-list.tpl either by assigning the values to a smarty variable (which I do not know how to do), or by outputting it with some other method but nothing seems to be working. More specifically, I am able to output the data I'm looking for with "echo $row['GREKA'];" within the Search.php but I want to be able display this value through the tpl within the foreach loop for that ID. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now