Post by meistralf » Thu Apr 16, 2015 12:55 pm

Can someone hep me to fix this. I want it look likes category view grid but it came out like that.

Attachments

related.jpg

related.jpg (32.09 KiB) Viewed 464 times


Newbie

Posts

Joined
Tue Mar 24, 2015 4:07 pm

Post by gilaraujo » Sun Apr 19, 2015 6:47 pm

Which version of OC you running?
Are you running a custom theme?

New member

Posts

Joined
Fri Mar 27, 2015 10:32 pm

Post by meistralf » Mon Apr 20, 2015 9:34 am

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.

Newbie

Posts

Joined
Tue Mar 24, 2015 4:07 pm

Post by wishmedia » Tue Apr 21, 2015 4:07 am

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

User avatar
New member

Posts

Joined
Sun Feb 08, 2015 5:12 am


Post by meistralf » Wed Apr 22, 2015 12:08 pm

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 } ?>

Newbie

Posts

Joined
Tue Mar 24, 2015 4:07 pm

Post by wishmedia » Wed Apr 22, 2015 12:42 pm

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.

User avatar
New member

Posts

Joined
Sun Feb 08, 2015 5:12 am


Post by meistralf » Wed Apr 22, 2015 5:51 pm

Thank you so much! It works!

Newbie

Posts

Joined
Tue Mar 24, 2015 4:07 pm
Who is online

Users browsing this forum: No registered users and 6 guests