Vendor control panel

  • Posts: 152
  • Thank you received: 11
2 years 7 months ago #335130

-- url of the page with the problem -- : www.hikashop.com/
-- HikaShop version -- : 4.4.3
-- HikaMarket version -- : 4.0.0
-- Joomla version -- : 3.10
-- PHP version -- : 7.4.14
-- Browser(s) name and version -- : Chrome

How can I add the name of the categories and the brand to each single product?

And enlarge the image?

Thanks

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
2 years 7 months ago #335131

Hello,

To customize that view, you need to override the "productmarket / listing" view (via the HikaShop backend).

The size of the thumbnail is handled by the line

$thumb = $this->imageHelper->getThumbnail(@$product->file_path, array(50,50), array('default' => 1, 'forcesize' => 1));

Displaying the brand name is possible but it requires the addition of a SQL query in order to load the brands for the products in the current listing (using the product_manufacturer_id fields and looking in the hikashop_category table).

Display the categories is the almost the same but the SQL query is bigger because it requires to perform a join of two tables (hikashop_product_category and hikashop_category).
The best is to filter the categories by not displaying the one that the vendor does not have an access (if you have a vendor root category).
To do so, you first need to retrieve the vendor root category ID :
$vendorClass = hikamarket::get('class.vendor');
// $vendor_id is required.
// In the productmarket listing view, you can use : $this->vendor->vendor_id
$rootCategory = $vendorClass->getRootCategory($vendor_id);

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Moderators: Obsidev
Time to create page: 0.062 seconds
Powered by Kunena Forum