emediastudios Posted March 4, 2009 Share Posted March 4, 2009 I need this code to go into the following code so that if they are signed in it will show the price if not it will display login register. <?php ProductSalePrice(); ?> this into this <?php if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) {echo"<A HREF=\""; PageURL('CustomerSignIn'); echo "\">My Home</A> | "; echo"<A HREF=\""; CustomerSignOutURL(); echo "\">Sign Out</A>";} else{echo"<A HREF=\""; PageURL('CustomerSignIn'); echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn'); echo"\">Register</A>"; }?> Thanks for any help Link to comment https://forums.phpfreaks.com/topic/147904-solved-simple-fix/ Share on other sites More sharing options...
Stephen68 Posted March 4, 2009 Share Posted March 4, 2009 if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) { echo"Price =\"";ProductSalePrice(); echo"\" <A HREF=\""; PageURL('CustomerSignIn'); echo "\">My Home</A> | "; echo"<A HREF=\""; CustomerSignOutURL(); echo "\">Sign Out</A>"; } else{echo"<A HREF=\""; PageURL('CustomerSignIn'); echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn'); echo"\">Register</A>"; }?> Link to comment https://forums.phpfreaks.com/topic/147904-solved-simple-fix/#findComment-776263 Share on other sites More sharing options...
emediastudios Posted March 4, 2009 Author Share Posted March 4, 2009 Thanks Stephen, but no joy, just shows all that code on the screen, something not right Link to comment https://forums.phpfreaks.com/topic/147904-solved-simple-fix/#findComment-776266 Share on other sites More sharing options...
emediastudios Posted March 4, 2009 Author Share Posted March 4, 2009 Something like this im guessing but it doesnt show the price, shows what i want to see when not logged in but not the price when they are. shows nothing. know im close. <?php if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) {echo"<?php ProductSalePrice(); ?>";} else{echo"<A HREF=\""; PageURL('CustomerSignIn'); echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn'); echo"\">Register</A>"; }?> Link to comment https://forums.phpfreaks.com/topic/147904-solved-simple-fix/#findComment-776270 Share on other sites More sharing options...
emediastudios Posted March 4, 2009 Author Share Posted March 4, 2009 Anyone please, this is the last fix i need to finish this nightmare site. Link to comment https://forums.phpfreaks.com/topic/147904-solved-simple-fix/#findComment-776309 Share on other sites More sharing options...
Stephen68 Posted March 4, 2009 Share Posted March 4, 2009 Does the function return the price or echo it? maybe ... (modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) { $price = ProductSalePrice(); echo $price; } else{echo"<A HREF=\""; PageURL('CustomerSignIn'); echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn'); echo"\">Register</A>"; }?> how about this? <?php if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) { $price = ProductSalePrice(); $URL = CustomerSignOutURL(); $page = PageURL('CustomerSignIn'); echo"Price is ".$price; echo "\" <A HREF=\"".$page."\">My Home</a> |"; echo "\"<a href=\"".$URL."\">Sign Oout</a>"; } ?> I pretty new to this so I hope I'm not over stepping any, just trying to help. I was wondering are you using ; to join your echo's . Just wondering because I use the period (.) to do that. Might be a newbi question but I'm really would like to know Link to comment https://forums.phpfreaks.com/topic/147904-solved-simple-fix/#findComment-776314 Share on other sites More sharing options...
emediastudios Posted March 4, 2009 Author Share Posted March 4, 2009 The code before edit looks like this <div class="ProductPrice" style="padding-bottom: 3px; padding-top: 3px;"> Price: <?php ProductSalePrice(); ?> </div> I was given this code and i need to somehow put the above code into it so it only shows price when they are logged in, it works by itself but doesn't when i start messing with it <?php if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) {echo"<A HREF=\""; PageURL('CustomerSignIn'); echo "\">My Home</A> | "; echo"<A HREF=\""; CustomerSignOutURL(); echo "\">Sign Out</A>";} else{echo"<A HREF=\""; PageURL('CustomerSignIn'); echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn'); echo"\">Register</A>"; }?> Link to comment https://forums.phpfreaks.com/topic/147904-solved-simple-fix/#findComment-776322 Share on other sites More sharing options...
Stephen68 Posted March 4, 2009 Share Posted March 4, 2009 I would guess you had it right in one other post.. <?php if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) {echo"<?php ProductSalePrice(); ?>";} else{echo"<A HREF=\""; PageURL('CustomerSignIn'); echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn'); echo"\">Register</A>"; }?> The only change I would make is leave out the echo part. If the the code at the top of your last posts works I would say the the function echo's out the price so no need for the echo in the code. <?php if(modApiFunc('Customer_Account','getCurrentSignedCustomer') !== null) { ProductSalePrice(); }else{ echo"<A HREF=\""; PageURL('CustomerSignIn'); echo"\">Sign In</A> | <A HREF=\""; PageURL('CustomerSignIn'); echo"\">Register</A>"; } ?> Link to comment https://forums.phpfreaks.com/topic/147904-solved-simple-fix/#findComment-776328 Share on other sites More sharing options...
emediastudios Posted March 5, 2009 Author Share Posted March 5, 2009 Champion, solved, thanks so much. Link to comment https://forums.phpfreaks.com/topic/147904-solved-simple-fix/#findComment-776885 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.