Creating A Module Block For Magento's Welcome Message - magento

I found this very nice tutorial here: http://www.phparrow.com/magento/magento-create-a-simple-module/ on creating a simple Magento Module. I was hoping I could figure out how to put Magento's default welcome message into a module. See, it appears Magento's default welcome message is part of the header because when you look at the layout with template paths turned on the welcome message doesn't have a template of it's own.
The reason I want to add the welcome message to a module is because my page cache caches the header and along with it the welcome message. The welcome message has "Welcome..." then "Welcome...(Customer Name)" then "Welcome...(not Customer Name?)" etc.
The page cache will cache what ever it happens to cache! I mean it might cache a customers name on one page and some other state on another page.
The code in the header.phtml is:
<p class="welcome-msg"><?php echo $this->getWelcome() ?> <?php echo $this->getAdditionalHtml() ?></p>
I need to somehow add this to a "module block" so I can tell my page cache not to cache this block. Understand?
The tutorial above explains how to create a module very well but it creates a "new page" and I need to some make a module for this welcome message.
Thank you

Related

Magento OnePage Success Blank Content

I've got Onepage and Goodcheckout enabled
I've copied the success.phtml to my active theme folder but it's showing blank success page content. I can see the header but the rest of the page is blank
I activated debug but no errors showing, why would the succcess.phtml not show correctly while using this extension?
You can test by going here -https://www.premiumpetfoodonline.com.au/catalogsearch/result/?cat=0&q=test1-2kg
Checkout and you'll see the success page
This piece of code at the top of the success.phtml had been altered, I removed the title call and block request as it isn't needed as header is already set
<?php echo $this->getMessagesBlock()->toHtml() ?>
<h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>

Magento 1.91 CE - Customers Cant login

Hi all our website is Caged.eu and we have customised a Template from pre 1.9. Magento allows customer to register but when they try to sign in using that login details login page doesnt respond, this also happens when they ask to resend password it send reset details but still doesnt work.
Oddly the click facebook link to sign up login does work which is another extension we are ready to release but after getting it this well done would hate to have to change template.
Im sure its something stupid but would really appreciate your help guys
In Magento 1.9 the forms are unable to store the data as formkey missing. Try to add the key then you can be able to sign in. Add <?php echo $this->getBlockHtml('formkey'); ?> this at line no 41 below <form> tag in app/design/frontend/[your theme package]/[your theme]/template/persistent/customer/form/login.phtml
And check whether you can update product quantity in cart, there also formkey is missing.
Copy base/default/template/customer and base/default/template/persistent to your theme/template
After you had added the line <?php echo $this->getBlockHtml('formkey'); ?>
Perhaps you need to to flush magneto cache from magento admin (System->Cache management), then you can try the frontend customer login again.
As already replied in magento.stackexchange you should edit
/app/design/frontend/default/template-name/template/persistent/customer/form/login.phtml
and inside the "login form" form, after the
<ul class="form-list">
you should insert
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
and this will solve your problem, as it did with mine.
Hope this helps
so be it - manemoi
Theodore

How to create link to go to shopping cart

I have the following href on a page /example/index.php that I want to take me to my magento shopping cart:
href="/example/catalog/index.php/checkout/cart/"
However, it always redirects to /example/catalog/
When I am on /example/catalog/ and I trigger the same href it goes to the correct page but not from my main page.
Can someone please explain how to fix this?
Is your Magento installation inside /example/catalog/?
If yes, then you can
href="<?php echo $this->getUrl('checkout/cart') ?>"

Private Joomla 2.5 K2 items redirects back to homepage instead of origin link after login

I am gonna try my best to describe our problem. Hopefully someone way smarter than us can figure this out. One of our Joomla sites has some content that requires login, simple enough right? The normal login functionality works great. Once logged in we could see the locked down content. But lets say we have a direct link to a "locked" page, once logged in, the page redirects to the homepage (index.php).
Natively Joomla 2.5 should retain the origin link, and redirects to that link, not back to index.php. So if my link was homepage.com/k2item1, after login it should go to k2item1 not index.php. I have tried turning off all modules and plugins just in case something is overriding the native login functionality from links. I have checked the .htaccess file for redirects. I have tried both settings in SEO settings "Use URL rewriting", Yes/NO doesn't matter. I have tried renaming the override folder (html) in our template folder, so no overrides should happen. Nothing. The link still redirects back to index.php. I have even tried printing out the form/user object to see if the origin link was there, aka "return", and the link is in there, but after login, still index.php instead of the string "return". Any ideas will be greatly appreciated. Maybe there are plugins out there that would help ensure links do not redirect to home page?
Override the component: mod_k2_user/login.php and edit the hidden input name "return".
<input type="hidden" name="return" value="<?php echo base64_encode(JURI::current()) ?>" />

Invalid Email message is not showing in login page in magento

I'm currently working on making a login form in home page.
but after each invalid attempt the messages are not showing in proper place
i.e
The "invalid email and password " message showing in account dashboard and forgotpassword page.
This means that you have forgot to call group messages block in your template
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
I added the following line in my template and it works:
<?php $message1=Mage::app()->getLayout()->getMessagesBlock()
->setMessages(Mage::getSingleton('customer/session')
->getMessages(true))->getGroupedHtml() ; ?>
thanks for the help.
This means that you have forgot to call messages block in your template. add this code , its work for me
<?php echo $this->getMessagesBlock()->toHtml() ?>

Resources