Jump to content
pbweb99

PS 1.4 Display Product Location on product page

Recommended Posts

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....

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. location_search.jpg

Share this post


Link to post
Share on other sites

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')),

Share this post


Link to post
Share on other sites

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.

 

location_2.jpg

 

location_3.jpg

Share this post


Link to post
Share on other sites

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).'%\' 

Share this post


Link to post
Share on other sites

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. location_4.jpg

Share this post


Link to post
Share on other sites

the same question as to move the field ???

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More