[Skip to main content](#vessel-content)

#   Display product code in search results

##

- **[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")**
- [![mad-q's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4784-mad-q "View mad-q's Profile") Topic Author
- [ Offline](/forum/user/4784-mad-q)

Less More

- Posts: 234
- Thank you received: 4
-
-

7 years 9 months ago [\#303386](#303386) by [mad-q](/forum/user/4784-mad-q "View mad-q's Profile")  *[Display product code in search results](/forum/26-product-category-display/896822-display-product-code-in-search-results#303386 "-- url of the page with the problem -- : draganfly.co.uk -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.0 -- PHP version -- : 7  Hello all,  How would I go about displaying the product code in search results?  Cheers Iain")* was created by *[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")*

-- url of the page with the problem -- : draganfly.co.uk
-- HikaShop version -- : 4.0.2
-- Joomla version -- : 3.9.0
-- PHP version -- : 7

Hello all,

How would I go about displaying the product code in search results?

Cheers
Iain

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTY4MjItZGlzcGxheS1wcm9kdWN0LWNvZGUtaW4tc2VhcmNoLXJlc3VsdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

7 years 9 months ago [\#303409](#303409) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display product code in search results](/forum/26-product-category-display/896822-display-product-code-in-search-results#303409 "-- url of the page with the problem -- : draganfly.co.uk -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.0 -- PHP version -- : 7  Hello all,  How would I go about displaying the product code in search results?  Cheers Iain")*

Hi,

In the file plugins/search/hikashop_products/hikashop_products.php you can change the line:
$row-&gt;title=$row-&gt;product_name;
to:
$row-&gt;title=$row-&gt;product_name.' '.$row-&gt;product_code;
Note however that this change will be removed during updates of HikaShop so you would have to reapply it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTY4MjItZGlzcGxheS1wcm9kdWN0LWNvZGUtaW4tc2VhcmNoLXJlc3VsdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")**
- [![mad-q's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4784-mad-q "View mad-q's Profile") Topic Author
- [ Offline](/forum/user/4784-mad-q)

Less More

- Posts: 234
- Thank you received: 4
-
-

7 years 9 months ago [\#303603](#303603) by [mad-q](/forum/user/4784-mad-q "View mad-q's Profile")  Replied by *[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")* on topic *[Display product code in search results](/forum/26-product-category-display/896822-display-product-code-in-search-results#303603 "-- url of the page with the problem -- : draganfly.co.uk -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.0 -- PHP version -- : 7  Hello all,  How would I go about displaying the product code in search results?  Cheers Iain")*

Hi Nicolas

Thanks for that however it doesn't display anything. I have tried just $row-&gt;title=$row-&gt;product_code; and it comes up blank. Could it be something other than product_code...

Cheers
Iain

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTY4MjItZGlzcGxheS1wcm9kdWN0LWNvZGUtaW4tc2VhcmNoLXJlc3VsdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

7 years 9 months ago [\#303606](#303606) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display product code in search results](/forum/26-product-category-display/896822-display-product-code-in-search-results#303606 "-- url of the page with the problem -- : draganfly.co.uk -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.0 -- PHP version -- : 7  Hello all,  How would I go about displaying the product code in search results?  Cheers Iain")*

Hi,

The product_code is not loaded by the MySQL query as it's not needed normally.
You also need to change the line:
$select = ' a.product_id AS id, a.product_name, a.product_alias, a.product_canonical, a.product_created AS created , a.product_description, "'.$new_page.'" AS browsernav';

to:
$select = ' a.product_id AS id, a.product_name, a.product_alias, a.product_canonical, a.product_created AS created , a.product_description, "'.$new_page.'" AS browsernav', a.product_code;
in that same file to get the product_code loaded.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTY4MjItZGlzcGxheS1wcm9kdWN0LWNvZGUtaW4tc2VhcmNoLXJlc3VsdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")**
- [![mad-q's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4784-mad-q "View mad-q's Profile") Topic Author
- [ Offline](/forum/user/4784-mad-q)

Less More

- Posts: 234
- Thank you received: 4
-
-

7 years 6 months ago [\#306137](#306137) by [mad-q](/forum/user/4784-mad-q "View mad-q's Profile")  Replied by *[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")* on topic *[Display product code in search results](/forum/26-product-category-display/896822-display-product-code-in-search-results#306137 "-- url of the page with the problem -- : draganfly.co.uk -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.0 -- PHP version -- : 7  Hello all,  How would I go about displaying the product code in search results?  Cheers Iain")*

Hi Nicolas

That code change was working great however after the lastest update it now has 404 error. Can you please assist with the latest version.

Cheers

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTY4MjItZGlzcGxheS1wcm9kdWN0LWNvZGUtaW4tc2VhcmNoLXJlc3VsdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

7 years 6 months ago [\#306139](#306139) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display product code in search results](/forum/26-product-category-display/896822-display-product-code-in-search-results#306139 "-- url of the page with the problem -- : draganfly.co.uk -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.0 -- PHP version -- : 7  Hello all,  How would I go about displaying the product code in search results?  Cheers Iain")*

Hi,

I looked at your website, and I see that you have the latest version, but I don't see any 404 error with the search results I found myself. So it must be a problem specific to the products you're using for your tests.
Could you please double check ?
Please provide precise instructions to reproduce the 404 error as I didn't had it on your website when I tried.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTY4MjItZGlzcGxheS1wcm9kdWN0LWNvZGUtaW4tc2VhcmNoLXJlc3VsdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")**
- [![mad-q's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4784-mad-q "View mad-q's Profile") Topic Author
- [ Offline](/forum/user/4784-mad-q)

Less More

- Posts: 234
- Thank you received: 4
-
-

7 years 5 months ago [\#307901](#307901) by [mad-q](/forum/user/4784-mad-q "View mad-q's Profile")  Replied by *[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")* on topic *[Display product code in search results](/forum/26-product-category-display/896822-display-product-code-in-search-results#307901 "-- url of the page with the problem -- : draganfly.co.uk -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.0 -- PHP version -- : 7  Hello all,  How would I go about displaying the product code in search results?  Cheers Iain")*

Hi

Sorry I missed your reply, I had to remove the code otherwise people wouldn't be able to use the site.

Cheers
Iain

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTY4MjItZGlzcGxheS1wcm9kdWN0LWNvZGUtaW4tc2VhcmNoLXJlc3VsdHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.066 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
