Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have "My Cart" link outside of Top Links?

Tags:

magento

I've only been working on Magento for a few days but already it is so confusing. I'm starting to get my head around it but one problem is doing my head in at the moment.

My client wants a shopping basket sort of function NEXT to the top links rather than a "My Cart" in the top links. Simply, all I want to do is move "My Cart" out of the top links and place it in the top right corner next to a hopping bag, but have no idea how to get this link in that position.

For a visual example, the clients shopping basket is going to look similar to the one one Next's website.

alt text

Thank you for any help you offer.

like image 724
Liam Spencer Avatar asked Nov 05 '10 11:11

Liam Spencer


People also ask

What is a cart link?

A Cart link, when embedded on your website, allows clients to quickly access their digital shopping cart. As clients browse your website and add the pricing options they wish to buy, each one is stored in the Cart. Clients will select the Cart link when they need to view their totals or check out.


1 Answers

To call the cart URL from anywhere, you may utilize the Cart helper:

<?php echo Mage::helper('checkout/cart')->getCartUrl(); ?>

(The helper itself is located under app/code/core/Mage/Checkout/Helper/Cart.php - it has other useful functions, e.g. the items count in the current cart*)

You can utilize this to include a link in the top links, located in app/design/frontend/base/default/template/page/html/top.links.phtml.

I am referring to the base package here, in your own template the path is (most likely) app/design/frontend/[Your Package]/[Your template name]/template/page/html/top.links.phtml

"[Your Package]" is "default" if you don't use an own package.

*which would be

<?php echo Mage::helper('checkout/cart')->getItemsCount(); ?>
like image 101
Florian Avatar answered Oct 21 '22 22:10

Florian