Post by GetinBuy1 » Mon Oct 09, 2017 5:30 pm

Hello All,
I need a help. I'm using opencart 2.3.0.2 version. When the product title has more characters then it is increasing the height of the product box in the category page and also in the featured page. Please look at the image attached.
Any help is appreciated!

Thanks in advance 😊

Attachments

Screenshot_2017-10-09-14-45-58-1.png

Screenshot_2017-10-09-14-45-58-1.png (105.73 KiB) Viewed 4702 times


Newbie

Posts

Joined
Sat Sep 23, 2017 10:00 am

Post by GetinBuy1 » Mon Oct 09, 2017 7:44 pm

Thank you so much it is helpful. I'm new to php so, can you please help me as where to place this ?
Do I have to place it in stylesheet.css file ?

Newbie

Posts

Joined
Sat Sep 23, 2017 10:00 am

Post by kestas » Tue Oct 10, 2017 2:31 am

yes you can place it to stylesheet.css... mostly browsers has inspection function. so you can simply click F12 and play with your page...

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by IP_CAM » Tue Oct 10, 2017 2:46 am

Well, according to the Code used, this Extension should work in OC v.2.3.x as well:
Good Luck! ;)
Ernie
---
Limit number of characters in product name on category page free, OC v.2.x
https://www.opencart.com/index.php?rout ... n_id=24964
---
You have to change the Value: 70 according to your needs!
limit_titles.vqmod.xml (VqMod Version)

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id><![CDATA[Limit characters in the title - category page]]></id>
<version><![CDATA[1.0]]></version>
<vqmver><![CDATA[2.5.1]]></vqmver>
<author><![CDATA[Angela Boartes - Soft Build]]></author>
<file name="catalog/controller/product/category.php">
<operation error="log">
<search position="replace"><![CDATA['name'        => $result['name'],]]></search>
<add trim="true"><![CDATA[
	'name'        => utf8_substr($result['name'],0,70),
]]></add>
</operation>
</file>
</modification>
and if you use OcMod, try this Code, and then rename the FILE-Name to
limit_titles.ocmod.xml (OcMod Version)
and install it by use of the OcMod-Installer:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
<name><![CDATA[Category Product Name Length]]></name>
<code><![CDATA[product_name_length]]></code>
<version><![CDATA[OC v.2.x]]></version>
<author><![CDATA[Angela Boartes - Soft Build]]></author>
<file path="catalog/controller/product/category.php">
<operation>
<search><![CDATA['name'        => $result['name'],]]></search>
<add position="replace" trim="true"><![CDATA[
	'name'        => utf8_substr($result['name'],0,70),
]]></add>
</operation>
</file>
</modification>
Last edited by IP_CAM on Wed Oct 11, 2017 1:18 am, edited 1 time in total.

My Github OC Site: https://github.com/IP-CAM
5'300 + 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 GetinBuy1 » Tue Oct 10, 2017 8:52 pm

Can you please mention the path here! I have basic working knowledge in php :(
Thanks☺

Newbie

Posts

Joined
Sat Sep 23, 2017 10:00 am

Post by IP_CAM » Wed Oct 11, 2017 1:25 am

Well, if you really plan to play around with OC, you'll need to find out,
how Opencart works. You'll find some links on this here:
viewtopic.php?f=20&t=173059&p=655919
Good Luck !
Ernie

My Github OC Site: https://github.com/IP-CAM
5'300 + 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 nudylady » Thu Jan 02, 2020 8:49 pm

how to do this for related products for 3.0.3.2?

New member

Posts

Joined
Sun Feb 19, 2012 12:14 am

Post by IP_CAM » Thu Jan 02, 2020 11:32 pm

try this, just change the value (30) to the max. size allowed:
Image

My Github OC Site: https://github.com/IP-CAM
5'300 + 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 nudylady » Sun Jan 05, 2020 3:21 am

yes, the above worked for related products, thank you

New member

Posts

Joined
Sun Feb 19, 2012 12:14 am

Post by HappyChukwudike » Mon Jun 14, 2021 6:50 pm

Hello Great People

Please, how can I get this done in version 3.0.3.7?

Thank you


Posts

Joined
Wed May 19, 2021 4:49 am

Post by straightlight » Mon Jun 14, 2021 7:19 pm

HappyChukwudike wrote:
Mon Jun 14, 2021 6:50 pm
Hello Great People

Please, how can I get this done in version 3.0.3.7?

Thank you
Have you tried the solution, so far? According to the suggestion above, there shouldn't be much or any difference.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Peter S. » Sun May 26, 2024 12:03 am

Hi,

maybe i'm pulling an old thread back from the dead, but just wanted to let ya'll know I've checked on OC version 3.0.3.9 and IP_CAM's solution works.
As i couldn't install via OC mod I modified the file itself.
What is did is;

1. go to your source file ...catalog/controller/product/category.php
2. open the file in an editor
3. find the line: 'name' => $result['name'], (line 202 in my file)
4. replace the line with: 'name' => utf8_substr($result['name'],0,20),
5. save the file and you are done!

Thanks again for sharing IP_CAM!

Newbie

Posts

Joined
Tue Dec 13, 2016 10:52 pm

Post by paulfeakins » Tue May 28, 2024 10:28 pm

GetinBuy1 wrote:
Tue Oct 10, 2017 8:52 pm
I have basic working knowledge in php :(
Sorry but if you can't find the path to the stylesheet you do not have basic working knowledge.

I suggest you try the free extension posted above.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 36 guests