Post by imager » Sat Jan 05, 2013 2:32 am

Looking for some guidance on where I might need to look to make this mod.

We have many products which have "options". The options describe various attributes of an item, including lengths, color, etc.

The process of selecting the options works well, but when it comes to displaying what is in a users shopping cart, the option selections are parsed and trimmed to a maximum of 44 characters. Below is an example.
truncated_image.jpg

truncated_image.jpg (28.13 KiB) Viewed 2006 times

I am at a loss where to look, and in what file, I would find the settings/code to change this.

Can anyone give me an idea where to look or maybe if a VQD file may already be created to expand the display length.

Thanks.. John

New member

Posts

Joined
Fri Nov 09, 2012 7:05 pm

Post by imager » Thu Jan 10, 2013 3:23 am

For anyone interested to a solution, I was able to amend the code to display up to 45 characters as opposed to the original 20.

The vqmod code would be as follows:

Code: Select all

	<file name="catalog/controller/checkout/cart.php">
		<operation>
			<search position="replace"><![CDATA[($value) > 20 ? utf8_substr($value, 0, 20]]></search>
			<add><![CDATA[($value) > 45 ? utf8_substr($value, 0, 45]]></add>
		</operation>
	</file>	

New member

Posts

Joined
Fri Nov 09, 2012 7:05 pm

Post by joseywales44 » Sat Jan 19, 2013 6:07 am

OK, I have same problem with truncated options text in shopping cart.

So I just copy/paste this code into VQMOD.php then?

<file name="catalog/controller/checkout/cart.php">
<operation>
<search position="replace"><![CDATA[($value) > 20 ? utf8_substr($value, 0, 20]]></search>
<add><![CDATA[($value) > 45 ? utf8_substr($value, 0, 45]]></add>
</operation>
</file>

Newbie

Posts

Joined
Sat Jan 19, 2013 6:02 am

Post by imager » Mon Feb 25, 2013 3:38 am

Your first step is to make sure you have VQMod installed on your system - if you do not, read through the files/info posted on the OpenCart site, it is pretty easy to do.

Once you have it installed. you need to create the script file which will run every time a client visits an OpenCart page.

I take the following code:


<modification>
<file name="catalog/controller/checkout/cart.php">
<operation>
<search position="replace"><![CDATA[($value) > 20 ? utf8_substr($value, 0, 20]]></search>
<add><![CDATA[($value) > 90 ? utf8_substr($value, 0, 90]]></add>
</operation>
</file>
</modification>


And I save it to a file called clean.xml and store it in the \vqmod\xml directory.

Once you do that, simply load up the page again, and you will find the lengths of descriptions are now 90 characters (I was using 45 in the beginning, but found 90 was more pleasing on my systems).

John

New member

Posts

Joined
Fri Nov 09, 2012 7:05 pm

Post by ebeing » Thu Jul 11, 2013 4:09 am

would this work to extend the character limit on the product options with the email as well?

my emailed invoices are truncating the product option text.

New member

Posts

Joined
Wed Jan 06, 2010 2:18 pm
Who is online

Users browsing this forum: No registered users and 4 guests