Answer the question
In order to leave comments, you need to log in
How to arrange columns in an OpenCart template?
In the standard OpenCart template in the desktop version, the left, center and right columns are displayed in turn. In the mobile version, the order of the columns is the same, first the side column is displayed at the top, below the central one and even lower again the side column. How can I make the central column appear at the very top under the header in the mobile version, and the side columns follow it below?
Answer the question
In order to leave comments, you need to log in
<?php echo $header; ?>
<div class="container">
<div class="row">
<?php echo $column_left; ?>
<?php if ($column_left && $column_right) { ?>
<?php $class = 'col-sm-6'; ?>
<?php } elseif ($column_left || $column_right) { ?>
<?php $class = 'col-sm-9'; ?>
<?php } else { ?>
<?php $class = 'col-sm-12'; ?>
<?php } ?>
<div id="content" class="<?php echo $class; ?>">
<?php echo $content_top; ?>
<?php echo $content_bottom; ?>
</div>
<?php echo $column_right; ?></div>
</div>
<?php echo $footer; ?>
<script type="text/javascript">
{
if (screen.width < 480) document.write ('<script type="text/javascript" src="catalog/view/javascript/headjs.js" ></script>');
}
</script>
window.onload = function(){
var b1 = document.getElementById("column-left");
var b2 = document.getElementById("content");
b1.parentNode.insertBefore(b2, b1);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question