- Posts: 5
- Thank you received: 0
category name raw code?
ive tested this:
<?php echo $this->params->get('main_div_name').$this->category_selected; ?>
but i only get the id, i want to chage it so it shows the name
anyone?
Please Log in or Create an account to join the conversation.
$categoryClass = hikashop::get('class.category');
$category = $categoryClass->get(JRequest::getVar('category_pathway'));
echo @$category->category_name;
(please remember that you should avoid to modify the view files directly and use the menu Display->Views instead which will save your modifications in your template's view override folder and allow you to update HikaShop without loosing your modifications)
Please Log in or Create an account to join the conversation.
You need to load the category data if you want its name because it's not loaded on that page:
$categoryClass = hikashop::get('class.category');
$category = $categoryClass->get(JRequest::getVar('category_pathway'));
echo @$category->category_name;
(please remember that you should avoid to modify the view files directly and use the menu Display->Views instead which will save your modifications in your template's view override folder and allow you to update HikaShop without loosing your modifications)
it doesnt seem to work at all, i tried to insert the code at various places but without any results, it comes out blank, frontend source code shows nothing either
have i missed something?
Please Log in or Create an account to join the conversation.
Could you copy/paste the modification you did ?
Please Log in or Create an account to join the conversation.
What is the link of our product page ? Do you have a category_pathway in the parameters of that link ?
Could you copy/paste the modification you did ?
from listing_div.php in product folder
<?php } ?>
<div class="hikashop_products" style="clear:both">
<?php $class = hikashop::get('class.category');
$category = $class->get(JRequest::getVar('category_name')); ?>
<h1> Tillgängliga delar från <?php echo $category->category_name; ?></h1>
<ul class="hikashop_product_list">
<?php
$columns = $this->params->get('columns');
$height = (int)(30/$columns)-1;
$current_column = 1;
if(!empty($this->rows)){
foreach($this->rows as $row){
?>
<div class="hikashop_product" style="width:<?php echo $width;?>%;">
<div class="hikashop_container">
<div class="hikashop_subcontainer"><h4>
<li class="hikashop_product_list_item" style="float:left;width:<?php echo $width;?>%;"><?php
$this->row =& $row;
$this->setLayout('listing_'.$this->params->get('div_item_layout_type'));
echo $row->product_name;
?></li></h4>
</div>
</div>
</div>
<?php if($current_column>=$columns){ ?>
<div style="clear:both"></div>
<?php
$current_column=0;
}
$current_column++;
}
}
?></ul>
</div>
Please Log in or Create an account to join the conversation.
instead of $category = $class->get(JRequest::getVar('category_pathway'));
Please Log in or Create an account to join the conversation.
Changed back to "category_pathway" but i still have the same problem
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
i think this is it, i dont think i have any parameters for category_pathway
<?php
$category_pathway = hikashop::completeLink('category&task=listing&cid='.$child->category_id.'&name='.$child->alias.$this->menu_id);
$categoryClass = hikashop::get('class.category');
$category = $categoryClass->get(JRequest::getVar('category_pathway')); ?>
tried to insert this piece of coding but still no luck
Please Log in or Create an account to join the conversation.
But now you're pasting code which is for the listing of products...
If you want to display the category name on the listing of products, you should be able to do that by just turning off the option "Use menu name instead of category name for the title" in your menu's options...
If you want to do it with code in the view, you can use that:
echo $this->element->category_name;
Please Log in or Create an account to join the conversation.
- Posts: 52
- Thank you received: 0
If you want to do it with code in the view, you can use that:
echo $this->element->category_name;
very helpful.
Please Log in or Create an account to join the conversation.
- Posts: 52
- Thank you received: 0
For example I have Parent Category "Soda" then Category "Cherry". Well that code just returns Cherry, which could also be other categories ("Fruit" for example). If it returned Soda > Cherry I would prefer that if possible. thanks for any help.
Please Log in or Create an account to join the conversation.
But I must ask, if you want the display exactly the same thing as the breadcrumb module, why not just use the breacrumb module ?
Please Log in or Create an account to join the conversation.
- Posts: 52
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- Posts: 8
- Thank you received: 0
I need to show the name of category in the product page and in an article with products. Can you help me? I tried to include all relevant codes imaginable found in the forum but the result is always the same div/h1 empty! the link is
/it/component/hikashop/product/108-controluce.html
version of hikashop 2.2.1
joomla 3.1
please help me
thank you
Please Log in or Create an account to join the conversation.
Here is the modification to do for what you want:
www.hikashop.com/forum/4-how-to/64957-ca...cts-pages.html#65212
Please Log in or Create an account to join the conversation.
- Posts: 8
- Thank you received: 0
this evening I will make the changes and i let you know
but what file I have to change for add code for product in the article?
thank you for your reply
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
What do you exactly mean by "in the article", a Joomla article ? if that's the case, you'll have to directly edit the code of the Hikashop product TAG translation plugin.
Please Log in or Create an account to join the conversation.
- Posts: 8
- Thank you received: 0
thank you
Please Log in or Create an account to join the conversation.
"plugins\system\hikashopproducttag\hikashopproducttag.php"
Please Log in or Create an account to join the conversation.