Post by zekin » Tue Nov 12, 2013 7:00 pm

Hi, not critical, but would be nice if it's easy to modify.

My question is How to make url clickable inside comment in order history?

Example, a url that leads to the shipment tracking page.

So all I need is if the comment has a url, it can be clicked (by default, it's just text, not clickable). Pretty much like "automatically parse URLs".

For OC 1.5.4.1

Thanks

My OC sites:
Top Choice Variety
Tiny World


New member

Posts

Joined
Wed Nov 21, 2012 8:13 pm

Post by zekin » Wed Nov 13, 2013 8:49 pm

Any idea? some hints maybe? anyone please?

Thanks.

My OC sites:
Top Choice Variety
Tiny World


New member

Posts

Joined
Wed Nov 21, 2012 8:13 pm

Post by labeshops » Wed Nov 13, 2013 9:49 pm

You would need to add html_encode to it, but not sure where. There was a thread about doing this in attributes that might help you figure it out. Do a search.

Running Opencart v3.0.3.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by zekin » Thu Nov 14, 2013 10:16 am

Hi, you might mean this thread?
http://forum.opencart.com/viewtopic.php?t=47053

It will work but if i type html code in the comment, customer will see the html code in their mail (if i choose to notify them).

But thanks for the idea, I will try to think of something.

My OC sites:
Top Choice Variety
Tiny World


New member

Posts

Joined
Wed Nov 21, 2012 8:13 pm

Post by zekin » Thu Nov 14, 2013 11:41 am

Done.

This is my approach:

Code: Select all

<modification>
<id>Make URL clickable in order comment, tested oc 1.5.4.1</id>
<version>1.0.1</version>
<vqmver>2.3.0</vqmver>
<author>zekin</author>

<file name="catalog/controller/account/order.php">
	<operation>
		<search position="replace"><![CDATA[
          			'comment'    => nl2br($result['comment'])
]]></search>
		<add><![CDATA[
          			'comment'    => nl2br(preg_replace('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[A-Z0-9+&@#\/%=~_|]/i', '<a href="\0" target="_blank">\0</a>', $result['comment']))
		]]></add>
	</operation>
</file>

</modification>

Any feedback is welcome.

My OC sites:
Top Choice Variety
Tiny World


New member

Posts

Joined
Wed Nov 21, 2012 8:13 pm
Who is online

Users browsing this forum: No registered users and 59 guests