Page 1 of 1

1.5.1.3 - Options text too short in confirmation

Posted: Mon Jan 09, 2012 5:49 am
by ehocdev
Hi All,
I want to use the ability to select Checkbox Options for products. My problem is that the options text (under product name) is cut short in the shopping cart, order confirmation and confirmation mail. Just part of the text is visible. Can I make the text field longer and if so, how do I do that. Can you display the text in more than one line if on line (at max length) is too short?
Looking forward to your reply...

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Sat Jan 14, 2012 12:44 am
by Hildebrando
You can work with wordrap() PHP function

For example at catalog/controller/checkout/cart.php

At line 408 replace

Code: Select all

'value' => (strlen($option['option_value']) > 20 ? substr($option['option_value'], 0, 20) . '..' : $option['option_value'])
with

Code: Select all

'value' => (wordwrap($option['option_value'],30, "<br />"))
Best,

Hilde

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Sun Jan 15, 2012 6:50 pm
by ehocdev
Works like a charm now!
Thanks

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Thu Apr 12, 2012 5:48 am
by OC4102012
I seem to be having the same problem but I'm using Opencart Version 1.5.2.1

The example code above doesn't appear for me, but I think I found the similar code below and I'm wondering if I can just change the 20 to a higher number as long as I don't go too high since it appears that only 20 characters are being shown (if I'm counting correctly lol)

or if I can't increase that number what are my options to prevent the Option text from getting cut off in the cart and in order confirmation emails?

Here's the code I'm looking to edit:

Code: Select all

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

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Sun Nov 18, 2012 9:21 am
by ifixrobot
For Version 1.5.4.x follow the directions above but the line to edit is now 215. Works in the Shoppica2 theme as well.

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Sat Nov 09, 2013 4:28 am
by onlymlove
I got it to work for my cart. but which file do i need to edit to make it work for my email confirmations?

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Sat Nov 09, 2013 11:03 pm
by MarketInSG
onlymlove wrote:I got it to work for my cart. but which file do i need to edit to make it work for my email confirmations?
catalog/model/checkout/checkout.php

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Fri Jan 10, 2014 6:19 am
by tango@gxm.dk
Hi.
This vQMod should do the trick for 1.5.4.1
Shows entire option value in:
Cart
Checkout
View order
Order confirm e-mail

Regards
Thomas

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Tue Dec 15, 2015 1:21 am
by postidol
Hey tango@gxm.dk would your xml file work on 1.5.6 ?

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Fri Feb 24, 2017 9:53 am
by sklim1
What about for 2.3.0.2? I don't see the checkout.php in the same path as mentioned earlier. Which file/line would I need to replace for the email confirmation?

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Sat May 27, 2017 3:06 pm
by RideTheWave
I just wanted to add to the thread that if you don't want the text to get cut off in the PayPal page after someone checks out using PayPal Standard, then in catalog/controller/extension/payment/pp_standard.php you can edit the same line

Code: Select all

'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value)
and in my case I just replaced the line with

Code: Select all

'value' => $value
and it works. However, does anyone know if PayPal has a limit to how many characters get passed in an option value field? I recall reading somewhere that if you have too many characters in a field, then the transaction won't go through. Anyone know anything about this?

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Thu Jun 20, 2019 8:41 pm
by Alina007
sklim1 wrote:
Fri Feb 24, 2017 9:53 am
What about for 2.3.0.2? I don't see the checkout.php in the same path as mentioned earlier. Which file/line would I need to replace for the email confirmation?
I'm interested for this answear too :) can anyone help?

Re: 1.5.1.3 - Options text too short in confirmation

Posted: Fri Jun 21, 2019 8:53 pm
by xxvirusxx
Should work