Skip to main content

Brand Display on Products with different variants

More
13 years 1 month ago #117911 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

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

More
13 years 1 month ago #117985 by Xavier
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.

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

More
13 years 1 month ago #118022 by matps
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?

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

More
13 years 1 month ago #118062 by Mohamed Thelji
Hi,

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>
So the best solution will be to put your modification before or after this span.

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

Time to create page: 0.189 seconds
Powered by Kunena Forum