Jump to content

Tracking number link in order details appears with <a href> code (PS1.7.1.1)


Recommended Posts

Hi,

 

I've been playing around with Prestashop for months and I always do new installations, test things, and google issues that I face to educate myself. I've been doing it for so long that now I know how Prestashop works in almost every way except I'm not good at coding. I keep facing problems that stops me from finally finishing up my store and launching officially.

 

2 days ago I noticed a problem when I process and add a tracking number to a new order. When the customers goes to his order details (in front office) the tracking number appears like this, which doesn't seem normal and should be fixed:

post-1302518-0-32977900-1495178407_thumb.jpg

 

It should either display the tracking number itself, or the number with a link code that takes you to the carrier's website. I'm also sure that my carrier settings are configured correctly:

post-1302518-0-84636300-1495178407_thumb.jpg

 

I'm using Prestashop 1.7.1.1 with a compatible theme. I thought the issue could be related to the theme itself, so I switched to the default theme but the problem still exists.

 

I processed the order as follows (does it matter what steps to process the order?):

1- First default order status for this payment is "Awaiting bank wire payment".

2- I manually marked the order as "Payment accepted".

3- I marked the order as shipped.

4- I added the tracking number by using a scanner and scanning a barcode.

 

Not sure what is causing this? Is this a bug in PS1.7 or is it something related to my files only? I've been doing new installations forever and I'm too tired to do a fresh installation just to test this one thing. Please help.

Edited by BlackEdition (see edit history)
Link to comment
Share on other sites

I did a fresh installation of Prestashop 1.7.1.1 and 1.6.1.7 without themes or modifying anything except configuring my carrier settings (to make sure everything stays at default settings) and the problem still exists with 1.7.1.1 but it doesn't happen on 1.6.1.7:
post-1302518-0-67283700-1495350186_thumb.jpg

 

This needs to be fixed. I can't believe no one has talked about this before? in order to have a professional website, you need to have a perfect looking website, and most importantly, a functioning one.

 

Please help me! Im pretty sure fixing this is very easy for an expert.

Edited by BlackEdition (see edit history)
Link to comment
Share on other sites

I think the problem is somewhere in this file _shipping.tpl (admin/themes/default/template/controllers/orders)

			{foreach from=$order->getShipping() item=line}
			<tr>
				<td>{dateFormat date=$line.date_add full=true}</td>
				<td> </td>
				<td>{$line.carrier_name}</td>
				<td class="weight">{$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')}</td>
				<td class="price_carrier_{$line.id_carrier|intval}" class="center">
					<span>
					{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}
						{displayPrice price=$line.shipping_cost_tax_incl currency=$currency->id}
					{else}
						{displayPrice price=$line.shipping_cost_tax_excl currency=$currency->id}
					{/if}
					</span>
				</td>
				<td>
					<span class="shipping_number_show">{if $line.url && $line.tracking_number}<a class="_blank" href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>{else}{$line.tracking_number}{/if}</span>
				</td>
				<td>
					{if $line.can_edit}
						<a href="#" class="edit_shipping_link btn btn-default"
						data-id-order-carrier="{$line.id_order_carrier|intval}"
						data-id-carrier="{$line.id_carrier|intval}"
						data-tracking-number="{$line.tracking_number|htmlentities}"
						>
 							<i class="icon-pencil"></i>
 							{l s='Edit' d='Admin.Actions'}

Is the problem here or not? please help me.

Link to comment
Share on other sites

  • 4 months later...
  • 3 weeks later...
On 10/9/2017 at 3:55 PM, horiatb said:

Actually, the file is themes/classic/templates/customer/order-detail.php

The problem is I cannot understand why is the link displayed in plain text, as it doesn't seem to be anything wrong in the file or the html page source.

 

However, I did managed to solve the problem by changing two lines in this file:


themes/classic/templates/customer/order-detail.php
----------------------------------------------------
line: 178
replace all line with
<td><a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a></td>

line: 200
replace all line with
<strong>{l s='Tracking number' d='Shop.Theme.Checkout'}</strong> <a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>

 

Hi,

 

Sorry I forgot about this thread and I just noticed your reply. I did exactly what you said ant it worked perfectly! thank you very much.

Is this officially a bug in Prestashop that they don't know about? if not then what's happening?

Link to comment
Share on other sites

Thank you very much horiatb :D

 

To open the link in a new tab add "target="_blank" :

# replace all line with:
                <td>{$line.tracking}</td>
# By
                <td><a href="{$line.url|replace:'@':$line.tracking_number}"target="_blank">{$line.tracking_number}</a></td>

 

Link to comment
Share on other sites

  • 5 months later...

Hi!

Found this thread trying to solve this issue in PS 1.7.3.

You can solve this replacing the line:

                <td>{$line.tracking|unescape: "html" nofilter}</td>

in themes/YOUR_THEME/templates/customerorder-detail.tpl with

                <td>{$line.tracking nofilter}</td>

Version 1.7.3 already returns a link with "_blank" target.

 

I need to add that I had this issue as I'm applying a custom template bough before 1.7.3. Classic template delivered with 1.7.3 already has this modification.

Edited by Poldo (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 month later...
On 10/9/2017 at 8:55 AM, horiatb said:

Actually, the file is themes/classic/templates/customer/order-detail.php

The problem is I cannot understand why is the link displayed in plain text, as it doesn't seem to be anything wrong in the file or the html page source.

 

However, I did managed to solve the problem by changing two lines in this file:


themes/classic/templates/customer/order-detail.php
----------------------------------------------------
line: 178
replace all line with
<td><a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a></td>

line: 200
replace all line with
<strong>{l s='Tracking number' d='Shop.Theme.Checkout'}</strong> <a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>

 

Thank you so much! This worked for me.

Link to comment
Share on other sites

  • 1 year later...
On 4/5/2018 at 7:12 AM, Poldo said:

Hi!

Found this thread trying to solve this issue in PS 1.7.3.

You can solve this replacing the line:

                <td>{$line.tracking|unescape: "html" nofilter}</td>

in themes/YOUR_THEME/templates/customerorder-detail.tpl with

                <td>{$line.tracking nofilter}</td>

Version 1.7.3 already returns a link with "_blank" target.

 

I need to add that I had this issue as I'm applying a custom template bough before 1.7.3. Classic template delivered with 1.7.3 already has this modification.

This one works on my 1.7.6.0 ver .

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...