jcomments in tabber on product page
-
Posts: 72
-
Thank you received: 2
-
-
-
-
-
-
-
Posts: 82868
-
Thank you received: 13376
-
MODERATOR
-
-
-
-
-
-
-
Posts: 72
-
Thank you received: 2
-
-
-
-
-
-
12 years 1 month ago
#69072
Hi Nicolas,
so if I understand this right the code change would put the taps on the product page by default.
I am already displaying tabs on the product page by simply inserting the tabber syntax into the product description - that is really easy.
www.juzodesign.com/index.php/shop/produc...wool-and-velvet-vest
At the body of the product page jcomments is listed and this is the part that I want in a tab. Your code change is the way to do this?
Thomas
Please Log in or Create an account to join the conversation.
-
Posts: 82868
-
Thank you received: 13376
-
MODERATOR
-
-
-
-
-
-
12 years 1 month ago
#69073
Yes, to have comments in tabs, you should not use tabs in the description but in the layout code as explained in the link I gave.
Please Log in or Create an account to join the conversation.
-
Posts: 72
-
Thank you received: 2
-
-
-
-
-
-
12 years 1 month ago
#69078
Hello again Nicolas,
I am still a little bit confused about the details.
I am editing the show.php file from the product view of my template's front end - correct?
I can not find the string
<div id="hikashop_product_description_main" class="hikashop_product_description_main">
in this file
also can not find string
<?php
$this->setLayout('show_block_product_files');
I can find
<div class="hikashop_submodules" id="hikashop_submodules" style="clear:both">
<?php
if (!empty ($this->modules) && is_array($this->modules)) {
jimport('joomla.application.module.helper');
foreach ($this->modules as $module) {
echo JModuleHelper :: renderModule($module);
}
}
?>
</div>
in line 284 - 293
so where in product/show.php am I to insert the tabber syntax?
I have attached the show.php file as is at the moment
Please Log in or Create an account to join the conversation.
-
Posts: 72
-
Thank you received: 2
-
-
-
-
-
-
12 years 1 month ago
#69079
Or am I editing show_default.php ?
I guess that is the one to change?
Please Log in or Create an account to join the conversation.
-
Posts: 72
-
Thank you received: 2
-
-
-
-
-
-
12 years 1 month ago
#69081
so these are the changes I did - and I think I followed the example of the link you provided
<div id="hikashop_product_bottom_part" class="hikashop_product_bottom_part">
{tab=Portrait}
<div id="hikashop_product_description_main" class="hikashop_product_description_main">
<?php
echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description));
?>
<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main">
<?php
$this->row = & $this->element;
$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . ',\'cart\'); } else { return false; }';
$this->setLayout('quantity');
echo $this->loadTemplate();
?>
</div>
<span id="hikashop_product_price_main" class="hikashop_product_price_main">
<?php
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
?>
</span>
</div>
<span id="hikashop_product_url_main" class="hikashop_product_url_main">
<?php
if (!empty ($this->element->product_url)) {
echo JText :: sprintf('MANUFACTURER_URL', '<a href="' . $this->element->product_url . '" target="_blank">' . $this->element->product_url . '</a>');
}
?>
</span>
{tab=Shipping}
<?php
$this->setLayout('show_block_product_files');
echo $this->loadTemplate();
?>
<div id="hikashop_product_vote_listing" class="hikashop_product_vote_listing">
<?php
if($this->params->get('show_vote_product')){
$js = '';
if(isset($this->element->main)){
$product_id = $this->element->main->product_id;
}else{
$product_id = $this->element->product_id;
}
$this->params->set('product_id',$product_id);
echo hikashop_getLayout('vote', 'listing', $this->params, $js);
?>
</div>
<div id="hikashop_product_vote_form" class="hikashop_product_vote_form">
<?php
$js = '';
if(isset($this->element->main)){
$product_id = $this->element->main->product_id;
}else{
$product_id = $this->element->product_id;
}
$this->params->set('product_id',$product_id);
echo hikashop_getLayout('vote', 'form', $this->params, $js);
}
?>
</div>
{tab=Comments}
<div class="hikashop_submodules" id="hikashop_submodules" style="clear:both">
<?php
if (!empty ($this->modules) && is_array($this->modules)) {
jimport('joomla.application.module.helper');
foreach ($this->modules as $module) {
echo JModuleHelper :: renderModule($module);
}
}
?>
</div>
</div>
and this is the front end view I get
www.juzodesign.com/index.php/shop/produc...velvet-vest#shipping
the top tabs are still from the syntax in the field description from backend - but the tabs underneath dont work either.
Also, the module in the tab is the related items and not jcomments, which is still at the bottom.
So how do I do it properly?
3 Tabs - description - text - text - jcomments
Regards,
Thomas
Please Log in or Create an account to join the conversation.
-
Posts: 72
-
Thank you received: 2
-
-
-
-
-
-
-
Posts: 72
-
Thank you received: 2
-
-
-
-
-
-
12 years 1 month ago
#69206
I will have to revert back to the view I had originally for now - it looks too off.
So Nicolas, the placement of the first tabber tag works great - it displays the contents of description including cart button and price.
Issues:
1.)Jcomments does not show up in a tab
2.)I get an error message
Warning: trim() expects parameter 1 to be string, array given in /...URL/libraries/joomla/registry/format/json.php on line 59
What I would like:
Tab #2 (shipping) should display custom text - I state free shipping if it applies
Tab #3 (size chart) then is a size chart.
Tab #4 (comments) I would like to have the jcomments contents.
The 'related items' module I would like to leave out of a tab - as is on the bottom of the product page.
1. how do I include the string that calls just the jcomments but not the related article
2. how do I have tabs that let me enter text on an individual basis
It would be great if you could help me with this.
Kind regards,
Thomas
Please Log in or Create an account to join the conversation.
-
Posts: 82868
-
Thank you received: 13376
-
MODERATOR
-
-
-
-
-
-
12 years 1 month ago
#69404
Hi,
It's normal that jcomments does not show up in a tab with the way you did it.
As I said, you would have to also edit the file "show" of the view "product". That's where jcomments is called:
$config = & hikashop_config();
if ($config->get('comments_feature') == 'jcomments') {
$comments = HIKASHOP_ROOT . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once ($comments);
if (hikashop_getCID('product_id')!=$this->element->product_id && isset ($this->element->main->product_name)){
$product_id = $this->element->main->product_id;
$product_name = $this->element->main->product_name;
}else{
$product_id = $this->element->product_id;
$product_name = $this->element->product_name;
}
echo JComments::showComments($product_id, 'com_hikashop', $product_name);
}
}
The simplest will be to remove the external comments block of code from the show file and add it inside your tabs in the show_default view file.
I don't see any warning on your page.
Please Log in or Create an account to join the conversation.
-
Posts: 72
-
Thank you received: 2
-
-
-
-
-
-
12 years 1 month ago
#69745
Hello Nicolas,
yes I understand this and it makes sense to me.
I edited the default_view accordingly
this is the code:
{tab=Portrait}
<div id="hikashop_product_description_main" class="hikashop_product_description_main">
<?php
echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description));
?>
</div>
<span id="hikashop_product_url_main" class="hikashop_product_url_main">
<?php
if (!empty ($this->element->product_url)) {
echo JText :: sprintf('MANUFACTURER_URL', '<a href="' . $this->element->product_url . '" target="_blank">' . $this->element->product_url . '</a>');
}
?>
</span>
<?php
$this->setLayout('show_block_product_files');
echo $this->loadTemplate();
?>
<div id="hikashop_product_vote_listing" class="hikashop_product_vote_listing">
<?php
if($this->params->get('show_vote_product')){
$js = '';
if(isset($this->element->main)){
$product_id = $this->element->main->product_id;
}else{
$product_id = $this->element->product_id;
}
$this->params->set('product_id',$product_id);
echo hikashop_getLayout('vote', 'listing', $this->params, $js);
?>
</div>
<div id="hikashop_product_vote_form" class="hikashop_product_vote_form">
<?php
$js = '';
if(isset($this->element->main)){
$product_id = $this->element->main->product_id;
}else{
$product_id = $this->element->product_id;
}
$this->params->set('product_id',$product_id);
echo hikashop_getLayout('vote', 'form', $this->params, $js);
}
?>
</div>
{tab=comments}
$config = & hikashop_config();
if ($config->get('comments_feature') == 'jcomments') {
$comments = HIKASHOP_ROOT . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once ($comments);
if (hikashop_getCID('product_id')!=$this->element->product_id && isset ($this->element->main->product_name)){
$product_id = $this->element->main->product_id;
$product_name = $this->element->main->product_name;
}else{
$product_id = $this->element->product_id;
$product_name = $this->element->product_name;
}
echo JComments::showComments($product_id, 'com_hikashop', $product_name);
}
}
</div>
I thought this should now display 2 tabs, one with the description and the other with the comments.
Anyway, nothing has changed on the front end view and I am very confused by that.
I have cleared the cache of the site.
This is the URL of a product page that loads default view, which should now have the tabs - but it looks just like before:
www.juzodesign.com/index.php/shop/produc...aux-chenille-cushion
and this is one where the tabs syntax is still in the description field.
www.juzodesign.com/index.php/categories/...wool-and-velvet-vest
As you can see both are not effected by the changes in the default_view.php
I don't get it.
What do you think I do wrong?
Thanks,
Thomas
Please Log in or Create an account to join the conversation.