- Posts: 55
- Thank you received: 2
Display Brand and or Code in Product Description
14 years 3 months ago #55285
by dlarge
Display Brand and or Code in Product Description was created by dlarge
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
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.
14 years 3 months ago #55300
by esotechie
Replied by esotechie on topic Re: Display Brand and or Code in Product Description
Use Hikashop->Configuration->Display->Views to edit product->show_default
For the code you need:
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:
I hope that helps.
For the code you need:
Code:
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:
Code:
$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.
Please Log in or Create an account to join the conversation.
14 years 3 months ago #55321
by dlarge
Replied by dlarge on topic Re: Display Brand and or Code in Product Description
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.
14 years 3 months ago #55342
by dlarge
Replied by dlarge on topic Re: Display Brand and or Code in Product Description
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
<?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.
14 years 3 months ago #55415
by nicolas
Replied by nicolas on topic Re: Display Brand and or Code in Product Description
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.
14 years 2 months ago #55436
by dlarge
Replied by dlarge on topic Re: Display Brand and or Code in Product Description
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?
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?
Please Log in or Create an account to join the conversation.
14 years 2 months ago #55443
by esotechie
Replied by esotechie on topic Re: Display Brand and or Code in Product Description
It is on the page but set to not show in the CSS.
Add this to your template CSS:
Add this to your template CSS:
Code:
#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.
14 years 2 months ago #55447
by dlarge
Replied by dlarge on topic Re: Display Brand and or Code in Product Description
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
Thanks guys for your help.
Dave
Please Log in or Create an account to join the conversation.
Time to create page: 0.201 seconds