Show product's brand in Hikashop module view?

  • Posts: 175
  • Thank you received: 0
9 years 7 months ago #231191

-- HikaShop version -- : 2.6.0
-- Joomla version -- : -
-- PHP version -- : -

Hello

is it possible to show product's brand in the hikashop product module?
I tried to var_dump the row and it only contains the id of the brand [manufacturer_id] which means i need to create query to read the the brand's name in database again [longer load time]


Any solution?

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 76
9 years 7 months ago #231195

As you already have manufacturer id, the SQL query is very fast.
Frankly, displaying logo on page has much bigger impact on page load time.

Please Log in or Create an account to join the conversation.

  • Posts: 175
  • Thank you received: 0
9 years 7 months ago #231200

is there any alternative?
Having multiple module in the page means the server need to read SQL for each product which i think is very inefficient

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 76
9 years 7 months ago #231235

I suppose the site is under your control.

1. Cache manufacturers per request in static variable
2. Use Joomla cache to store them

Please Log in or Create an account to join the conversation.

  • Posts: 84328
  • Thank you received: 13718
  • MODERATOR
9 years 7 months ago #231202

Hi,

Edit the "listing" file of the "product" view and get all the manufacturer_ids of all the products to be displayed and run one query to load the data of all the brands of all the products. Then, store that somewhere in $this and then use that data in the listing_img_title view file to display the brand the way you want.

Please Log in or Create an account to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum