pbweb99 Posted July 28, 2011 Share Posted July 28, 2011 Hello, I'm looking to add product location ID to product page just like reference ID. If possible, the location id can also be search from either both front end and back office. Any help, please.... Link to comment Share on other sites More sharing options...
mohsart Posted July 28, 2011 Share Posted July 28, 2011 To show it, use {$product->location} /Mats Link to comment Share on other sites More sharing options...
pbweb99 Posted July 29, 2011 Author Share Posted July 29, 2011 Where do i put this code? Link to comment Share on other sites More sharing options...
mohsart Posted July 30, 2011 Share Posted July 30, 2011 themes folder/product.tpl, exactly where depends on where you want it to be seen but my guess would be somewhere below "<!-- left infos-->" /Mats Link to comment Share on other sites More sharing options...
pbweb99 Posted July 30, 2011 Author Share Posted July 30, 2011 Mats, Thanks for the help. Here is the full code for that. <p id="product_location" {if isset($groups) OR !$product->location}style="display: none;"{/if}><label for="product_location">{l s='Location :'} </label><span class="editable">{$product->location|escape:'htmlall':'UTF-8'}</span></p> I don't know if the location # can be searchable, but i will check it and let you guy know. Also, is there anyway, i can do search location # for backend on the search box. Link to comment Share on other sites More sharing options...
pbweb99 Posted July 30, 2011 Author Share Posted July 30, 2011 Need help for adding another column in backend for search result page. I'm looking to add column "location" and can be search. Please check attachment img for detail. Link to comment Share on other sites More sharing options...
rocky Posted July 31, 2011 Share Posted July 31, 2011 It looks like you need to edit the /* Product research */ section of admin/tabs/AdminSearch.php on line 116 (in PrestaShop v1.4.4). Try changing: 'name' => array('title' => $this->l('Name')), to: 'name' => array('title' => $this->l('Name')), 'location' => array('title' => $this->l('Location')), Link to comment Share on other sites More sharing options...
pbweb99 Posted August 3, 2011 Author Share Posted August 3, 2011 Thanks Rocky, I've follow your instruction. However, I still wouldn't be able to search for location #. Also it didn't display rite. Please check the attach imgs. Any help would be great. Link to comment Share on other sites More sharing options...
rocky Posted August 3, 2011 Share Posted August 3, 2011 Looks like I was looking in the wrong area. Try this instead. Override the searchByName function of classes/Product.php and change: WHERE pl.`name` LIKE \'%'.pSQL($query).'%\' OR p.`reference` LIKE \'%'.pSQL($query).'%\' OR p.`supplier_reference` LIKE \'%'.pSQL($query).'%\' to: WHERE pl.`name` LIKE \'%'.pSQL($query).'%\' OR p.`reference` LIKE \'%'.pSQL($query).'%\' OR p.`supplier_reference` LIKE \'%'.pSQL($query).'%\' OR p.`location` LIKE \'%'.pSQL($query).'%\' Link to comment Share on other sites More sharing options...
pbweb99 Posted August 3, 2011 Author Share Posted August 3, 2011 Rocky, wow great, i think we're getting there. I can search for location # on back end now. except the result didn't display correctly. please check the img. Link to comment Share on other sites More sharing options...
Riva Posted March 5, 2013 Share Posted March 5, 2013 the same question as to move the field ??? 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