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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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