Hey, I managed to do this.
1) I created template override:
html/com_hikashop/product/listing_img_title.php
and in line 72 I added
<span class="hikashop_product_opis">
<?php echo $this->row->product_description; ?>
</span>
2) I added switch buttons with jQuery:
jQuery('.sortowanie').before('<div id=switch>Widok: <a id="3kol" href=#><img src="/new/images/icons/widok2.png" alt="3 kolumny" /></a> <a id="1kol" href=#><img src="/new/images/icons/widok1.png" alt="1 kolumna z opisem" /></a></div>');
3) Then I added the click behaviour:
jQuery('#1kol').click(function(e){
e.preventDefault();
jQuery('.hikashop_products_listing_main').addClass('kolumna1');
});
jQuery('#3kol').click(function(e){
e.preventDefault();
jQuery('.hikashop_products_listing_main').removeClass('kolumna1');
})
4) I added CSS rules:
.hikashop_product_opis {
display:none;
}
.kolumna1 .hkc-md-4 {
width:100% !important;
}
.kolumna1 .hikashop_product_opis {
display:block
}
.kolumna1 .hikashop_product_image {
float:left;
}
5) Finally I even addes Cookie rules, so If any client prefers 1 column view, he will get it as default in all categories. So the full code from 3) looks like this
var Cookies2 = Cookies.noConflict();
jQuery('#1kol').click(function(e){
e.preventDefault();
jQuery('.hikashop_products_listing_main').addClass('kolumna1');
Cookies2.set('widok', '1kol');
});
jQuery('#3kol').click(function(e){
e.preventDefault();
jQuery('.hikashop_products_listing_main').removeClass('kolumna1');
Cookies2.set('widok', '3kol');
})
var widok = Cookies2.get('widok');
//console.log(widok);
if (widok == '1kol')
{
jQuery('#1kol').click();
}
I used
github.com/js-cookie/js-cookie
for this, so I had to include
<script src="<?php echo $this->baseurl . '/templates/' . $this->template . '/js/js.cookie.js' ?>"></script>
in my template.
The result of 1 column view is attached.
I hope that can be of help to anyone.