Jump to content

[SOLVED] Simple fix


emediastudios

Recommended Posts

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.