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 (105.73 KiB) Viewed 5196 times
Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here
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>
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>
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
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'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Have you tried the solution, so far? According to the suggestion above, there shouldn't be much or any difference.HappyChukwudike wrote: ↑Mon Jun 14, 2021 6:50 pmHello Great People
Please, how can I get this done in version 3.0.3.7?
Thank you
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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!
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
Users browsing this forum: No registered users and 9 guests