Page 1 of 1

related product problem

Posted: Thu Apr 16, 2015 12:55 pm
by meistralf
Can someone hep me to fix this. I want it look likes category view grid but it came out like that.

Re: related product problem

Posted: Sun Apr 19, 2015 6:47 pm
by gilaraujo
Which version of OC you running?
Are you running a custom theme?

Re: related product problem

Posted: Mon Apr 20, 2015 9:34 am
by meistralf
i use 1.5.4 and egestas theme. here is my url.
i don't know where to edit this. i already try on css and product.tpl but nothing happen.

http://www.malaysiashoppingvalley.com/i ... duct_id=74

Thank you.

Re: related product problem

Posted: Tue Apr 21, 2015 4:07 am
by wishmedia
meistralf wrote:i use 1.5.4 and egestas theme. here is my url.
i don't know where to edit this. i already try on css and product.tpl but nothing happen.

http://www.malaysiashoppingvalley.com/i ... duct_id=74

Thank you.
Your Related Products are missing a closing </div> tag

Re: related product problem

Posted: Wed Apr 22, 2015 12:08 pm
by meistralf
wishmedia wrote:
meistralf wrote:i use 1.5.4 and egestas theme. here is my url.
i don't know where to edit this. i already try on css and product.tpl but nothing happen.

http://www.malaysiashoppingvalley.com/i ... duct_id=74

Thank you.
Your Related Products are missing a closing </div> tag
This is my code at product.tpl. Can you show me which one? Because i'm not good in programming and i already try add the </div> but still not work. Thanks for help!

Code: Select all

 <?php if ($products) { ?>
 <div class="box-heading"><span><?php echo $tab_related; ?></span></div>
  <div class="box-content"></div>
    <div class="box-product product-grid">
      <?php foreach ($products as $product) { ?>
      <?php
        $thumb_width = $this->config->get('config_image_related_width');
        $thumb_height = $this->config->get('config_image_related_height');
       ?>
      <div>
       <?php if ($product['thumb']) { ?>
        <div class="image"><a href="<?php echo $product['href']; ?>" style="<?php echo ($thumb_height < 150) ? 'line-height: 150px' : ''; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
        <?php } else { ?>
        <div class="image">
			<span class="no-image" style="<?php echo ($thumb_width < 150) ? 'width: 150px' : 'width: '.$thumb_width.'px'; ?>; <?php echo ($thumb_height < 150) ? 'line-height: 150px' : 'line-height: '.$thumb_height.'px;'; ?>">
			<img src="image/no_image.jpg" alt="<?php echo $product['name']; ?>" /></span>
        </div>
       
        <?php } ?>
        <div class="name" style="width: <?php echo $thumb_width; ?>px"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
         <?php } ?>
      <!--<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>-->
      <div class="description"><?php echo $product['description']; ?></div>
      <!--<?php if ($product['price']) { ?>
      <div class="price">
        <?php if (!$product['special']) { ?>

        <div><span class="price-fixed"><?php echo $product['price']; ?></span></div>
        <?php } else { ?>
		<div class="special-price"><span class="price-old"><?php echo $product['price']; ?></span><span class="price-fixed"><?php echo $product['special']; ?></span></div>-->
      
        <?php } ?>
      </div>
        </div>
        <?php if ($product['rating']) { ?>
        <div class="rating"><img src="catalog/view/theme/egestas/image/icons/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
        <?php } ?>
		<div class="details">
		
      
        </div>
      </div>
      <?php } ?>

Re: related product problem

Posted: Wed Apr 22, 2015 12:42 pm
by wishmedia
Try:

Code: Select all

<?php if ($products) { ?>
 
    <div class="box-heading"><span><?php echo $tab_related; ?></span></div>

    <div class="box-content"></div>
        <div class="box-product product-grid">
            <?php foreach ($products as $product) { ?>

            <?php
                $thumb_width = $this->config->get('config_image_related_width');
                $thumb_height = $this->config->get('config_image_related_height');
            ?>
            
            <div>
                
                <?php if ($product['thumb']) { ?>
                    <div class="image"><a href="<?php echo $product['href']; ?>" style="<?php echo ($thumb_height < 150) ? 'line-height: 150px' : ''; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
                <?php } else { ?>
                
                    <div class="image">
                        <span class="no-image" style="<?php echo ($thumb_width < 150) ? 'width: 150px' : 'width: '.$thumb_width.'px'; ?>; <?php echo ($thumb_height < 150) ? 'line-height: 150px' : 'line-height: '.$thumb_height.'px;'; ?>">
                        <img src="image/no_image.jpg" alt="<?php echo $product['name']; ?>" /></span>
                    </div>
               
                <?php } ?>
                
                <div class="name" style="width: <?php echo $thumb_width; ?>px"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
                        
                <div class="description"><?php echo $product['description']; ?></div>
        
                <?php if ($product['rating']) { ?>
                <div class="rating"><img src="catalog/view/theme/egestas/image/icons/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
                <?php } ?>
            
                <div class="details">
                </div>
            
            </div>
      
        <?php } ?>
        </div>
    </div>
<?php } ?>

The only way you will learn is to work at these things until you figure it out - if this isn't something you want to do I would suggest looking to find a developer that can work with you to help you reach your goals.

All I did was take your snippet of code and remove all the extra junk until it made sense - it was fairly simple to do and something with a little work you could accomplish yourself!

Let me know if this works for you.

Re: related product problem

Posted: Wed Apr 22, 2015 5:51 pm
by meistralf
Thank you so much! It works!