evobiliscartmenu - Version 1.0.1

Version Notes

Display a list of products added to the cart in a drop down menu

Download this release

Release Info

Developer Mahesh Komarraju
Extension evobiliscartmenu
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/design/frontend/base/default/layout/cartmenu.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <layout version="0.1.0">
4
+
5
+
6
+ <default>
7
+
8
+ <reference name="top.links">
9
+ <remove name="checkout_cart_link"/>
10
+ </reference>
11
+
12
+ <reference name="top.links">
13
+ <action method="addLink" translate="label title" module="checkout">
14
+ <label>My Cart</label>
15
+ <url helper="checkout/getCartUrl"/>
16
+ <title>My Cart</title>
17
+ <prepare/>
18
+ <urlParams/>
19
+ <position>1</position>
20
+ <liParams/>
21
+ <aParams>id="my-cart"</aParams>
22
+ <beforeText/>
23
+ <afterText/>
24
+ </action>
25
+ </reference>
26
+
27
+
28
+
29
+ <reference name="head">
30
+ <block type="cartmenu/cartmenu" name="customcart" template="cartmenu/cartmenu.phtml"/>
31
+ </reference>
32
+
33
+ <reference name="head">
34
+ <action method="addItem"><type>skin_css</type><file>css/evo-cart-menu.css</file></action>
35
+ </reference>
36
+
37
+
38
+ </default>
39
+
40
+ </layout>
app/design/frontend/base/default/template/cartmenu/cartmenu.phtml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?
2
+ $session = Mage::getSingleton('checkout/session');
3
+ $renderer = new Mage_Checkout_Block_Cart_Item_Renderer();
4
+ $output = "";
5
+ $items=$session->getQuote()->getAllItems();
6
+ $total_items=count($items);
7
+ $items=array_reverse($items);
8
+ $i=0;
9
+ if(!empty($items)){
10
+ foreach ($items as $item) {
11
+ $i++;
12
+ $renderer->setItem($item);
13
+ $output.='<div><div class="evo-cart-left"><img src="'.Mage::helper('catalog/image')->init($item, 'image')->resize(70).'"/></div>';
14
+ $output .= '<div class="evo-cart-right"><div>'.str_replace("'",'',$item->getName()) . "</div>";
15
+ $output .= '<div><div class="evo-cart-qty">Qty '.$item->getQty() . "</div>";
16
+ $output .= '<div class="evo-cart-price">'.Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol().$item->getBaseCalculationPrice() . '<div class="evo-cart-delete"><a href="'.$renderer->getDeleteUrl().'">'.$this->__('Delete').'</a></div></div></div>';
17
+ $output .= '</div></div><div class="evo-cart-clean">&nbsp;</div>';
18
+ if($i==3)
19
+ break;
20
+
21
+ }
22
+ }
23
+ else
24
+ $output.='<div align="center"><BR>'.str_replace("'",'&#39;',$this->__('No items in the cart.')).'</div>';
25
+ $toHtml='<div class="evo-cart-main-wrap"><div class="evo-cart-main" id="evo-cart-main"><div class="evo-cart">';
26
+ $toHtml.=$output;
27
+ $toHtml.='</div>';
28
+ if($total_items>3){
29
+ $remaining_items=$total_items-3;
30
+ $toHtml.='<div class="evo-cart-remaining">You still have '.($remaining_items).' item'.($remaining_items==1?'':'s').' in cart</div>';
31
+ }
32
+ $base=Mage::getBaseUrl();
33
+ $toHtml.='<div class="evo-cart-links"><a href="'.$base.'checkout/cart/">'.$this->__('Check my cart').'</a> | <a href="'.$base.'checkout/onepage/">'.$this->__('Checkout').'</a></div>';
34
+ $toHtml.='<div class="evo-cart-mycart"><a href="#" onclick="close_cart()" style="margin:0px;">'.$this->__('My Cart').'</a></div></div></div>';
35
+ ?>
36
+
37
+ <script>
38
+ var $j = jQuery.noConflict();
39
+ $j(function() {
40
+ $j(".links li.first").html('<a href="#" onclick="display_cart()" id="evo-cart-click"><? echo $this->__('My Cart');?></a>');
41
+ });
42
+
43
+ function close_cart()
44
+ {
45
+ //$j('.links li.first').css('background','url("http://gm.evobilis.com/skin/frontend/default/default/images/bg-top-buttons.jpg") repeat-x');
46
+ //$j('.links li.first').css('padding-top','7px');
47
+ $j('.links li.first').addClass('evo-cart-close');
48
+ $j(".links li.first").html('<a href="#" onclick="display_cart()"><? echo $this->__('My Cart');?></a>');
49
+
50
+
51
+ }
52
+
53
+ function display_cart() {
54
+ $j('.links li.first').css('background','none');
55
+ $j('.links li.first').css('padding-top','0px');
56
+ $j(".links li.first").html('<?=$toHtml;?>');
57
+ $j(".links li.first").hide();
58
+ $j(".links li.first").slideDown();
59
+
60
+ };
61
+
62
+
63
+ $j(document).mouseup(function (e)
64
+ {
65
+ var container = $j(".links");
66
+
67
+ if (container.has(e.target).length === 0)
68
+ {
69
+ close_cart();
70
+ }
71
+ });
72
+
73
+ </script>
74
+
75
+
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>evobiliscartmenu</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.evobilis.com">Evobilis</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Display a list of products added to the cart in a drop down menu </description>
11
  <notes>Display a list of products added to the cart in a drop down menu </notes>
