Wrong URL when calling 'Export' or 'Print' functions

Talk about Printing & Exporting Settings

Moderator: alexandrleonenko

webnail
Junior
Junior
Posts: 22
Joined: Oct 2nd, '10, 09:13

Wrong URL when calling 'Export' or 'Print' functions

Postby webnail » Nov 26th, '14, 12:16

Hi,
I have successfully integrated PHPDG799 into Shopping Cart, but I am facing an issue when trying to export or print a grid. I call export and print form this URL:

http://localhost:8080/xxxxxx/index.php?admin=mod_quote_orders_description&qid=0000000037

I use

Code: Select all

   $http_get_vars = array("qid"); $dgrid->SetHttpGetVars($http_get_vars);
to maintain variables, but when hitting export the window that pops up calls the following URL:

http://localhost:8080/xxxxxx/?qde_mode=&qde_page_size=20&qde_p=1&qde_export_type=doc&qde_export=true&qid=0000000037

As you see, the base path part is missing (index.php?admin=mod_quote_orders_description) that's why download is not possible, even though the file has been exported correctly. I use the same logic with Shopping Cart native modules by using redirection of pages and Classes.
Any ideas?

Thanks in advance!
Vassilis

administrator
Site Admin
Site Admin
Posts: 6011
Joined: Jan 7th, '09, 23:18
Contact:

Re: Wrong URL when calling 'Export' or 'Print' functions

Postby administrator » Nov 26th, '14, 19:03

Find this line in DataGrid.class.php and change it to suit your needs:
$this->HTTP_URL = str_replace('///', '//', $this->http.$this->serverName.$this->port.$php_self);

webnail
Junior
Junior
Posts: 22
Joined: Oct 2nd, '10, 09:13

Re: Wrong URL when calling 'Export' or 'Print' functions

Postby webnail » Dec 5th, '14, 17:53

Hi again,
I changed the variable from

Code: Select all

$this->HTTP_URL = str_replace('///', '//', $this->http.$this->serverName.$this->port.$php_self);

to

Code: Select all

$this->HTTP_URL = str_replace('///', '//', $this->http.$this->serverName.$this->port.$php_self.'?admin=mod_quote_orders_description'.);

I echo it and seems correct, but the ExportTo Word button or Print doesn't seem to listen to it at all, nothing changed. Still:

Code: Select all

http://localhost:8080/xxxxxx/?qde_mode=&qde_page_size=20&qde_p=1&qde_export_type=doc&qde_export=true&qid=0000000037

instead of

Code: Select all

http://localhost:8080/xxxxxx/index.php?admin=mod_quote_orders_description&qde_mode=&qde_page_size=20&qde_p=1&qde_export_type=doc&qde_export=true&qid=0000000037

Is there something else maybe that I should do?

Thanks!

administrator
Site Admin
Site Admin
Posts: 6011
Joined: Jan 7th, '09, 23:18
Contact:

Re: Wrong URL when calling 'Export' or 'Print' functions

Postby administrator » Dec 8th, '14, 19:02

No, it's enough.

webnail
Junior
Junior
Posts: 22
Joined: Oct 2nd, '10, 09:13

Re: Wrong URL when calling 'Export' or 'Print' functions

Postby webnail » Dec 9th, '14, 11:00

So? What might the problem be?



Return to “Settings: Printing & Exporting”