Delete product but stay on (sub)page

boboo

Avatar: boboo

2012-09-14 09:05

If there are more products in system, so the paging in admin panel is active and you want to delete a product from -let's say- third (sub)page, the script goes to the first (sub)page after deleting chosen product. The same situation we have by changing and saving product data from list view.

The solution for "changing and saving":
in /templates/admin/products.tpl in block BEGIN PRODUCTS, in "action" property of the form add: &iPage=$iPage

The solution for "deleting":
in /templates/admin/products.tpl in block START LIST in "href for delete action" add &iPage=$iPage
Then add
&iPage=$aData[iPage]
before!!! "&iProduct=" in var aDelUrl = Array...

Now in /actions/admin-products.php
change:

header('Location:'.$_SERVER['PHP_SELF'].'?p='.$aActions['f'].'-list&sOption=del');


to:

header('Location:'.$_SERVER['PHP_SELF'].'?p='.$aActions['f'].'-list&sOption=del&iPage=' .$iPage);


and in /core/products-admin.php in function listProductsAdmin under:

$aData['sPrice']=displayPrice($aData['mPrice']);


add:

$aData['iPage']=isset($_GET['iPage'])?$_GET['iPage']:1;

» Quick.Cart v5.x

qc-plugins.kimla.de

Back to top
about us | contact