Add tab on product page

  • Posts: 13201
  • Thank you received: 2322
9 years 3 months ago #227055

Hi,

So what's displayed for now ? The tag "{loadposition related}", or nothing ?
If it is nothing, then you have to check the settings of your "related" module and be sure that its position is "related" else it will not work, this plugin must be published and displayed on any menus or at least the menu displaying the product page (a category or product listing menu).

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

  • Posts: 138
  • Thank you received: 4
9 years 3 months ago #227148

hi,
module,menu assigen,and plugin is ok,
but dont work charactrist variant
when remove that code (display related in tab) ,charactrist variant perfect worked


Joomla Developer | am.ebrahimzadeh[at]gmail.com

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

  • Posts: 13201
  • Thank you received: 2322
9 years 3 months ago #227169

Hi,

Indeed, the module is overriding all the current element and its params.
Please use that code instead:

			<?php
				$tmpElement = clone($this->element);
				$tmpParams = clone($this->params);
				echo JHTML::_('content.prepare','{loadposition related}');
				$this->element = $tmpElement;
				$this->params = $tmpParams;
			?>

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

  • Posts: 51
  • Thank you received: 1
8 years 11 months ago #239751

Hi Xavier,

I'm having an issue with the tabs on a website I'm working on.
Once I change the layout view to Tabular, the product images, item custom fields no longer displays but when I revert back to the default view, everything displays correctly.
I've done all I could with my little experience to correct this but the more I try, the more it seems i'm complicating the issue.
I really need to make the product page display in tabular layout because I created two new tabs using the tutorials here.
Please help me out. Thanks

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

  • Posts: 83678
  • Thank you received: 13547
  • MODERATOR
8 years 11 months ago #239797

Hi,

So first: rename the file templates/YOUR_TEMPLATE/html/com_hikashop/product/show_tabular.php via FTP.
And change the layout to tabular. It should now display the tabs fine.
Then, add your modifications to add the two new tabs.
If you have a problem after that, then it means that the modifications you did are not correct and we would need that you provide them to be able to tell you what to do.

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

  • Posts: 64
  • Thank you received: 7
  • Hikashop Business
8 years 11 months ago #239975

Xavier wrote: Hi,

Then you have to edit the view "product / show_tabular" and add a <li> entry for the tab as the already existings, and add a <div> for the content.

For example add:

// The tab part
<li id="hikashop_show_tabular_custom1_li" class="hikashop_tabs_li ui-corner-top"><a onclick="displayTab('hikashop_show_tabular_custom1');" href="javascript:void(0);">My custom tab 1</a></li>
// And the content part
<div class="hikashop_tabs_content" id="hikashop_show_tabular_custom1">
// Your content
</div>

To add another one, just replace "custom1" by your desired value.


This is not working. The tab is showing, but clicking on the tab makes every tab behind it move to a next line and the contents of every tab gets the contents of the added tab. Do you have the correct code to accomplish this?

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

  • Posts: 64
  • Thank you received: 7
  • Hikashop Business
8 years 11 months ago #239976

Sorry, I was being stupid. Just pasted the code, not looking. :blink:
Got it now.

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

  • Posts: 1
  • Thank you received: 0
8 years 1 week ago #268308

What should I put in "// Your content" to show content from the "Custom field" (Backend) I added, 'cos the contect from "custom fields" is shown in the tab "Specifications"

<div class="hikashop_tabs_content" id="hikashop_show_tabular_custom1">
            // Your content
        </div>

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

  • Posts: 83678
  • Thank you received: 13547
  • MODERATOR
8 years 6 days ago #268384

Instead of // Your content, you can have such code:
<?php echo $this->element->XXX; ?>
where XXX is the column name of your custom field.

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

  • Posts: 79
  • Thank you received: 2
7 years 8 months ago #277320

Hi,

I replaced the code that xavier posted, but then i see no content in the tabs, but is shows the last code in the tab view file. So its showing the javascript code. Maybe i missed something?

note: the code i am talking about is the one on page 3 which replaces the complete code of the tab view file.

Last edit: 7 years 8 months ago by rkuiper.

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

  • Posts: 79
  • Thank you received: 2
7 years 8 months ago #277350

I found the solution

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

Time to create page: 0.129 seconds
Powered by Kunena Forum