Display Brand and or Code in Product Description

  • Posts: 55
  • Thank you received: 2
12 years 4 months ago #55285

Hi,

Im in the process of having a look at the basic hikashop to see if I can produce a bookstore for a client. They want to be able to show the author of each book and the IBN Number. Im thinking I could use the "Brand" as the author and the code field for the IBN Number. Is there an easy way to get these to show on the product page? Or alternatively if someone knows of a better way to do that I would be eternally grateful.

Thanks

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

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55300

Use Hikashop->Configuration->Display->Views to edit product->show_default

For the code you need:

echo $this->element->product_code;

For the brand I do not think there is a variable set for you to return (I am sure someone will correct me if I am wrong), but you could use SQL in the same file. Something like:
      $db =& JFactory::getDBO();
      $query = 'select category_name from '.hikashop_table('category').' where category_id = '.$this->element->product_manufacturer_id;
      $db->setQuery($query);
      $brand = $db->loadResult();
      echo $brand;

I hope that helps.

The following user(s) said Thank You: nicolas, dlarge

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

  • Posts: 55
  • Thank you received: 2
12 years 4 months ago #55321

Thank You esotechie I will give it a go and see how I get on

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

  • Posts: 55
  • Thank you received: 2
12 years 4 months ago #55342

Ok I kinda got what i needed regarding the product_code. I was in fact using show_reverse to show my products so went into the file - I did notice it already had the code below, which makes me think that there is a button somewhere that will get the code to show automatically but I may be misunderstanding the code as im certainly not a developer.

<?php if ($this->config->get('show_code')) { ?>
<span id="hikashop_product_code_main"

class="hikashop_product_code_main">
<?php
echo $this->element->product_code;

But anyway i copied echo $this->element->product_code; and pasted it elsewhere just to see if I can get the code to appear which it did. My only problem with this is because the products have variations (hardback and paperback) when i click either of the radio buttons the product code then dissapears, so im assuming that once these buttons are pressed its then using a different php file somewhere.

So I guess my questions are now - is there actually a button somewhere that will auto insert my product code into the product listing and if not how can i get my pasted product_code echo line to appear when either of the variant radio buttons are pressed.

Thanks


Dave

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

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 4 months ago #55415

In the Display tab of the configuration, there is a global option "show product code" to display or hide the product code globally in HikaShop since 1.5.8 (it will display on the product page, the invoice, the emails, the order,...)

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

  • Posts: 55
  • Thank you received: 2
12 years 4 months ago #55436

Hi Nicolas,

Thank you for your reply - I had already ticked the show product code - which olnly seems to show the product code on the product category page and not on the actual product page. I have attached some images so you can see - it may be that I have some other settings i need to look at?

Attachments:

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

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55443

It is on the page but set to not show in the CSS.

Add this to your template CSS:

#hikashop_product_code_main.hikashop_product_code_main {visibility: visible; display: inline;}

The following user(s) said Thank You: nicolas

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

  • Posts: 55
  • Thank you received: 2
12 years 4 months ago #55447

Thats Brill now got what i want - just need to have a play to get it to appear on the line underneath now.

Thanks guys for your help.

Dave

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

Time to create page: 0.082 seconds
Powered by Kunena Forum