Skip to main content

Links to categories hide

9 years 7 months ago #267133 by neo191987
-- HikaShop version -- : 3.0.1
-- HikaMarket version -- : 1.7.3

Hi I have the following problem. When a partner created a variant of the product, links to all categories hide.
So should look product page

But after adding variants look like


How can I fix this ?

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

9 years 7 months ago #267168 by Jerome
Replied by Jerome on topic Links to categories hide
Hello,

A variant do not have categories because it uses the main product categories.
I don't know how you perform the display but if you are loading just the variant, you'll need to also load the main product to get this categories.

Regards,

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

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

9 years 7 months ago #267188 by neo191987
Replied by neo191987 on topic Links to categories hide
The code to display links to categories
Code:
<?php $developers = ''; $publishers = ''; foreach($this->categories as $category){ $categoryClass = hikashop_get('class.category'); $categoryClass->addAlias($category); if($category->category_parent_id == '15') $developers .= '<a href="'.hikashop_contentLink('category&task=listing&cid='.$category->category_id.'&name='.$category->alias,$category).'">'.($category->category_name).'</a>'; elseif($category->category_parent_id == '22') $publishers .= '<a href="'.hikashop_contentLink('category&task=listing&cid='.$category->category_id.'&name='.$category->alias,$category).'">'.($category->category_name).'</a>'; } echo "<span class='list-developers'>".JText::_('Developer: ').$developers."</span><br/>"; echo "<span class='list-publishers'>".JText::_('Publisher: ').$publishers."</span>"; ?>
But after partner added his a variant of the product, the links do not show already

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

9 years 7 months ago #267189 by Jerome
Replied by Jerome on topic Links to categories hide
Hello,

I'm afraid that your issue is not related with HikaMarket at all ; but only to HikaShop.

Here the patch for the HikaShop product view file :
Code:
$query = 'SELECT b.* '. ' FROM '.hikashop_table('product_category').' AS a '. ' LEFT JOIN '.hikashop_table('category').' AS b ON a.category_id = b.category_id '. ' WHERE a.product_id = '.(int)$element->product_id. ' ORDER BY a.product_category_id ASC';
By
Code:
$query = 'SELECT b.* '. ' FROM '.hikashop_table('product_category').' AS a '. ' LEFT JOIN '.hikashop_table('category').' AS b ON a.category_id = b.category_id '. ' WHERE a.product_id = '.(($element->product_type == 'variant' && !empty($element->product_parent_id)) ? (int)$element->product_parent_id : (int)$element->product_id). ' ORDER BY a.product_category_id ASC';

Do not reply to this topic ; if you have any more question regarding that issue, you have to create a new thread in the HikaShop section of the forum.
Thank you for your understanding.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: neo191987

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

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