i have only permission to my admin account to my webiste as i am paying 3rd party to maintain my website. But I want to add a java script or any client side code on my admin panel of magento that will detect weather my customer is login or not ??

I am trying to put a block of code on the Catalog-> Attribute-> Manage Attribute. In the description of the specific product category page to show a video to all the customer who are not login into website.

Anyone can help me with this will be really very helpful for me if such thing is possible to do.

Thanks in advance for help

1 Answer 1


What changes when you customer is logged in? You can e.g. just check the status of the welcome message .welcome-msg.

In default magento:

if($$('.welcome-msg')[0].innerHTML == 'Welcome ') {
    // not logged in
} else {
    // logged in

From here: Log into your magento admin and look in System > Configuration > Design > HTML Head there's a box called "Miscellaneous Scripts" that you can add the tracking code to, any script in this box appears just before the closing </head> tag.

  • I not have permission to backed code. I can only login into my admin panel to add products and such kind of activities Jul 10, 2015 at 18:25
  • updated the answer. If you have access to this, you can add JS code Jul 10, 2015 at 18:27
  • Yes , i am trying to add a Javascript that will match the "Retailer Login" text in the HTML document and if not able to find i will come to know user is login ..... Jul 10, 2015 at 18:29
  • but this thing is not working because i think through java script i can't search in the complete block document when i writing my code Catalog-> Attribute-> Manage Attribute and in description block ... If you have any idea please help .. Jul 10, 2015 at 18:32
  • Thanks a lot for your reply... what will be a tracking code ? Jul 10, 2015 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.