News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

related prodcuts not working

Started by davidb34ni, March 12, 2012, 02:56:51 AM

Previous topic - Next topic

davidb34ni

as you can see i have a probelm the related proudcts menu is messed up while their is indead three products its showing only the master product image

http://www.lpctents.com/product/tent/outwell/avantgarde/outwell-delaware-5-tent-detail

its like their is a increment messing

this is my code


      <div class="product-related-products">
      <h4 style="font-family:Helvetica; font-size:18px; "><?php echo JText::_('COM_VIRTUEMART_RELATED_PRODUCTS'); ?></h4>

      <?php
      foreach ($this->product->customfieldsRelatedProducts as $field){
         ?>
         <div style="width:25%;float:left;border:2px solid #606060;height:348px;text-align:center;float:left;" class="product-field product-field-type-<?php echo $field->field_type ?>">
            <div style="height:40px;"><h2 style="color:#495eaa;font-size:14px;"><?php echo JHTML::link($this->product->link, $this->product->product_name); ?></h2></div>
            <table style="height:192px;width:192px;">
                     <tr>
                        <td style="vertical-align:center;"><?php /** @todo make image popup */
                     echo $this->product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$this->product->product_name.'" ',true,'class="modal"');
                  ?>
                  
                  </td>
                  </tr>
                  </table>
          <span style="font-family:myriad pro;font-size:13px;color:#000000;font-style:italic;">RRP </span><span style="font-family:myriad pro;font-size:12px;color:#000000;">£<?php echo round($this->product->product_price,2) ?></span><br/>
               <span style="font-family:myriad pro;font-size:14px;color:#1f3996;font-style:italic;">OUR PRICE </span><span style="font-family:myriad pro;font-size:19px;color:#1f3996;">£<?php echo round($this->product->product_override_price,2) ?></span><br/>
               <?php
                        $save = $this->product->product_price -$this->product->product_override_price;
                  echo "<span style='font-family:myriad pro;font-size:14px;color:#ac0b0b;font-style:italic;'>YOU SAVE</span><span style='font-family:myriad pro;font-size:13px;color:#ac0b0b;'> £".$save."</span>";
                     ?>
                     <p>
               <div class="product-details">
               <?php // Product Details Button
               echo JHTML::link($this->product->link, JText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $this->product->product_name,'class' => 'product-details'));
               ?>
               </div>
               </p>
               </div>
               <div class="clear"></div>
         </div>
         <?php
      } ?>
   

SamF

Try to change the part of your code in the end from this:


   </div>
   <div class="clear"></div>
</div>
<?php
    
?>


to this:


   </div>
<?php
      
}  ?>

   <div class="clear"></div>
</div>

davidb34ni

sam its the fact their priting out the master product its not even printing out the related somereason

SamF

You close your .product-related-products div before you end the loop for related products. That's the reason. Just try...

</div>
<?php
      
}  ?>

   <div class="clear"></div>
</div>

davidb34ni

That fixed the formatting issue but not the out still three of the same product when their complety differnt related products hence the code

http://www.lpctents.com/product/clearance/easy-camp-phantom-300-detail

SamF

#5
Quote from: davidb34ni on March 12, 2012, 22:51:33 PM
That fixed the formatting issue

Well done! :)

Quote from: davidb34ni on March 12, 2012, 22:51:33 PM
still three of the same product when their complety differnt related products hence the code

That's not the code. I may guess, that that is in your product list.

Check your "main" product in the back end, which products are related to it? Compare to other products.

rupesh

Quote from: SamF on March 13, 2012, 05:44:52 AM
Quote from: davidb34ni on March 12, 2012, 22:51:33 PM
That fixed the formatting issue

Well done! :)

Quote from: davidb34ni on March 12, 2012, 22:51:33 PM
still three of the same product when their complety differnt related products hence the code

That's not the code. I may guess, that that is in your product list.

Check your "main" product in the back end, which products are related to it? Compare to other products.

@ sam Can u plz tell me how to show related products in vm 2.0 and joomla 1.7

SamF