We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Help with fetch_parameters for Google Checkout Module

Development and Programming

dvdconsulting's avatar
dvdconsulting
55 posts
16 years ago
dvdconsulting's avatar dvdconsulting

I can’t for the life of me figure why this is doing this: I have a plug-in that I am working on for Google Checkout. In the plugin, one of the parameters is the member_id of the currently logged in user.

If I return the data within a plugin function, it gives me the id of the member, however, if I try to post that somewhere else, the value that I get is “{member_id}”

To explain further:

This works:

$memberid = $TMPL->fetch_param('member_id');
return $memberid;

This does not:

$memberid = $TMPL->fetch_param('member_id');
setcookie("member", $memberid);

It IS setting a cookie, but the value is the variable name {member_id} instead of the value of the field.

What am I missing?

Thanks! V

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

Are you trying to set memberid to the ID of the currently logged in member by any chance?

If so you might be better off doing this sort of thing instead :

<?php
global $SESS, $FNS;

$memberid = $SESS->userdata['member_id'];
setcookie("member", $memberid);

?>

Hope that helps a bit.

Best wishes,

Mark

       
dvdconsulting's avatar
dvdconsulting
55 posts
16 years ago
dvdconsulting's avatar dvdconsulting

Brilliant. Worked like a charm. (I don’t actually need to set the cookie, but I was using that to test the member_id functionality.)

Question, though… if I wanted to pass a fetch_param to an external PHP file, can I do it? It doesn’t appear that I can. It looks like it just passes the variable name and not the value.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.