- Posts: 490
- Thank you received: 2
how to add tabs on default view product page
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.5
-- Error-message(debug-mod must be tuned on) -- : no errors
i want to display tabs on the default products page.
configuration is
Layout on product page > Default.
take note that i dont want to remove the specifications column located on the right side of the product.
i just want to add tabs below the product.
1. how can i do this?how can i create tabs using the default layout?how can i move the position of the specifications column?
2. what if i use tabular view, how do i add custom fields to appear below add to cart? on jikashop backend you can add custom fields but no way to select where to display it.
3. what are the positions available for custom fields?
4. is it possible to remove custom fields inside the specifications tab?
5. how to replicate custom fields inside specifications tab?
By the way
i already tried this, by xavier but i cant make it work. all custom fields appear inside the specifications tab. i can create a new tab but its always empty. plus i want the specifications column located on the right side of the product
hikashop.com/forum/product-category-disp...t-customisation.html
Please Log in or Create an account to join the conversation.
Then why not add the tabs in the description with such extension ?
extensions.joomla.org/extension/tabs
That way, you keep the specifications on the right side and you have your tabs done easily at the bottom.
Because adding the tabs system in the default view requires properly development. You need to be careful to put the correct HTML/PHP from the show_tabular view file but also the javascript which handles the tabs there.
Please Log in or Create an account to join the conversation.
I am aware of that extension but not a priority. Can you please help me by answering my questions?
Thanks so much
Please Log in or Create an account to join the conversation.
My answer was for a simpler solution for you since you apparently had a hard time doing that customization yourself.
1. You can copy the javascript and PHP/HTML relative to the tabs from the show_tabular to the show_default view file to get the tabs there:
3. There are no positioning options for custom fields.
Please Log in or Create an account to join the conversation.
Notice: Undefined variable: hide_specs in
\wamp\www\workspace\purity\templates\purity_iii\html\com_hikashop\product\show_default.php on line 200Notice: Undefined variable: status_vote in
\wamp\www\workspace\purity\templates\purity_iii\html\com_hikashop\product\show_default.php on line 2032. If I apply the extension, can it be set as default ?
Thanks
Please Log in or Create an account to join the conversation.
another example is what if i want to add a custom field infront of the product title or hikashop_product_name_main, i know how to create the custom field but dont know how to change its location
Also how do i remove the custom fields from the specifications tab? or specifications. apparently all custom fields appear under specifications.
thanks
Please Log in or Create an account to join the conversation.
@twscott:
1. turn off the "error reporting" setting of the Joomla configuration.
2. I'm sorry but I don't understand what you mean. What do you want to set as default ?
@ronron:
In that case, you need to customize the file "show_block_custom_main" with custom code to display the fields or not.
For example, you could add such line at the end:
<?php $this->done_once = true; ?>
and then, where the fields are displayed, you could add a condition att he beginning of the foreach:
if($fieldName== 'XXX' && empty($this->done_once)) continue;
and that would skip the display of the field XXX in the right area, while:
if($fieldName== 'YYY' && !empty($this->done_once)) continue;
would skip the display of the field YYY in the tab area.
Please Log in or Create an account to join the conversation.
please clarify you said
For example, you could add such line at the end:
<?php $this->done_once = true; ?>
where in block_custom_main should i add this file? tried adding it at the end of the file but nothing happened ? where should i add the code above?
again, you said
and then, where the fields are displayed, you could add a condition att he beginning of the foreach:
i did not see any foreach on the default and tabular file. in my case im using the default file. i did not see any foreach. i saw this code to call the show_block_custom_main" but where to add the next codes below? can you please specify?
for example i have 2 custom fields.
1. cutom_right > should appear on the right
2. custom_taabular_not_in_pecifications> should appear on tabular but not in specification.
can we use this as examples?
also what is the custom field name? is it the column name?
Please Log in or Create an account to join the conversation.
1. The <?php $this->done_once = true; ?> line by itself won't change anything. You also need to other piece of code.
2. That's normal. I've only talked about the show_block_custom_main so it's in there that you need to add it.
And as I said, you need to add it just after the foreach in there. To more more clear, after this line:
foreach ($this->fields as $fieldName => $oneExtraField) {
Please Log in or Create an account to join the conversation.
my new problem is that i have two(2) 'specifications tab'. One on the right and the other on tabs. I tried to change it using joomla language overrrides but both of them gets changes. how do i change both of them? example on the right is 'Product Specs' and on the tabs is 'Product Details'?
thanks
Please Log in or Create an account to join the conversation.
First, do as I said and put the $this->done_once = true; line at the end of the show_block_custom_main view file.
Then, you can change the code:
JText::_('SPECIFICATIONS')
to:
(@$this->done_once? 'Product Details' : 'Product Specs' )
in that same file.
Please Log in or Create an account to join the conversation.
what about the following fields? i want it only on the right side. i tried this codes. it doesn't work. these are not custom fields.
the codes below work on custom fields but not on the following fields.
if($fieldName== 'weight' && !empty($this->done_once)) continue;
if($fieldName== 'width' && !empty($this->done_once)) continue;
if($fieldName== 'brand' && !empty($this->done_once)) continue;
if($fieldName== 'length' && !empty($this->done_once)) continue;
if($fieldName== 'height' && !empty($this->done_once)) continue;
Please Log in or Create an account to join the conversation.
If the fields are not custom fields they are not handle in the view "show_block_custom_main" (as Nicolas told you).
Please take a look at that documentation page and the image which explain which view is displaying which product element.
And you will see the view you're looking for just below the price.
www.hikashop.com/support/documentation/1...-display.html#layout
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
thanks.
Please Log in or Create an account to join the conversation.
i did not make a new thread as my question is related to the custom fields i created.
i added variants to my product. Variants are ok as can be seen here
Part of the message is hidden for the guests. Please log in or register to see it.
The problem is that when clicking on the variants all custom codes that i hid appears.
BEFORE
AFTER
Can i add something to the existing codes?
thanks
Please Log in or Create an account to join the conversation.
This indicates a problem with your customization.
The variants HTML is added to the page in the "show" file of the view "product", so maybe you need to modify stuff there so that it works like in show_tabular ?
Please Log in or Create an account to join the conversation.
but i realize that there is a difference in the codes this is from product / show.php
the code from show_block_custom_main.php has '$value = '';' right after the bracket as seen below.
do i have to keep it or not?
thanks again
Please Log in or Create an account to join the conversation.
The line:
$value = '';
is there only to avoid a potential warning. You can ignore it and I would recommend to keep it there.
Please Log in or Create an account to join the conversation.