Links to categories hide

  • Posts: 410
  • Thank you received: 15
7 years 1 week ago #267133

-- 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 ?

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
7 years 1 week ago #267168

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.

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.

  • Posts: 410
  • Thank you received: 15
7 years 1 week ago #267188

The code to display links to categories

<?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.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
7 years 1 week ago #267189

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 :

		$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
		$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.072 seconds
Powered by Kunena Forum