Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Header, Cart Bill, Items in Cart
 
vicek
Jr. Member
 
Total Posts:  12
Joined:  2008-06-16
 

Hello ,
im new here. At the begining i must say i love magento from the first look ;)

I am making now new layout for magento, i did almost everything but i am stuck with one thing.

QUESTION:

What is the PHP code to write how many items in cart do i have, and how much i must pay for them ?
I want display that informations in header.phtml

I am stuck, please help me , and sorry for my pure english :)

 
Magento Community Magento Community
Magento Community
Magento Community
 
NueBe
Member
 
Total Posts:  65
Joined:  2007-09-30
Tres Cantos - Madrid - Spain
 

Hi.

Magento shows in the header, ej “My cart (x)” where x is the number of products do you have. The cost may be some like it, but there is a problem if you have a large price. Ant you have it in the side column Number of products and total amount

 
Magento Community Magento Community
Magento Community
Magento Community
 
vicek
Jr. Member
 
Total Posts:  12
Joined:  2008-06-16
 

i know magento shows My cart (x) but i dont know where is that code.
Anyone know ? I Really need to display numer of products and price for them in my header.phtml :[

 
Magento Community Magento Community
Magento Community
Magento Community
 
vicek
Jr. Member
 
Total Posts:  12
Joined:  2008-06-16
 

noone can help me with that ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
flamer
Jr. Member
 
Total Posts:  1
Joined:  2008-07-01
 

Hi,

Try adding the following code to the header.pthml or wherever you want:

<code>
<? if(Mage::getSingleton('checkout/session')->getQuote()->getItemsSummaryQty() > 0) { ?>
<?=__('My Cart')?> <span class="count">- <a href="<?=$this->getUrl('checkout/cart')?>"><?=__('%d item(s)', Mage::getSingleton('checkout/session')->getQuote()->getItemsSummaryQty())?></a></span>
<? } else { ?>
<span class="count"><font color=’white’><a href="<?=$this->getUrl('checkout/cart')?>"><font color=’white’>»<u><b>Your shopping cart </b></u></font></a> is empty</FONT></span>
<? } ?>
</code>
This would list the number of items in the shopping cart (if any) or display a “your shopping cart is empty” message if no item(s) is(are) selected.

Hope this would help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vicek
Jr. Member
 
Total Posts:  12
Joined:  2008-06-16
 

and what about price ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
marcfalk
Sr. Member
 
Total Posts:  87
Joined:  2008-11-22
 

Did you find a solution to this? How to show total price, shipping cost etc. ?

Thanks in advance!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top