Hello
How can I set the related product in a column (in product page)...I mean the native OC related product, I don't want an extension.
I could open a new html module in layout panel and paste a code to call the related product but I do not any idea what code to insert
I don't know, what you mean with a column, but it all can be made in the
...theme/template/product/product.tpl File, (up to OC v.2.2.x at least!)
in this section, shown below, to get, by example, a layout as shown on the image!
as you can see here, and it's layout form depends on the Browser Resolution :
http://www.hitline.info/shop/index.php? ... duct_id=49
Ernie
...theme/template/product/product.tpl File, (up to OC v.2.2.x at least!)
in this section, shown below, to get, by example, a layout as shown on the image!
Code: Select all
<div class="row">
<div class="product-list clearfix">
<h3 class="col-md-12">Related Products</h3>
<article class="col-xs-12 col-sm-6 col-md-6">
<div class="product-inner" style="min-height:140px;">
http://www.hitline.info/shop/index.php? ... duct_id=49
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
OK... I isolated the related products code on the product.tpl. Any ideas how to get it to the left column. Would be great to make this into a module and place it where I need it.
Code: Select all
<?php if ($products) { ?>
<h3><?php echo $text_related; ?></h3>
<div class="row">
<?php $i = 0; ?>
<?php foreach ($products as $product) { ?>
<?php if ($column_left && $column_right) { ?>
<?php $class = 'col-xs-8 col-sm-6'; ?>
<?php } elseif ($column_left || $column_right) { ?>
<?php $class = 'col-xs-6 col-md-4'; ?>
<?php } else { ?>
<?php $class = 'col-xs-6 col-sm-3'; ?>
<?php } ?>
<div class="<?php echo $class; ?>">
<div class="product-thumb transition">
<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></a></div>
<div class="caption">
<h4><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>
<p><?php echo $product['description']; ?></p>
<?php if ($product['rating']) { ?>
<div class="rating">
<?php for ($j = 1; $j <= 5; $j++) { ?>
<?php if ($product['rating'] < $j) { ?>
<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i></span>
<?php } else { ?>
<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
<?php if ($product['price']) { ?>
<p class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
<?php } ?>
<?php if ($product['tax']) { ?>
<span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
<?php } ?>
</p>
<?php } ?>
</div>
<div class="button-group">
<button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');"><span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span> <i class="fa fa-shopping-cart"></i></button>
<button type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-heart"></i></button>
<button type="button" data-toggle="tooltip" title="<?php echo $button_compare; ?>" onclick="compare.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-exchange"></i></button>
</div>
</div>
</div>
<?php if (($column_left && $column_right) && (($i+1) % 2 == 0)) { ?>
<div class="clearfix visible-md visible-sm"></div>
<?php } elseif (($column_left || $column_right) && (($i+1) % 3 == 0)) { ?>
<div class="clearfix visible-md"></div>
<?php } elseif (($i+1) % 4 == 0) { ?>
<div class="clearfix visible-md"></div>
<?php } ?>
<?php $i++; ?>
<?php } ?>
</div>
<?php } ?>
Who is online
Users browsing this forum: No registered users and 39 guests