ユーザーがログインするときに、登録リンクを非表示にします。誰かがこれについて私を導くことができますか?初めてです。
頭に浮かぶのはMage::getSingleton('customer/session')->getCustomer();
、ですが、機能していません。
ユーザーがログインするときに、登録リンクを非表示にします。誰かがこれについて私を導くことができますか?初めてです。
頭に浮かぶのはMage::getSingleton('customer/session')->getCustomer();
、ですが、機能していません。
タグを使用してこれを解決するには、レイアウト ファイルを使用する必要があり<customer_logged_in>
ます。
customer.xml を見ると、通常は次のようになります。
<customer_logged_in>
<reference name="topLinks">
<action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
</reference>
</customer_logged_in>
と同等です<customer_logged_out>
。これにより、必要な場所に移動できます。
あなたが本当にphtml
ファイルでそれをしたいのなら、見てください
$this->helper('customer')->isLoggedIn();