Jump to content
  • 0

odbieranie danych z adresu strony w header.tpl


1q2w3e4r

Question

Witam

Chcę w header.tpl odbierać z adresu strony id kategorii oraz id produktu. Zrobiłem to tak, że dodałem do header.php taki kod:
 
if ($_GET['id_category'])
    $category = intval($_GET['id_category']);
else if ($_GET['id_product'])
{
    $product = new Product(intval($_GET['id_product']));   
    $category = $product->id_category_default;
}
$smarty->assign('category', $category);


$controller = new FrontController();
$controller->displayHeader();
Jednak w header.tpl nie odbiera zmiennej {$category}. W czym jest problem?
 
 
PS. Moja wersja presty to 1.4.1
Edited by 1q2w3e4r (see edit history)
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...