Post by Iamdbat » Sat Jul 02, 2016 7:11 am

Would anybody know how to display or what files and css is involved in displaying related products on the related product page tab in a list view as opposed to a grid? - Grid looks awful - list looks so much better

Active Member

Posts

Joined
Sat Jan 28, 2012 7:32 am

Post by IP_CAM » Sat Jul 02, 2016 8:43 am

in OC v.1.5.6.x Versions, in:
shop\catalog\view\theme\*\template\product\product.tpl
around Line 310 (default File), find:

Code: Select all

<?php if ($products) { ?>
<div id="tab-related" class="tab-content">
<div class="box-product">
change:
<div class="box-product">
to:
<div class="product-list">

But it looks even more ugly, because, by default, Related Items do NOT contain
valid Variables like Description, to fill the large empty holes at least a little.

In order to make this work, on about Line 318 in the product.tpl file, below:

Code: Select all

<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
Place this:

Code: Select all

<p><?php echo $product['desc']; ?></p> 
And because such 'content' has to be defined/declared first in the corresponding product.php
in the controller Section, to make 'em show up, add:
around Line 430, in the controller/product/product.php
this:

Code: Select all

'desc'       => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 64) . '..',
to make it look like this:

Code: Select all

$this->data['products'][] = array(
'desc'       => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 64) . '..',
'product_id' => $result['product_id'],
'thumb'   	 => $image,
'name'    	 => $result['name'],
'price'   	 => $price,
'special' 	 => $special,
whereby the Value 64) above represents the max. Description Characters allowed, to display on screen!

One may arrange spacing/font-type, margins, e.t.c., by adding some local style-code, to make it look swell !
Good Luck ! ;)
Ernie
Last edited by IP_CAM on Sun Jul 03, 2016 11:06 am, edited 4 times in total.

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.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Iamdbat » Sun Jul 03, 2016 7:04 am

Thanks for that - didn't expect it to be so complicated - will have a think about doing it before I attempt it - but thank you once again - I much prefer 1.5.6x - in my opinion it's far more polished out of the box than OC2

Active Member

Posts

Joined
Sat Jan 28, 2012 7:32 am

Post by Iamdbat » Sun Jul 03, 2016 7:30 am

Also it would be nice to have a list view of the refine search subcategory too - can this be done? with a subcategory image and subcategory description too ... I have a genuine reason to ask

Active Member

Posts

Joined
Sat Jan 28, 2012 7:32 am

Post by IP_CAM » Sun Jul 03, 2016 7:36 am

Iamdbat wrote:I much prefer 1.5.6x - in my opinion it's far more polished out of the box than OC2
I know, but just don't tell this anyone else around here, it's our Secret, and could be misunderstood... :D
But, whenever I find some spare time, I need to create a sub/sub-cat section first, to find out, how it looks, and if it could be done...

Ernie
---
Meanwhile:
Similar to the above, and a Goto-Product Button added as well, as VqMod:
related_products_list_view.xml
latest UPDATED Version, tested with OC v.1.5.6.4+
http://www.opencart.com/index.php?route ... n_id=27135

can be seen here momentarely:
http://www.hitline.info/

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.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 60 guests