Post by ehocdev » Mon Jan 09, 2012 5:49 am

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...

Newbie

Posts

Joined
Mon Jan 09, 2012 5:01 am

Post by Hildebrando » Sat Jan 14, 2012 12:44 am

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

Commercial Contributions:Bulk Specials| Bulk Update Prices|Search Tyre Pro
Free Contributions: Youtube video (oc 1.5.x) | Search History Report (oc 1.5.x) | Product Filter by Category (oc 1.5.x)|Youtube Popup
More Free & commercial mods: www.fpress.com


User avatar
Active Member

Posts

Joined
Fri Mar 06, 2009 8:22 pm
Location - Spain

Post by ehocdev » Sun Jan 15, 2012 6:50 pm

Works like a charm now!
Thanks

Newbie

Posts

Joined
Mon Jan 09, 2012 5:01 am

Post by OC4102012 » Thu Apr 12, 2012 5:48 am

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)
					);

Newbie

Posts

Joined
Wed Apr 11, 2012 2:36 am

Post by ifixrobot » Sun Nov 18, 2012 9:21 am

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.

Professional Robotics Repair Center
Specializing in Roomba, Scooba, and Neato Robot Parts and Repair
http://www.iFixRobot.com


Newbie

Posts

Joined
Sun Nov 18, 2012 8:45 am


Post by onlymlove » Sat Nov 09, 2013 4:28 am

I got it to work for my cart. but which file do i need to edit to make it work for my email confirmations?

Newbie

Posts

Joined
Sat Nov 09, 2013 4:26 am

Post by MarketInSG » Sat Nov 09, 2013 11:03 pm

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


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by tango@gxm.dk » Fri Jan 10, 2014 6:19 am

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

Attachments


Newbie

Posts

Joined
Mon Dec 31, 2012 9:11 pm

Post by postidol » Tue Dec 15, 2015 1:21 am

Hey tango@gxm.dk would your xml file work on 1.5.6 ?

New member

Posts

Joined
Thu May 30, 2013 1:51 am

Post by sklim1 » 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?

Newbie

Posts

Joined
Sat Apr 19, 2014 4:50 am

Post by RideTheWave » Sat May 27, 2017 3:06 pm

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?

New member

Posts

Joined
Fri May 19, 2017 8:29 am
Who is online

Users browsing this forum: No registered users and 6 guests