Search code examples
magentopayment-method

How to display payment method to logged in user only?


display payment method to logged in user only in magneto. As in screenshot enter code here i want to display credit card(saved) to logged in user only.

screenshot


Solution

  • Use this function to check if user is logged in or not

    $userLogStatus = Mage::getSingleton('customer/session')->isLoggedIn();
    

    You can put in the condition for credit card(saved). You can do this int the template file itself. [Pseudo code]

    if(payment==cc-saved){
     if(Mage::getSingleton('customer/session')->isLoggedIn()){
       show option;
     }
    }