custom TAB for dimensions weight showing in main product descripton area as well

Started by ch1vph, June 18, 2019, 15:18:04 PM

Previous topic - Next topic

ch1vph

Hi there,

I'm having a bit of trouble understanding why I'm seeing my 'PRODUCT DIMENSIONS AND WEIGHT' in the main product description text/tab/area as well as the separate TAB I created for the dimensions and weight as per this post here: https://forum.virtuemart.net/index.php?topic=101535.msg483309#msg483309

Example of the area seen in the screenshots...

Thanks in advance!

Studio 42

You certainly not closed the TAB or closed it at wrong place.
This is the bootstrap 2.32 code sample
<ul class="nav nav-tabs">
  <li class="active"><a href="#tab1">Home</a></li>
  <li><a href="#tab2">Profile</a></li>
  <li><a href="#tab3">Messages</a></li>
 
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="tab1">...<>
  <div class="tab-pane" id="tab2">...<>
  <div class="tab-pane" id="tab3">...<> 
<>

If the tab dont change you have to add in the "li>a"
data-toggle="tab"

ch1vph

ok thanks for the advice but I'm really not too sure: If you could quickly cast your eye over this code and point me in the direction of the 'main product description'

<div class="productdetails-tabs">
<ul class="nav nav-tabs">
<li class="active"><a href="#desc" data-toggle="tab"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE'?></a></li>
<li><a href="#review" data-toggle="tab">Specs & Sizes</a></li>
</ul>
<div class="tab-content">
<?php //Product Weight
if (!(($this->product->product_weight)==0)) { ?>

<li>
<span class="product-fields-title" >
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_WEIGHT'?>
</span>
<?php echo floor($this->product->product_weight)  ?>
grams</br></li>
<?php ?>

<?php //Product Length
if (!(($this->product->product_length)==0)) { ?>

<li>
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_LENGTH'?>
<?php echo floor($this->product->product_length?>
cm</br></li>
<?php ?>

<?php //Product Width
if (!(($this->product->product_width)==0)) { ?>

<li>
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_WIDTH'?>
<?php echo floor($this->product->product_width?>
cm</br></li>
<?php ?>

<?php //Product Height
if (!(($this->product->product_height)==0)) { ?>

<li>
<span class="product-fields-title" >
<?php echo JText::_('COM_VIRTUEMART_PRODUCT_HEIGHT'?>
</span>
<?php echo floor($this->product->product_height?>
cm</br></li>
<?php ?>
<br>
<div id="desc" class="tab-pane fade active in">
<?php 
// Product Description
if (!empty($this->product->product_desc)) {
?>

<div class="product-description">
<?php /** @todo Test if content plugins modify the product description */ ?>
<span class="title"><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE'?></span>
<?php echo $this->product->product_desc?>
</div>
<?php
// Product Description END
?>

</div>

Studio 42

This code
            <?php //Product Weight
   
if (!(($this->product->product_weight)==0)) { ?>

               <li>
               <span class="product-fields-title" >
               <?php echo JText::_('COM_VIRTUEMART_PRODUCT_WEIGHT'?>
               </span>
               <?php echo floor($this->product->product_weight)  ?>
               grams</br></li>
            <?php ?>
   
   <?php //Product Length
   
if (!(($this->product->product_length)==0)) { ?>

               <li>
               <?php echo JText::_('COM_VIRTUEMART_PRODUCT_LENGTH'?>
               <?php echo floor($this->product->product_length?>
               cm</br></li>
            <?php ?>
   
   <?php //Product Width
   
if (!(($this->product->product_width)==0)) { ?>

               <li>
               <?php echo JText::_('COM_VIRTUEMART_PRODUCT_WIDTH'?>
               <?php echo floor($this->product->product_width?>
               cm</br></li>
            <?php ?>
   
   <?php //Product Height
   
if (!(($this->product->product_height)==0)) { ?>

               <li>
               <span class="product-fields-title" >
               <?php echo JText::_('COM_VIRTUEMART_PRODUCT_HEIGHT'?>
               </span>
               <?php echo floor($this->product->product_height?>
               cm</br></li>
            <?php ?>
            <br>

should be inside the <div id="review">


ch1vph

Hi All,

I did have this code above and as below in the Review Tab, but it now no longer displays when I click that TAB. The other issue is that the original TAB also disappears!?

This is the code I have in my default.php mytemplates/html/com_virtuemart/productdetails does this all look ok and correct??

<div id="review" class="tab-pane fade">
     

            <?php //Product Weight
   
if (!(($this->product->product_weight)==0)) { ?>

               <li>
               <span class="product-fields-title" >
               <?php echo JText::_('COM_VIRTUEMART_PRODUCT_WEIGHT'?>
               </span>
               <?php echo floor($this->product->product_weight)  ?>
               grams</br></li>
            <?php ?>
   
   <?php //Product Length
   
if (!(($this->product->product_length)==0)) { ?>

               <li>
               <?php echo JText::_('COM_VIRTUEMART_PRODUCT_LENGTH'?>
               <?php echo floor($this->product->product_length?>
               cm</br></li>
            <?php ?>
   
   <?php //Product Width
   
if (!(($this->product->product_width)==0)) { ?>

               <li>
               <?php echo JText::_('COM_VIRTUEMART_PRODUCT_WIDTH'?>
               <?php echo floor($this->product->product_width?>
               cm</br></li>
            <?php ?>
   
   <?php //Product Height
   
if (!(($this->product->product_height)==0)) { ?>

               <li>
               <span class="product-fields-title" >
               <?php echo JText::_('COM_VIRTUEMART_PRODUCT_HEIGHT'?>
               </span>
               <?php echo floor($this->product->product_height?>
               cm</br></li>
            <?php ?>
            <br>
</div>
</div>
</div>
</div>
<div class="clear"></div>

Studio 42

Hard to know, but code is poor and you have a missing closing brackets
if (!(($this->product->product_weight)==0))
should be
if ($this->product->product_weight !=0)
same for your other case