Post by OC4102012 » Thu Apr 12, 2012 9:50 am

Hi,

Opencart Version 1.5.2.1
Fresh Install

My problem was that the Option Text was being cut off in checkout as well as in the email sent to the customers.

I searched and initially found a similar problem this thread: http://forum.opencart.com/viewtopic.php?f=114&t=50209

I took what I found there and decided to edit the 20 in the code in several php files.

It appears to work but my questions are...

Will my edit be ok or will it cause any problems that you can think of or did I do it the wrong way and I should do what was in the above thread?

Is there a maximum that number should never go above?

Did I miss any files that should have the same edit?

THANKS!

These are the edits I made:

in... catalog > controler > checkout > cart.php


found:

Code: Select all

'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value)
and changed to:

Code: Select all

'value' => (utf8_strlen($value) > 100 ? utf8_substr($value, 0, 100) . '..' : $value)



in... catalog > controler > checkout > confirm.php

found:

Code: Select all

'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value)

and changed to:

Code: Select all

'value' => (utf8_strlen($value) > 100 ? utf8_substr($value, 0, 100) . '..' : $value)



in... catalog > model > checkout > order.php


found:

Code: Select all

'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value)
and changed to:

Code: Select all

'value' => (utf8_strlen($value) > 100 ? utf8_substr($value, 0, 100) . '..' : $value)

found:

Code: Select all

$text .= chr(9) . '-' . $option['name'] . ' ' . (utf8_strlen($option['value']) > 20 ? utf8_substr($option['value'], 0, 20) . '..' : $option['value']) . "\n";

and changed to:

Code: Select all

$text .= chr(9) . '-' . $option['name'] . ' ' . (utf8_strlen($option['value']) > 100 ? utf8_substr($option['value'], 0, 100) . '..' : $option['value']) . "\n";

Newbie

Posts

Joined
Wed Apr 11, 2012 2:36 am

Post by Tcalp » Thu Apr 12, 2012 10:37 am

Your code won't cause any problems that I'm aware of.

Increase Page Speed (#1 rated commercial extension on OpenCart Marketplace)
15in1 Essential Extensions Value Pack Premium Customer Testimonials Reward Points Extended Admin Security Lockdown Suite

Image
irc.freenode.net #opencart


User avatar
Active Member

Posts

Joined
Wed Jul 06, 2011 1:49 pm

Post by OC4102012 » Thu Apr 12, 2012 11:08 am

ok thanks!

Newbie

Posts

Joined
Wed Apr 11, 2012 2:36 am

Post by OC4102012 » Fri Apr 13, 2012 3:15 am

I realized there was one more line in ... catalog > model > checkout > order.php

in addition to the above that I found and changed...

found:

Code: Select all

$text .= chr(9) . '-' . $option['name'] . ' ' . (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value) . "\n";

and changed to:

Code: Select all

$text .= chr(9) . '-' . $option['name'] . ' ' . (utf8_strlen($value) > 100 ? utf8_substr($value, 0, 100) . '..' : $value) . "\n";
It appears that it's all working fine and I haven't noticed any problems (that I can tell right now).

I have kept a log of stuff I've changed too, so if you're editing these files you might want to do the same.

Newbie

Posts

Joined
Wed Apr 11, 2012 2:36 am

Post by normdouglas » Wed May 06, 2015 8:16 am

Just thought I'd share something with you all (and incase I'm searching for this again one day)... that I've turned this into an XML modification file.
All care taken no responsibility.

Hope this helps someone.

Attachments


New member

Posts

Joined
Sat Apr 06, 2013 5:22 am
Location - Australia
Who is online

Users browsing this forum: No registered users and 315 guests