Page 1 of 1
[SOLVED] Admin - Open invoice in new tab
Posted: Thu Jul 25, 2019 3:28 pm
by antstyl
Good evening on forum ..
In the opencart version 3.0.2.0 when you go Sales -> Orders, select an order and click on the top right button to print the invoice, then invoice opens in the same window.
In versions 1.5 it opened in a new tab, is there a way to change it?
I've seen in admin / view / template / sale / order_list.twig that there is this:
Code: Select all
<button type="submit" id="button-invoice" form="form-order" formaction="{{ invoice }}" formtarget="_blank" data-toggle="tooltip" title="{{ button_invoice_print }}" class="btn btn-info"><i class="fa fa-print"></i></button> </ i>
and while I see that it has formtarget = "_ blank" does not open in a new tab.
Does anyone have any idea?
Re: Admin - Open invoice in new tab
Posted: Thu Jul 25, 2019 5:41 pm
by letxobnav
same version, opens in a new tab here.
Re: Admin - Open invoice in new tab
Posted: Thu Jul 25, 2019 6:15 pm
by paulfeakins
antstyl wrote: ↑Thu Jul 25, 2019 3:28 pm
In the opencart version 3.0.2.0 when you go Sales -> Orders, select an order and click on the top right button to print the invoice, then invoice opens in the same window.
In versions 1.5 it opened in a new tab, is there a way to change it?
Have you tried middle-clicking it? Or right-click then open in new tab?
Re: Admin - Open invoice in new tab
Posted: Thu Jul 25, 2019 6:21 pm
by antstyl
On chrome, even on opencart's demo same thing is happening! Same also with edge browser.
If i enable popups in chrome settings for this site, then a popup opens but at the same time the sales page goes also to the invoice page. So I have two invoice pages!
Middle click is changing the mouse to another option to scroll, and right click gives no option to open in new tab!
Re: Admin - Open invoice in new tab
Posted: Thu Jul 25, 2019 6:42 pm
by letxobnav
oh, hold on, invoice via the list opens in the same tab, invoice via order detail opens in a new tab here.
Re: Admin - Open invoice in new tab
Posted: Thu Jul 25, 2019 6:47 pm
by antstyl
Sorry for not mentiong it. I mean invoice via orders list with all orders. Then the invoice opens in the same tab, if I am inside the order then invoice opens in new tab as it should.
But according to the code posted above that shouldn't be the case!
Re: Admin - Open invoice in new tab
Posted: Thu Jul 25, 2019 6:50 pm
by letxobnav
put target="_blank" in the form tag:
<form method="post" action="" enctype="multipart/form-data" target="_blank" id="form-order">
Re: Admin - Open invoice in new tab
Posted: Thu Jul 25, 2019 7:09 pm
by antstyl
thank you so much for your reply!!
I searched everything in the internet and I was sure that
was enough but it wans't
Solved.
Re: [SOLVED] Admin - Open invoice in new tab
Posted: Thu Jul 25, 2019 7:13 pm
by letxobnav
well, formtarget parameter is supposed to override the target parameter in the form tag, I guess it doesn't always do that.
Re: [SOLVED] Admin - Open invoice in new tab
Posted: Mon Aug 24, 2020 3:32 pm
by imdevlper18
It is due to 3 line coded in the common.js file, read here:
https://www.cartbinder.com/blog/documen ... ng-button/