I'm working on an "In My Basket" Feature on a shopping site. I'm pairing it on productid. I've done a tamper data on the post when you add to basket. The variable that is getting posted is productid.
I've been using This as a guide to output the productid variable. But I'm just not getting a response from the page at all.
The code I am using is {$smarty.request.productid}
The TPL file I am using is HERE I am working on the < div class="inbasket"> which is line 69.
It seems to output with the SERVER_NAME example. But I need that equivalent PHP $_POST VAR.
Does anyone have any idea on what I need to do to pull through the productid and show it on screen, Then I can do an IF statement based on that.
Also worth noting I am using Version 2.6.20 of Smarty
Hoping someone can help me out with this. It appears that smarty is just not showing the session variables at all...
Using {$smarty.request.productid} will only get values that were are in the $_POST array or the $_GET array. For session vars you would simply use "session" as in {$smarty.session.productid}. With smarty the same applies to
Put this at the top of your tpl file and it will popup with all assigned smarty vars
{debug}
Want to see what is in the session? Put this at the top of you tpl file
{php}
print_r($_SESSION);
{/php}
If you fail to debug, You've another alternative to do.
In PHP file,
$smarty->assign('request_var',$_REQUEST['var1']);
In Smarty TPL,
Use {$request_var}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With