How to create link to go to shopping cart - magento

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') ?>"

Related

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 show recent view products on home page in magento

I want to how recently viewed products on home page in magento.
Currently I am using below code but this is now working. so please help!!
getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>
Did you forget to echo?
<?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>
By the way if you're doing it from the CMS you need to use:
{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}}

Adding magento menu to custom page

I have a magento custom page which is the homepage for our site - the guy before me however for some reason did not add the main menu to this page. How would I go about doing this?
The way i work with menus in Magento is:
First, i create a custom block, from the cms menu, in that block i add the li:
<li>Home</li>
Then in your template, edit the following file: app/desing/frontend/yourtheme/default/page/html/topmenu.phtml
you will see: <?php echo $_menu ?> before it add:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('yourblockname')->toHtml() ?>
And then you will be able to manage the menu option from your admin panel in your custom block.
I hope this help.

call magento dashboard using php anchor

How do I call the magento dashobard using an anchor? I need to call the magento dashboard when I put it in an anchor?
<a href="<?php //what do I add here? ?>">
Below is the code which is working in my one of custom extension in magento custom grid.
you can use like below.
<a href="<?php echo Mage::helper('adminhtml')->getUrl("adminhtml/dashboard/index");?>" target="_blank">
test
</a>
hope this will sure work for you. let me know if i can help you further.

Frontend Customer Registration and newsletter subcription not working in magento 1.6.2

I can't figure out what the real problem is..
When I click the link login in the header it takes me to the customer login page..
But on that page none of the buttons works after submitting the data..
Login button on customer login page does not work
Submit Button on create account page does not work..
Newsletter subcription button does not work...
Lad, have the same problem with newsletter.
Just installed the new version of Magento, 1.6.2.0 and didn't see the input.
Insert this:
<reference name="footer">
<block type="newsletter/subscribe" name="footer_newsletter" as="footer_newsletter" before="cms_footer_address" template="newsletter/subscribe.phtml"/>
</reference>
into /app/design/frontend/YOUR-PACKAGE/YOUR-THEME/layout/newsletter.xml into block.
Then go to /app/design/frontend/YOUR-PACKAGE/YOUR-THEME/template/page/html/footer.phtml, find there this:
<?php echo $this->getChildHtml() ?>
replace with this:
<?php echo $this->getChildHtml('footer_newsletter') ?>
It worked to me. I havent review login page, but I hope my advice with the newsletter will be useful. Good luck!

Resources