- Posts: 214
- Thank you received: 1
Brand Display on Products with different variants
13 years 1 month ago #117911
by matps
Brand Display on Products with different variants was created by matps
Hi Guys,
If you look at a product page on my site (eg craftkeg.com/index.php/hikashop-menu-for...oduct/7-beach-blonde ) you can see I've edited show_default so I'm displaying the brand name...
<strong>Supplier: </strong><?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->product_manufacturer_id);
echo $manufacturer->category_name; ?><br>
My question is however, if you select a different variant (size in my case) the Brand then vanishes. Am I able to have it so the Brand is displayed even when a variant is selected?
Kind Regards,
Matthew
If you look at a product page on my site (eg craftkeg.com/index.php/hikashop-menu-for...oduct/7-beach-blonde ) you can see I've edited show_default so I'm displaying the brand name...
<strong>Supplier: </strong><?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->product_manufacturer_id);
echo $manufacturer->category_name; ?><br>
My question is however, if you select a different variant (size in my case) the Brand then vanishes. Am I able to have it so the Brand is displayed even when a variant is selected?
Kind Regards,
Matthew
Please Log in or Create an account to join the conversation.
13 years 1 month ago #117985
by Xavier
Replied by Xavier on topic Brand Display on Products with different variants
Hi,
Yes, you probably need to use "$this->element->main->product_manufacturer_id" to get the value from the main product and not a variant.
Yes, you probably need to use "$this->element->main->product_manufacturer_id" to get the value from the main product and not a variant.
Please Log in or Create an account to join the conversation.
13 years 1 month ago #118022
by matps
Replied by matps on topic Brand Display on Products with different variants
Hi Xavier, did you mean change it so it looks like...
<strong>Supplier: </strong><?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->main->product_manufacturer_id);
echo $manufacturer->category_name; ?><br>
because that did not seem to do the trick?
<strong>Supplier: </strong><?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->main->product_manufacturer_id);
echo $manufacturer->category_name; ?><br>
because that did not seem to do the trick?
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
13 years 1 month ago #118062
by Mohamed Thelji
Replied by Mohamed Thelji on topic Brand Display on Products with different variants
Hi,
The problem is probably coming from the fact that you have put your custom code into this price span TAG :
So the best solution will be to put your modification before or after this span.
The problem is probably coming from the fact that you have put your custom code into this price span TAG :
Code:
<span id="hikashop_product_price_main" class="hikashop_product_price_main">
<?php
//LAYOUT listing_price
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
?>
</span>
Please Log in or Create an account to join the conversation.
Time to create page: 0.189 seconds