12
  <authors><author><name>Mahesh</name><user>Mahesh</user><email>mahesh.komarraju@evobilis.com</email></author><author><name>Cyrus</name><user>aumanwai</user><email>cyrus.au@evobilis.com</email></author></authors>
13
- <date>2013-02-28</date>
14
- <time>04:21:44</time>
15
- <contents><target name="magelocal"><dir name="Evobilis"><dir name="Cartmenu"><dir><dir name="Block"><file name="Cartmenu.php" hash="003eb9ffa498041b5c2b071414cee92e"/></dir><dir name="Model"><file name="Cartmenu.php" hash="afc56a4bbe0a5ab8280135db48b4affc"/></dir><dir name="controllers"><file name="IndexController.php" hash="193d28a15b7d50730e0e2ba816899fa1"/></dir><dir name="etc"><file name="config.xml" hash="7acf5074994c4cbc18142d72c73ef7ab"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cartmenu.xml" hash=""/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="evo-cart-menu"><file name="evo-cart-menu.css" hash=""/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Evobilis_Cartmenu.xml" hash="73ea83e3c562dc184956dcf3c7c19204"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>5.4.6</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>evobiliscartmenu</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.evobilis.com">Evobilis</license>
7
  <channel>community</channel>
10
  <description>Display a list of products added to the cart in a drop down menu </description>
11
  <notes>Display a list of products added to the cart in a drop down menu </notes>
12
  <authors><author><name>Mahesh</name><user>Mahesh</user><email>mahesh.komarraju@evobilis.com</email></author><author><name>Cyrus</name><user>aumanwai</user><email>cyrus.au@evobilis.com</email></author></authors>
13
+ <date>2013-03-03</date>
14
+ <time>08:53:05</time>
15
+ <contents><target name="magelocal"><dir name="Evobilis"><dir name="Cartmenu"><dir><dir name="Block"><file name="Cartmenu.php" hash="003eb9ffa498041b5c2b071414cee92e"/></dir><dir name="Model"><file name="Cartmenu.php" hash="afc56a4bbe0a5ab8280135db48b4affc"/></dir><dir name="controllers"><file name="IndexController.php" hash="193d28a15b7d50730e0e2ba816899fa1"/></dir><dir name="etc"><file name="config.xml" hash="7acf5074994c4cbc18142d72c73ef7ab"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cartmenu.xml" hash="5d4066d0f4477aa182dff18e2c0104e3"/></dir><dir name="template"><dir name="cartmenu"><file name="cartmenu.phtml" hash="ea1a363f0668b594634c92c37a03140e"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="evo-cart-menu.css" hash="9649644a5c9a0b04231192aed2a9ba0d"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Evobilis_Cartmenu.xml" hash="73ea83e3c562dc184956dcf3c7c19204"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>5.4.6</max></php></required></dependencies>
18
  </package>
skin/frontend/base/default/css/evo-cart-menu.css ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .evo-cart-remaining
2
+ {
3
+ background-color:#404042;
4
+ color:#FFF;
5
+ margin-top: -10px;
6
+ padding-bottom: 10px;
7
+ padding-right: 10px;
8
+ }
9
+ .evo-cart-links
10
+ {
11
+ background-color:#404042;
12
+ color:#FFF;
13
+ margin-top: -10px;
14
+ padding-bottom: 10px;
15
+ padding-right: 10px;
16
+ }
17
+ .evo-cart-delete
18
+ {
19
+ color:#FFF;
20
+ }
21
+ .evo-cart-qty
22
+ {
23
+ float:left; color:#B7AC7F;
24
+
25
+ }
26
+ .evo-cart-price
27
+ {
28
+ float:right;color:#B7AC7F;
29
+ }
30
+ .evo-cart-clean
31
+ {
32
+ clear:both;
33
+ }
34
+ .evo-cart-left
35
+ {
36
+ float:left;
37
+ }
38
+ .evo-cart-right
39
+ {
40
+ float:right;width:140px;
41
+ }
42
+ .evo-cart
43
+ {
44
+ background-color:#404042;
45
+ width:222px;
46
+ min-height:50px;
47
+ padding:5px;
48
+ color:#FFF;
49
+ text-align: left;
50
+ z-index:9999;
51
+
52
+ }
53
+ .evo-cart-mycart
54
+ {
55
+ width:68px;
56
+ text-align:center;
57
+ background-color:#404042;
58
+ padding:5px;
59
+ float:right;
60
+ color:#FFF;
61
+
62
+ }
63
+ .evo-cart-main
64
+ {
65
+ top: 0; position: absolute;
66
+ }
67
+
68
+ .evo-cart-main-wrap
69
+ {
70
+ height: 17px; width: 232px; position: relative;
71
+ }