Back to correct page in list of categories or product

Michal Siman :: ITServis.

No avatar

2007-05-12 09:13

After edit some categories or products, i wanna go back to the same page in list as beferore edit. I think it is easy for doing and it will be BIG help for everybody.

» Quick.Cart v2.x

Michal Siman :: ITServis.

No avatar

2007-05-12 09:14

... i spoke about admin section ...

treewood (OpenSolution)

Avatar: treewood

2007-05-12 10:15

Michal Siman :: ITServis.
1. edit core/products-admin.php and find saveProduct() function. Before

// end function saveProduct

paste

return $aForm['iProduct'];


2. edit actions_admin/products.php and change this

    saveProduct$_POST );
    
header'Location: '.$_SERVER['PHP_SELF'].'?p='.$aActions['g'].'List&sOption=save' );

to

    $iProduct saveProduct$_POST );
    
header'Location: '.$_SERVER['PHP_SELF'].'?p='.$aActions['g'].'Form&iProduct='.$iProduct.'&sOption=save' );


Do similar things in actions_admin/categories.php but customized to categories (variables/actions etc.)

vaikis

No avatar

2007-05-12 14:07

yes this will help for me too. but after editing product the page is not returning back to previous page.

treewood (OpenSolution)

Avatar: treewood

2007-05-14 10:55

Michal Siman :: ITServis., vaikis - ah ... i understand not correctly what You want :/ i thought that You want to go back to edit page not to list. If You want go back to list then it will be harder.
1. edit templates/products_form.tpl and add hidden field name sPageToReturn for example:

<input type="hidden" name="sPageToReturn" value="$_SERVER[HTTP_REFERER]" />


2. edit actions_admin/products.php and change this:

header'Location: '.$_SERVER['PHP_SELF'].'?p='.$aActions['g'].'List&sOption=save' );

to this:

header'Location: '.$_POST['sPageToReturn'] );


works?

vaikis

No avatar

2007-05-14 11:19

yes it works perfect .

Back to top
about us | contact