- Posts: 120
- Thank you received: 1
How to show weight and brand on product page?
Please Log in or Create an account to join the conversation.
.hikashop_product_weight_main{
display:none;
}
Remove it from the hikashop front end CSS file and it should be displayed automatically.
For the manufacturer, there is no option to display it. You can edit the view file like that:
www.hikashop.com/forum/4-how-to/46861-ch...t.html?lang=en#47470
Please Log in or Create an account to join the conversation.
Thanks for usual perfect support!
I could do that and now Manufacturer's name is shown on my product page.
However, may I ask two more questions?
1. EXISTING CODE
I see the below code in the show view. What is this for? Due to some reason it seems to be always empty for my products. Is it not same as brands?
<span id="hikashop_product_url_main" class="hikashop_product_url_main">
<?php
if (!empty ($this->element->product_url)) {
echo JText :: sprintf('MANUFACTURER_URL', '<a href="' . $this->element->product_url . '" target="_blank">' . $this->element->product_url . '</a>');
}
?>
</span>
2. URL TO BRAND
I have inserted this code in the view "show_block_custom_main" right after tag "table":
<?php
if(!empty($this->element->product_manufacturer_id)){
?>
<tr class="hikashop_product_custom_<?php echo $oneExtraField->field_namekey;?>_line">
<td class="key">
<span id="hikashop_product_custom_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_name">
Brand:
</span>
</td>
<td>
<span id="hikashop_product_custom_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_value">
<?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->product_manufacturer_id);
echo '<a href="#">'.$manufacturer->category_name.'</a>';
?>
<br />
</span>
</td>
</tr>
<?php
}
?>
It works correctly, but what is the name of variable to be inserted instead of "#" in order to make link to Brand description?
Is it possible?
P.S. With Hikashop I will soon learn how to code sites. :lol:
Please Log in or Create an account to join the conversation.
2. You would have to enter:
<?php global $Itemid; echo hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&Itemid='.$Itemid); ?>
Please Log in or Create an account to join the conversation.
Your solution works perfectly!
However, I have one minor issue. As result, I have two absolutely same pages with absolutely same content, but different URLs:
1) One is generated by Brands Listing Module:
/brands/category/14-benassi
2) The other one is generated by the above solution:
/brands/category/cid-14
Is there any possibility to make the URLs uniformed/same?
As you know, search engines do not like duplicates, also it will mislead SEO specialist, who will need to promote individual pages (nobody know which of them will be indexed by Google and which will not be, therefore you do not know which page to be promoted by means of SEO)...
Please Log in or Create an account to join the conversation.
<?php global $Itemid; echo hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->category_name.'&Itemid='.$Itemid); ?>
Please Log in or Create an account to join the conversation.
But regretfully, cyrillics characters are not converted. Is there a function ready for transliterating cyrillics?
The result of the above solution:
/brands/category/53-ЗАО%20Красный%20Октябрь
The correct link should be:
/brands/category/53-zao-krasnyj-oktyabr
Please Log in or Create an account to join the conversation.
<?php global $Itemid; $app =& JFactory::getApplication(); echo hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$app->stringURLSafe($manufacturer->category_name).'&Itemid='.$Itemid); ?>
Please Log in or Create an account to join the conversation.
It is much better now. But I have found that if I find the product from the shop, the link is:
/shop/category/53-zao-krasnyj-oktyabr
But if I come to this product from brands, it is still different:
/brands/category/53-zao-krasnyj-oktyabr
Is there any possibility to replace "brands" with "shop"? If I succeed this, I will avoid any duplicate pages on my site. That would be great!
Sorry for bothering you with my personal requests..
Please Log in or Create an account to join the conversation.
<?php $app =& JFactory::getApplication(); echo hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$app->stringURLSafe($manufacturer->category_name).'&Itemid=XXX'); ?>
where XXX is the id of your brands menu.
Please Log in or Create an account to join the conversation.
I have managed to have the below code, which creates a link to Manufacturer's page. It shall be inserted into view product/show_block_custom_main after the row <table width="100%">:
<?php
if(!empty($this->element->product_manufacturer_id)){
?>
<tr class="hikashop_product_custom_<?php echo $oneExtraField->field_namekey;?>_line">
<td class="key">
<span id="hikashop_product_custom_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_name">
Manufacturer
</span>
</td>
<td>
<span id="hikashop_product_custom_value_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_value">
<?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->product_manufacturer_id);
global $Itemid;
$app =& JFactory::getApplication();
echo '<a href="'.hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$app->stringURLSafe($manufacturer->category_name).'&Itemid=261').'">'.$manufacturer->category_name.'</a>';
?>
<br />
</span>
</td>
</tr>
<?php
}
?>
The manufacturer's name (and link) are shown as the first row of specifications.
P.S. Why don't you include this feature as an option into your next release?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.