Version Notes
Fixed 'Quick Order block display in shopping cart page' issue for Magento versions older than 1.7
Download this release
Release Info
Developer | Mukesh Chapagain |
Extension | Chapagain_QuickOrder |
Version | 0.1.1 |
Comparing to | |
See all releases |
Code changes from version 0.1.0 to 0.1.1
- app/code/community/Chapagain/QuickOrder/Model/Observer.php +27 -0
- app/code/community/Chapagain/QuickOrder/etc/config.xml +18 -2
- app/design/frontend/base/default/layout/chapagain_quickorder.xml +4 -4
- app/design/frontend/base/default/template/chapagain_quickorder/block_cart.phtml +4 -2
- app/design/frontend/base/default/template/chapagain_quickorder/block_sidebar.phtml +2 -2
- app/etc/modules/Chapagain_QuickOrder.xml +0 -0
- package.xml +4 -6
app/code/community/Chapagain/QuickOrder/Model/Observer.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Chapagain_QuickOrder_Model_Observer
|
4 |
+
{
|
5 |
+
public function insertBlock($observer)
|
6 |
+
{
|
7 |
+
/** @var $_block Mage_Core_Block_Abstract */
|
8 |
+
/*Get block instance*/
|
9 |
+
$_block = $observer->getBlock();
|
10 |
+
|
11 |
+
/*get Block type*/
|
12 |
+
$_type = $_block->getType();
|
13 |
+
|
14 |
+
/*Check block type*/
|
15 |
+
if ($_type == 'checkout/cart_coupon') {
|
16 |
+
/*Clone block instance*/
|
17 |
+
$_child = clone $_block;
|
18 |
+
/*set another type for block*/
|
19 |
+
$_child->setType('quickorder/quickorder');
|
20 |
+
/*set child for block*/
|
21 |
+
$_block->setChild('child.coupon', $_child);
|
22 |
+
/*set our template*/
|
23 |
+
$_block->setTemplate('chapagain_quickorder/block_cart.phtml');
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Chapagain/QuickOrder/etc/config.xml
CHANGED
@@ -2,10 +2,21 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Chapagain_QuickOrder>
|
5 |
-
<version>0.1.
|
6 |
</Chapagain_QuickOrder>
|
7 |
</modules>
|
8 |
<frontend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
<routers>
|
10 |
<quickorder>
|
11 |
<use>standard</use>
|
@@ -32,7 +43,12 @@
|
|
32 |
</modules>
|
33 |
</translate>
|
34 |
</frontend>
|
35 |
-
<global>
|
|
|
|
|
|
|
|
|
|
|
36 |
<resources>
|
37 |
<quickorder_setup>
|
38 |
<setup>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Chapagain_QuickOrder>
|
5 |
+
<version>0.1.1</version>
|
6 |
</Chapagain_QuickOrder>
|
7 |
</modules>
|
8 |
<frontend>
|
9 |
+
<events>
|
10 |
+
<core_block_abstract_to_html_before>
|
11 |
+
<observers>
|
12 |
+
<chapagain_quickorder>
|
13 |
+
<type>model</type>
|
14 |
+
<class>quickorder/observer</class>
|
15 |
+
<method>insertBlock</method>
|
16 |
+
</chapagain_quickorder>
|
17 |
+
</observers>
|
18 |
+
</core_block_abstract_to_html_before>
|
19 |
+
</events>
|
20 |
<routers>
|
21 |
<quickorder>
|
22 |
<use>standard</use>
|
43 |
</modules>
|
44 |
</translate>
|
45 |
</frontend>
|
46 |
+
<global>
|
47 |
+
<models>
|
48 |
+
<quickorder>
|
49 |
+
<class>Chapagain_QuickOrder_Model</class>
|
50 |
+
</quickorder>
|
51 |
+
</models>
|
52 |
<resources>
|
53 |
<quickorder_setup>
|
54 |
<setup>
|
app/design/frontend/base/default/layout/chapagain_quickorder.xml
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.
|
3 |
<default>
|
4 |
<block type="quickorder/quickorder" name="quickorder.sidebar" before="-" template="chapagain_quickorder/block_sidebar.phtml"/>
|
5 |
<reference name="left">
|
@@ -14,16 +14,16 @@
|
|
14 |
</reference>
|
15 |
</default>
|
16 |
|
17 |
-
|
18 |
<block type="quickorder/quickorder" name="checkout.cart.extra" template="chapagain_quickorder/block_cart.phtml"/>
|
19 |
<reference name="content">
|
20 |
<reference name="checkout.cart">
|
21 |
-
|
22 |
<action method="append" ifconfig="catalog/chapagain_quickorder/show_in_cart">
|
23 |
<block>checkout.cart.extra</block>
|
24 |
</action>
|
25 |
</reference>
|
26 |
</reference>
|
27 |
-
</checkout_cart_index
|
28 |
|
29 |
</layout>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.1">
|
3 |
<default>
|
4 |
<block type="quickorder/quickorder" name="quickorder.sidebar" before="-" template="chapagain_quickorder/block_sidebar.phtml"/>
|
5 |
<reference name="left">
|
14 |
</reference>
|
15 |
</default>
|
16 |
|
17 |
+
<!--<checkout_cart_index>
|
18 |
<block type="quickorder/quickorder" name="checkout.cart.extra" template="chapagain_quickorder/block_cart.phtml"/>
|
19 |
<reference name="content">
|
20 |
<reference name="checkout.cart">
|
21 |
+
<block type="quickorder/quickorder" name="checkout.cart.extra" template="chapagain_quickorder/block_cart.phtml"/>
|
22 |
<action method="append" ifconfig="catalog/chapagain_quickorder/show_in_cart">
|
23 |
<block>checkout.cart.extra</block>
|
24 |
</action>
|
25 |
</reference>
|
26 |
</reference>
|
27 |
+
</checkout_cart_index>-->
|
28 |
|
29 |
</layout>
|
app/design/frontend/base/default/template/chapagain_quickorder/block_cart.phtml
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
|
2 |
-
<?php
|
3 |
|
4 |
<form id="quickorder-form-cart" action="<?php echo $this->getUrl('quickorder/checkout_cart/add') ?>" method="post">
|
5 |
<div class="discount">
|
@@ -27,4 +27,6 @@ function submitQuickOrderFromCart() {
|
|
27 |
//]]>
|
28 |
</script>
|
29 |
|
30 |
-
<?php
|
|
|
|
1 |
|
2 |
+
<?php if($this->helper('quickorder')->getShowInCart()): ?>
|
3 |
|
4 |
<form id="quickorder-form-cart" action="<?php echo $this->getUrl('quickorder/checkout_cart/add') ?>" method="post">
|
5 |
<div class="discount">
|
27 |
//]]>
|
28 |
</script>
|
29 |
|
30 |
+
<?php endif; ?>
|
31 |
+
|
32 |
+
<?php echo $this->getChildHtml('child.coupon'); ?>
|
app/design/frontend/base/default/template/chapagain_quickorder/block_sidebar.phtml
CHANGED
@@ -6,8 +6,8 @@
|
|
6 |
<form action="<?php echo $this->getUrl('quickorder/checkout_cart/add') ?>" method="post" id="quickorder-form-sidebar">
|
7 |
<div class="block-content">
|
8 |
<div class="input-box">
|
9 |
-
<label><?php echo $this->__('SKU') ?></label> <input type="text" class="input-text" id="sku" name="sku"/>
|
10 |
-
<label><?php echo $this->__('Qty') ?></label
|
11 |
</div>
|
12 |
<div class="actions">
|
13 |
<button type="submit" title="<?php echo $this->__('Add to Cart') ?>" class="button" onclick="submitQuickOrderFromSidebar()"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
6 |
<form action="<?php echo $this->getUrl('quickorder/checkout_cart/add') ?>" method="post" id="quickorder-form-sidebar">
|
7 |
<div class="block-content">
|
8 |
<div class="input-box">
|
9 |
+
<label><?php echo $this->__('SKU') ?></label> <input type="text" class="input-text" id="sku" name="sku" style="width:85%"/>
|
10 |
+
<label><?php echo $this->__('Qty') ?></label> <input type="text" class="input-text" id="qty" name="qty" value="1" style="width:25%"/>
|
11 |
</div>
|
12 |
<div class="actions">
|
13 |
<button type="submit" title="<?php echo $this->__('Add to Cart') ?>" class="button" onclick="submitQuickOrderFromSidebar()"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
app/etc/modules/Chapagain_QuickOrder.xml
CHANGED
File without changes
|
package.xml
CHANGED
@@ -1,14 +1,12 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<package><name>Chapagain_QuickOrder</name><version>0.1.
|
3 |
|
4 |
-
A
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
This can be managed from System -> Configuration -> Catalog -> Quick Order.
|
9 |
|
10 |
Features:-
|
11 |
|
12 |
Easy to install and use
|
13 |
100% Free
|
14 |
-
100% Open Source</description><notes>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<package><name>Chapagain_QuickOrder</name><version>0.1.1</version><stability>stable</stability><license>OSL v3.0</license><channel>community</channel><extends></extends><summary>This extension allows customers to directly add products to shopping cart using product SKU.</summary><description>This extension allows customers to directly add products to shopping cart using product SKU.
|
3 |
|
4 |
+
A Quick Order block will be displayed in left and right sidebar. This block will also be displayed in shopping cart page. This block contains two fields. One for adding product SKU and the other for adding your desired quantity.
|
5 |
|
6 |
+
By default, the Quick Order block is displayed in all three positions (Left Sidebar, Right Sidebar, and Shopping Cart Page). You can manage the display of this block from System -> Configuration -> Catalog -> Quick Order.
|
|
|
|
|
7 |
|
8 |
Features:-
|
9 |
|
10 |
Easy to install and use
|
11 |
100% Free
|
12 |
+
100% Open Source</description><notes>Fixed 'Quick Order block display in shopping cart page' issue for Magento versions older than 1.7</notes><authors><author><name>Mukesh Chapagain</name><user>chapagain</user><email>mukesh.chapagain@gmail.com</email></author></authors><date>2015-07-29</date><time>2:35:20</time><compatible></compatible><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies><contents><target name="mage"><dir name="app"><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="chapagain_quickorder.xml" hash="401d81745a080b0f5228185ca7d40aff"/></dir><dir name="template"><dir name="chapagain_quickorder"><file name="block_cart.phtml" hash="15831f54b481e3915b8bdb407033fb36"/><file name="block_sidebar.phtml" hash="9cbebe4519c46a7ed50e905c902437be"/></dir></dir></dir></dir></dir></dir><dir name="locale"><dir name="en_US"><file name="Chapagain_QuickOrder.csv" hash="cfcfb069a8a7f13765973191592e426a"/></dir></dir><dir name="code"><dir name="community"><dir name="Chapagain"><dir name="QuickOrder"><dir name="Model"><file name="Observer.php" hash="ddddcf12572354afbb27cb7363be71df"/></dir><dir name="controllers"><file name="QuickorderController.php" hash="0ae1190b65170faa2a3f3765e035d7fa"/><dir name="Checkout"><file name="CartController.php" hash="f53a789d69a2517e03cdb698bda2f2a6"/></dir></dir><dir name="etc"><file name="config.xml" hash="ad3b61f7acf79642089fd71541c85589"/><file name="system.xml" hash="d5fe73980c067fbc5ce1e2bd2f83ec59"/></dir><dir name="Helper"><file name="Data.php" hash="8b99fe95b753ba4b899f0b97ce3b2926"/></dir><dir name="Block"><file name="Quickorder.php" hash="4be05eed8f99327e2192f00d892e6908"/></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Chapagain_QuickOrder.xml" hash="e00d1603d219e419702316686dea647f"/></dir></dir></dir></target></contents></package>
|