Jump to content

Customers search doesn't work when adding order from back office


Recommended Posts

I found the error.

When a value label present a single quote (') in the transaltion, we have a JS error like this:

 

SyntaxError: missing ; before statement

 

If you open the template file:

\admin\themes\default\template\controllers\orders\form.tpl

 

you can find the declaration of:

html_orders += '<a href="{$link->getAdminLink('AdminOrders')}&id_order='+this.id_order+'&vieworder&liteDisplaying=1#" title="{l s='View this order'}" class="fancybox btn btn-default"><i class="icon-search"></i> {l s="Details"}</a>';

 

that translated in italian become:

 

html_orders += '<a href="http://localhost/prestashop/bo/index.php?controller=AdminOrders&token=c1980aec5cab38a5f49a8030411be7e8&id_order='+this.id_order+'&vieworder&liteDisplaying=1#" title="Vedi quest'ordine" class="fancybox btn btn-default"><i class="icon-search"></i> Dettagli</a>';

 

removing the single quote all works fine.

 

PS: there are another two points affected by this issue:

html_orders += ' <a href="#" "title="{l s='Duplicate this order'}" class="duplicate_order btn btn-default" rel="'+this.id_order+'"><i class="icon-arrow-right"></i> {l s="Use"}</a>';

 

and

 

$('#addresses_err').show().html('{l s='You must add at least one address to process the order.'}');

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

I found the error.

When a value label present a single quote (') in the transaltion, we have a JS error like this:

 

SyntaxError: missing ; before statement

 

If you open the template file:

\admin\themes\default\template\controllers\orders\form.tpl

 

you can find the declaration of:

html_orders += '<a href="{$link->getAdminLink('AdminOrders')}&id_order='+this.id_order+'&vieworder&liteDisplaying=1#" title="{l s='View this order'}" class="fancybox btn btn-default"><i class="icon-search"></i> {l s="Details"}</a>';

 

that translated in italian become:

 

html_orders += '<a href="http://localhost/prestashop/bo/index.php?controller=AdminOrders&token=c1980aec5cab38a5f49a8030411be7e8&id_order='+this.id_order+'&vieworder&liteDisplaying=1#" title="Vedi quest'ordine" class="fancybox btn btn-default"><i class="icon-search"></i> Dettagli</a>';

 

removing the single quote all works fine.

 

PS: there are another two points affected by this issue:

html_orders += ' <a href="#" "title="{l s='Duplicate this order'}" class="duplicate_order btn btn-default" rel="'+this.id_order+'"><i class="icon-arrow-right"></i> {l s="Use"}</a>';

 

and

 

$('#addresses_err').show().html('{l s='You must add at least one address to process the order.'}');

 

 

Hi!

 

I have the same problem, I'm not sure I've applied the suggestion well.

I also have an PS 1.7.1.2 italian installation.

 

Can you help me or send me the correct form.tpl file?

 

 

Thx

Matteo

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...
26 minutes ago, motion2082 said:

Having the same issue in PS1.6.1.24 but this modification didn't fix. No JS errors showing up. 

Any suggestions?

I'm sorry, it's been a long time and I can't remember how we solved it.

I suggest you make a big backup and try to update PS to a newer version.

Link to comment
Share on other sites

1 hour ago, motion2082 said:

Having the same issue in PS1.6.1.24 but this modification didn't fix. No JS errors showing up. 

Any suggestions?

 

I imported Italian language pack and i can see the single quote, but i can not seem to reproduce this error. Do you have a demo or development environment?

Link to comment
Share on other sites

55 minutes ago, Kert L said:

 

I imported Italian language pack and i can see the single quote, but i can not seem to reproduce this error. Do you have a demo or development environment?

Hi Kert,

I have a development site, how did you go about importing the language pack?

Link to comment
Share on other sites

  • 1 year later...

Same issue in version 1.7.7.2

These are the errors in my console, I can't search for a client either. I don't think your problem will fix mine? I copied the orders folder from my backup because it wasn't there in my folder controllers.

Schermafbeelding 2021-03-01 om 14.47.43.png

Edited by Famke (see edit history)
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...