Page 1 of 1

Product desryption in the Category

Posted: Tue Mar 06, 2018 11:31 pm
by eryk2kartman
Hi Guys,

By default when i go to category i can see products and first line is product name after that there is a bit pulled from decryption.
I would like to delete that part from description,
Also is there any way all products will have same size boxes?
Iv attached screenshot just to make sure you know what im talking about.
Im using OC 3.0.2.0

I would appreciate if someone can point me into right direction.
Image

Re: Product desryption in the Category

Posted: Wed Mar 07, 2018 2:00 am
by IP_CAM
Well, the vertical size of a box depends on the amount of characters
in the Title and Description Section, and also, if special Prices exist.
You could a add/enlarge the minimum height, i.E.; (min-height:300px;) Value,
to be placed in the corresponding Stylesheet Section.

Code: Select all

.product-thumb .caption {
	padding: 0 20px;
	min-height: 180px;

Code: Select all

.product-grid .product-thumb .caption {
	min-height: 210px;
	padding: 0 10px;

Code: Select all

.product-grid .product-thumb .caption {
	min-height: 0;
---
But you could also try, what Viethemes did with his solution, by adding this Javascript
into the theme/template/common/header.twig file, between the </head> and <body>,
like:
</head> Line 39 default Theme

Code: Select all

<script>
        $(document).ready(function () {
           var maxHeight = 0;

           $('.product-thumb .caption').each(function () {
              if ($(this).height() > maxHeight) {
                 maxHeight = $(this).height();
              }
           });

           $('.product-thumb .caption').height(maxHeight + 15);
        });
        </script>
<body> Line 40 default Theme
to find out, if it's working in your Version too:
---
Product Layout Fix by viethemes
https://www.opencart.com/index.php?rout ... n_id=23735
---
Untested, I don't use this Version...
Good Luck! ;)
Ernie

Re: Product desryption in the Category

Posted: Wed Mar 07, 2018 2:18 am
by Wid
so as to remove description you can do it with many ways
one of them is to go to catalog/controler/product/category.php
and add to line 362 before : $this->response->setOutput($this->load->view('product/category', $data));

Code: Select all

$data['description'] = null ;
if (isset($data['products'])) {
	foreach ($data['products'] as $key => $product) {
		$data['products'][$key]['description'] = null;
	}
}
go to file catalog/view/theme/*/template/product/category.twig
and replace <p>{{ product.description }}</p>
with
{% if product.description %} <p>{{ product.description }}</p>{% endif %}

or simple you can only delete this line
" <p>{{ product.description }}</p>
from file catalog/view/theme/*/template/product/category.twig

ofcource all this has to be done or with an event (first solution)
or with ocmod (second solution)
its very bad practice to change core files of oc

Re: Product desryption in the Category

Posted: Wed Mar 07, 2018 5:51 pm
by eryk2kartman
Thanks guys,

This is more than i expected, will give it a go later on today and report back.
Cheers

Re: Product description in the Category

Posted: Mon Mar 12, 2018 5:30 am
by eryk2kartman
Hi Lads,

So i manged to remove the description from category and all is nice, it even sort out the box size now too:)
Thank you for that>
However if i go to product itself at the bottom i have Related Products section and unfortunately the description is still there:( I guess its the same scenario as before but just different file to edit, but i haven't found the file:( any idea which one is it?
Thanks in advance

Re: Product desryption in the Category

Posted: Mon Mar 12, 2018 5:03 pm
by Wid
from file catalog/view/theme/*/template/product/product.twig
line:315
"<p>{{ product.description }}</p>"
put it on comments
<!-- <p>{{ product.description }}</p> -->

but as i mentioned before you have to do all this changes with ocmod througth modification system
read here: ocmod

Re: Product desryption in the Category

Posted: Mon Mar 12, 2018 6:31 pm
by eryk2kartman
Thank you,

Im not deleting anything i only greyed out some lines thats all.
Maybe a bit more complicated changes i will do through ocmode

Re: Product desryption in the Category

Posted: Mon Mar 12, 2018 6:45 pm
by Wid
you have to make all changes with ocmod so as you can update your oc to a new version, when you have to with no problem.

Re: Product desryption in the Category

Posted: Wed Mar 14, 2018 2:28 am
by IP_CAM
as you can update your oc to a new version
Well, this may work on certain software, but sure not on Opencart,
since Opencart NEVER releases Upgrade-Packages, but only full Version
Software, containing everything, down to the last piece of code.
But obviously, many ever-upgraders never realized this fact, that, why
so many a screwing up, again and again... :joker:
Ernie