Quote:
Originally Posted by Yurij
I'm not sure, but try used next code (i don't tested this code enough):
PHP Code:
x_session_register("back_url"); x_session_register("skip_one_redirect"); if ($mode == "add") { $id = intval($productid); if ($id>0) { $cat_path = func_query_first_cell("select categoryid_path from $sql_tbl[products_categories], $sql_tbl[categories] where (productid = $id)and(main='Y')and($sql_tbl[products_categories].categoryid=$sql_tbl[categories].categoryid)"); if (!empty($cat_path)) { $cats_path = split("/ *",$cat_path); if (!empty($cats_path[0])) { $back_url = "home.php?cat=".$cats_path[0]; $skip_one_redirect = 1; } } } } else { if ($skip_one_redirect==1 ) { $skip_one_redirect=0; } else { if (strpos($_SERVER['HTTP_REFERER'], "cart.php") === false) { $back_url = $_SERVER['HTTP_REFERER']; } } } $smarty->assign("back_url", $back_url);
|
Hi Yurij, is it any chance you could help me to display just previous main catid?
Many thanks,
Tanya