Add Brand Name On Product Listings Page

  • Posts: 966
  • Thank you received: 11
7 years 8 months ago #276530

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.5

I would like my product listings to include the brand name, for example like this:

This Is The Name Brand
This Is The Product Name
$39.99

I see that it can be added on the product details page but not on the product listings page or in the HikaShop Content Module.

How can I add that please?

Thank you.

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

  • Posts: 83779
  • Thank you received: 13567
  • MODERATOR
7 years 8 months ago #276545

Hi,

There is indeed no option to add that.
You would have to customize the view file for that.
www.hikashop.com/support/forum/2-general...-in-title.html#80351

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

  • Posts: 966
  • Thank you received: 11
7 years 8 months ago #276741

Great. Thanks!!

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

  • Posts: 966
  • Thank you received: 11
7 years 6 months ago #282468

<?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->row->product_manufacturer_id);
echo $manufacturer->category_name; ?>

I add the code above in the files below, above the product name, so that the brand will be shown but it does not work. It worked in the "Show_default" file so assumed it would work in the files below. Any idea why?

product / contact.php
checkout / show_block_cart.php

And how would I get the "Brand" in the notification emails?.

I thought this would be an option of Hikashop because since we are able to display the Brand on the site I assume we would have the option to have it show or not anywhere the product is shown, for example, in the cart, the notification emails, etc...

Thank you!

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

  • Posts: 83779
  • Thank you received: 13567
  • MODERATOR
7 years 6 months ago #282479

Hi,

Well usually you don't display the brand on the cart or the contact form nor in the emails... Only of the product page, and maybe on the listings.
So that's why there is no option for that.


For the contact.php you want to use $this->product instead of $this->row in your code.
For show_block_cart, it's $product that you want to use instead.

For the notification emails it's a bit more complex as you need to load the data in the preload and display it in the HTML version.
Please understand that this is outside normal user support and contact our partners if you need customization like that and can't do it yourself:
www.hikashop.com/home/our-partners.html

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

  • Posts: 966
  • Thank you received: 11
7 years 5 months ago #282893

For show_block_cart, it's $product that you want to use instead.


Odd but for some reason, for some items the brand is added and some it's not. Please see attached pic.
<td data-title="<?php echo JText::_('CART_PRODUCT_NAME'); ?>" class="hikashop_cart_product_name_value">
            
				<p class="hikashop_cart_brand_name">
                  <?php $class = hikashop_get('class.category');
$manufacturer = $class->get($product->product_manufacturer_id);
echo $manufacturer->category_name; ?>
              </p>
              
           		<p class="hikashop_cart_product_name">       
                
                  <?php

		if(!empty($this->options['link_to_product_page'])) {
			?><a class="hikashop_no_print" href="<?php echo hikashop_contentLink('product&task=show&cid=' . $product->product_id . '&name=' . $product->alias . $url_itemid, $product);?>" ><?php
		}

		echo $product->product_name;

		if(!empty($this->options['show_product_code'])) {
			?><span class="hikashop_product_code_checkout"><?php
				echo $product->product_code;
			?></span><?php
		}

		if(!empty($this->options['link_to_product_page'])) {
			?></a><?php
		}

		if($group){
			$display_item_price = false;
			foreach($cart->products as $j => $optionElement) {
				if(empty($optionElement->cart_product_option_parent_id) || (int)$optionElement->cart_product_option_parent_id != (int)$product->cart_product_id)
					continue;
				if(!empty($optionElement->prices[0])) {
					$display_item_price = true;
					break;
				}
			}

			if($display_item_price)
				echo ' <span class="hikashop_product_base_price">' . strip_tags($this->getDisplayProductPrice($product, true)) . '</span>';
		}

				?></p>
<?php
		$input = '';
		$html = '';

		if(hikashop_level(2) && !empty($this->extraFields['item'])) {
			$item = $cart->cart_products[$i];
			foreach($this->extraFields['item'] as $field) {
				$namekey = $field->field_namekey;
				if(empty($item->$namekey) || !strlen($item->$namekey))
					continue;
				$html .= '<p class="hikashop_cart_item_'.$namekey.'">'.$this->fieldClass->getFieldName($field).': '.$this->fieldClass->show($field, $item->$namekey).'</p>';
			}
		}

		if($group) {
			if(!isset($product->prices[0])) {
				$product->prices[0] = new stdClass();
				$product->prices[0]->price_value = 0;
				$product->prices[0]->price_value_with_tax = 0.0;
				$product->prices[0]->price_currency_id = hikashop_getCurrency();
			}

			foreach($cart->products as $j => $optionElement) {
				if(empty($optionElement->cart_product_option_parent_id) || $optionElement->cart_product_option_parent_id != $product->cart_product_id)
					continue;
				if(!empty($optionElement->prices[0]))
					$this->addOptionPriceToProduct($product->prices[0],$optionElement->prices[0]);

				$html .= '<p class="hikashop_cart_option_name">' . $optionElement->product_name;
				if(@$optionElement->prices[0]->price_value_with_tax > 0)
					$html .= ' ( + ' . strip_tags($this->getDisplayProductPrice($optionElement, true)) . ' )';
				$html .= '</p>';
			}
		}

		if(!empty($html))
			echo '<div class="hikashop_cart_product_custom_item_fields">'.$html.'</div>';
?>
	</td>

For the notification emails it's a bit more complex as you need to load the data in the preload and display it in the HTML version.
Please understand that this is outside normal user support and contact our partners if you need customization like that and can't do it yourself:


Thanks for this. I got a very expensive quote to do this :(
Anyway, thanks for all you do.

Attachments:

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

  • Posts: 83779
  • Thank you received: 13567
  • MODERATOR
7 years 5 months ago #282895

Hi,

1. I don't know why it would work only for some product.

2. Then try contacting other developers. Some might be cheaper.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum