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
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
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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.