Hikashop category module as menu item

  • Posts: 149
  • Thank you received: 0
11 years 7 months ago #140789

Hello ,

i have a specific problem and i want your help .

We integrade Hikashop with a stock control and we want when the user creates a sub category in stock control software to display it dynamicaly on Joomla menu to avoid going and create manualy a joomla menu item that points to hikashop category.

so we decide to show a category module on the menu.

On hikashop module we select :

Type of content: Category
Type of layout: List

You can see the under construction website here server.webartscy.com/~mazrin/ and if you go over the Fathers Day menu item you can see the hikashop module.

now our problem is that we want to have a clean ul li list to can display properly with the correct style the module to look like exactly as menu items.

please advice how we can achive this. even if you have a list layout the code its not clean .

Last edit: 11 years 7 months ago by webarts.

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

  • Posts: 84242
  • Thank you received: 13686
  • MODERATOR
11 years 7 months ago #140864

Hi,

Go in the options of your module via the menu Display>Content modules and change the option "Show sub categories" to "no child" and that should display as a "clean" ul/li list

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

  • Posts: 149
  • Thank you received: 0
11 years 7 months ago #140870

thank you ,

there is a way to show the sub categories tree ? Is that possible

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

  • Posts: 84242
  • Thank you received: 13686
  • MODERATOR
11 years 7 months ago #140887

It should be the case if you set that option to "all sub categories".

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

  • Posts: 149
  • Thank you received: 0
11 years 7 months ago #140889

with that we come back to the previous stage and we dont have "clean" ul/li list

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

  • Posts: 84242
  • Thank you received: 13686
  • MODERATOR
11 years 7 months ago #140894

Yes. That's because HikaShop adds extra tags to handle the accordion system of Joomla/mootools in that case.
You would have to edit the file "listing_list" of the view "category" via the menu Display>Views and remove the pieces you don't want.

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

  • Posts: 149
  • Thank you received: 0
11 years 7 months ago #140984

Nicolas i give a try and i mess it up, its hard for you to sent me the code for a clean ui li of listing_list when the option is "all sub categories" ?

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

  • Posts: 84242
  • Thank you received: 13686
  • MODERATOR
11 years 7 months ago #141072

Replace the code in that file by that code and that will do it:

<ul>
			<?php
			if(!empty($this->rows)){
				foreach($this->rows as $k => $row){
					if($only_if_products && $row->number_of_products<1) continue;
					$link = $this->getLink($row->category_id,$row->alias);
					?>
					<li>
								<a href="<?php echo $link;?>">
									<?php
										echo $row->category_name;
										if($this->params->get('number_of_products',0)){
											echo ' ('.$row->number_of_products.')';
										}
									?>
								</a>
							<ul class="hikashop_category_list<?php echo $this->params->get('ul_class_name'); ?>"><?php
							if(!empty($row->childs)){
								$app = JFactory::getApplication();
								$found='';
								if(JRequest::getString('option')==HIKASHOP_COMPONENT && in_array(JRequest::getString('ctrl','category'),array('category','product'))){
									if(JRequest::getString('ctrl','category')=='product'&&JRequest::getString('task','listing')=='show'){
										$found = $app->getUserState(HIKASHOP_COMPONENT.'.last_category_selected');
										$config =& hikashop_config();
										$pathway_sef_name = $config->get('pathway_sef_name','category_pathway');
										$cid = JRequest::getInt($pathway_sef_name,0);
									}else{
										$cid = JRequest::getInt('cid',0);
									}
									foreach($row->childs as $child){

										if($cid == $child->category_id){

											$found=$child->category_id;
											$app->setUserState(HIKASHOP_COMPONENT.'.last_category_selected',$child->category_id);
											break;
										}
									}
								}

								$limit = $this->params->get('child_limit');
								$i = 0;
								foreach($row->childs as $child){
									if($only_if_products && $child->number_of_products<1) continue;
									if(!empty($limit) && $i >= $limit){
										break;
									}
									$i++;
									$link = $this->getLink($child->category_id,$child->alias);
									$class = '';
									if($found==$child->category_id){
										$class=' current active';
									}
									?>
									<li class="hikashop_category_list_item<?php echo $class; ?>">
										<a href="<?php echo $link; ?>">
										<?php
											echo $child->category_name;
											if($this->params->get('number_of_products',0)){
												echo ' ('.$child->number_of_products.')';
											}
										?>
										</a>
									</li>
									<?php
								}
							}else {
								echo JText::_('HIKA_LISTING_LIST_EMPTY');
							}
							?></ul>
					</il><?php
				}
			}
			?></ul>
Please note that we're already far from user support and this is already custom code development...

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

  • Posts: 149
  • Thank you received: 0
11 years 7 months ago #141103

thank you very much Nicolas , we really appreciate your support thats why your are far away from the second ! We was able to solve the problem before your post. I will double check this. But we are willing to pay next time for an extra support. Thank you for noted this .

Last edit: 11 years 7 months ago by webarts.

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

Time to create page: 0.052 seconds
Powered by Kunena Forum