- Posts: 431
- Thank you received: 19
Links to categories hide
9 years 5 months ago #267133
by neo191987
Links to categories hide was created by neo191987
Please Log in or Create an account to join the conversation.
9 years 5 months ago #267168
by Jerome
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.
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,
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.
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.
9 years 5 months ago #267188
by neo191987
Replied by neo191987 on topic Links to categories hide
The code to display links to categories
But after partner added his a variant of the product, the links do not show already
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>";
?>
Please Log in or Create an account to join the conversation.
9 years 5 months ago #267189
by Jerome
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.
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 :
By
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,
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';
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.
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.
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.141 seconds