SSTech_Quickorder - Version 0.0.1

Version Notes

stable version release

Download this release

Release Info

Developer SSTech
Extension SSTech_Quickorder
Version 0.0.1
Comparing to
See all releases


Version 0.0.1

app/code/community/SSTech/Quickorder/Block/Quickorder.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class SSTech_Quickorder_Block_Quickorder extends Mage_Core_Block_Template{
3
+
4
+ public function getQuickattriute()
5
+ {
6
+ $quickorder = Mage::getStoreConfig('quickorder/quickorder/quickorder');
7
+ $product = Mage::getModel('catalog/product');
8
+ $_productCollection = $product->getCollection()->addAttributeToFilter('type_id', array('eq' => 'simple'))->addAttributeToSelect('*');
9
+ return $_productCollection;
10
+
11
+ }
12
+
13
+ }
app/code/community/SSTech/Quickorder/Helper/Data.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class SSTech_Quickorder_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ public function getQuickorderUrl() {
5
+ $var = Mage::getUrl('quickorder');
6
+ return $var;
7
+
8
+ }
9
+ }
10
+
app/code/community/SSTech/Quickorder/controllers/IndexController.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class SSTech_Quickorder_IndexController extends Mage_Core_Controller_Front_Action{
3
+
4
+ protected function _getSession()
5
+ {
6
+ return Mage::getSingleton('customer/session');
7
+ }
8
+ public function indexAction() {
9
+
10
+ $this->loadLayout();
11
+ $this->getLayout()->getBlock("head")->setTitle($this->__("Quickorder"));
12
+ $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
13
+ $breadcrumbs->addCrumb("home", array(
14
+ "label" => $this->__("Home Page"),
15
+ "title" => $this->__("Home Page"),
16
+ "link" => Mage::getBaseUrl()
17
+ ));
18
+
19
+ $breadcrumbs->addCrumb("quickorder", array(
20
+ "label" => $this->__("Quickorder"),
21
+ "title" => $this->__("Quickorder")
22
+ ));
23
+
24
+ $this->renderLayout();
25
+ if (!$this->_getSession()->isLoggedIn()) {
26
+
27
+ }
28
+ $params = $this->getRequest()->getParams();
29
+ $collection = $params['all'];
30
+ if(count($params)){
31
+ $add1 = true;
32
+ foreach($collection as $products)
33
+ {
34
+ if(array_key_exists('checkbox',$products))
35
+ {
36
+ $add = true;
37
+ if($products['qty']>0)
38
+ break;
39
+ else {
40
+ $add = false;
41
+ $add1 = false;
42
+ }
43
+ }
44
+ else
45
+ $add = false;
46
+ }
47
+ if($add && $add1)
48
+ {
49
+ $cart = Mage::getModel('checkout/cart');
50
+ $cart->init();
51
+ foreach ($collection as $products) {
52
+ if($products['checkbox']==1 && $products['qty']>0) {
53
+ $pModel = Mage::getModel('catalog/product');
54
+ $pModel->load($products['product_id']);
55
+ if ($pModel->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
56
+ try {
57
+ $cart->addProduct($pModel, array('qty' => $products['qty']));
58
+ } catch (Exception $e) {
59
+ continue;
60
+ }
61
+ }
62
+ }
63
+ }
64
+ $cart->save();
65
+ if ($this->getRequest()->isXmlHttpRequest()) {
66
+ exit('1');
67
+ }
68
+ $message = $this->__('Products were added to your shopping cart.');
69
+ Mage::getSingleton('checkout/session')->addSuccess($message);
70
+ $this->_redirect('checkout/cart');
71
+ }
72
+ else
73
+ {
74
+ if(!$add1){
75
+ Mage::getSingleton('core/session')->addError('Quantity should be greater than Zero!');
76
+ } else{
77
+ Mage::getSingleton('core/session')->addError('Please select products');
78
+ }
79
+
80
+ $this->_redirect('quickorder');
81
+ }
82
+
83
+ }
84
+
85
+ }
86
+
87
+ }
app/code/community/SSTech/Quickorder/etc/adminhtml.xml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <quickorder translate="title" module="quickorder">
12
+ <title>Quickorder</title>
13
+ <sort_order>0</sort_order>
14
+ </quickorder>
15
+ </children>
16
+
17
+ </config>
18
+ </children>
19
+ </system>
20
+ </children>
21
+ </admin>
22
+ </resources>
23
+ </acl>
24
+ </config>
app/code/community/SSTech/Quickorder/etc/config.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <SSTech_Quickorder>
5
+ <version>0.0.1</version>
6
+ </SSTech_Quickorder>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <quickorder>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>SSTech_Quickorder</module>
14
+ <frontName>quickorder</frontName>
15
+ </args>
16
+ </quickorder>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <quickorder>
21
+ <file>quickorder.xml</file>
22
+ </quickorder>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <helpers>
28
+ <quickorder>
29
+ <class>SSTech_Quickorder_Helper</class>
30
+ </quickorder>
31
+ </helpers>
32
+ <blocks>
33
+ <quickorder>
34
+ <class>SSTech_Quickorder_Block</class>
35
+ </quickorder>
36
+ </blocks>
37
+ </global>
38
+ </config>
app/code/community/SSTech/Quickorder/etc/system.xml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <quickorder translate="label" module="quickorder">
5
+ <label>SSTech</label>
6
+ <sort_order>100</sort_order>
7
+ </quickorder>
8
+ </tabs>
9
+ <sections>
10
+ <quickorder translate="label" module="quickorder">
11
+ <tab>quickorder</tab>
12
+ <label>Quickorder</label>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>3000</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <quickorder translate="label">
20
+ <label>Quick Orders</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>10</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>0</show_in_store>
26
+ <fields>
27
+
28
+ <quickorder translate="label">
29
+ <label>Quickorder</label>
30
+ <frontend_type>select</frontend_type>
31
+ <source_model>adminhtml/system_config_source_yesno</source_model>
32
+ <sort_order>1</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>0</show_in_store>
36
+ <comment>Enable or Disable Quickorder Module</comment>
37
+ </quickorder>
38
+ <quickorderguest translate="label">
39
+ <label>Show Price for Guest</label>
40
+ <frontend_type>select</frontend_type>
41
+ <source_model>adminhtml/system_config_source_yesno</source_model>
42
+ <sort_order>2</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>0</show_in_store>
46
+ <comment>Enable or Disable Price for guest</comment>
47
+ </quickorderguest>
48
+ <quickordercartguest translate="label">
49
+ <label>Show Add to cart for guest</label>
50
+ <frontend_type>select</frontend_type>
51
+ <source_model>adminhtml/system_config_source_yesno</source_model>
52
+ <sort_order>3</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>0</show_in_store>
56
+ <comment>Enable or Disable Add to cart for guest</comment>
57
+ </quickordercartguest>
58
+ </fields>
59
+ </quickorder>
60
+ </groups>
61
+ </quickorder>
62
+ </sections>
63
+ </config>
64
+
app/design/frontend/base/default/layout/quickorder.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="top.links">
5
+ <action method="addLink" translate="label title" module="quickorder" ifconfig="quickorder/quickorder/quickorder"><label>Quick Order</label><url helper="quickorder/getQuickorderUrl"/><title>Quick Order</title><prepare/><urlParams/><position>10</position></action>
6
+ </reference>
7
+ </default>
8
+ <quickorder_index_index>
9
+ <reference name="root">
10
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
11
+ </reference>
12
+ <reference name="content">
13
+ <block type="quickorder/quickorder" name="quickorder_quickorder" template="quickorder/quickorder.phtml"/>
14
+ </reference>
15
+ </quickorder_index_index>
16
+ </layout>
17
+
app/design/frontend/base/default/template/quickorder/quickorder.phtml ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+ /**
4
+ * Product list template
5
+ *
6
+ * @see Mage_Catalog_Block_Product_List
7
+ */
8
+ ?>
9
+ <?php
10
+ $_productCollection = $this->getQuickattriute();
11
+ $quickorderguest = Mage::getStoreConfig('quickorder/quickorder/quickorderguest');
12
+ $quickordercartguest = Mage::getStoreConfig('quickorder/quickorder/quickordercartguest');
13
+ ?>
14
+ <?php if(!count($_productCollection)): ?>
15
+ <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
16
+ <?php else: ?>
17
+ <form id="quick-order" action="<?php echo $this->getUrl('quickorder/index'); ?>" method="post" class="data-table">
18
+ <div class="category-products">
19
+ <?php echo $this->getSortbarHtml() ?>
20
+ <?php $_iterator = 0; ?>
21
+ <?php if($this->helper('customer')->isLoggedIn()){ ?>
22
+ <div style="margin-bottom: 5px;width: 100%;text-align: right;"><button type="submit" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" ><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></div>
23
+ <?php } ?>
24
+ <?php if(!$this->helper('customer')->isLoggedIn() && ($quickordercartguest == '1')){ ?>
25
+ <div style="margin-bottom: 5px;width: 100%;text-align: right;"><button type="submit" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" ><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></div>
26
+ <?php } ?>
27
+ <table width="100%" cellspacing="0" cellpadding="0" border="0" class="data-table" id="products-list">
28
+ <tbody>
29
+ <tr class="productListing-rowheading">
30
+ <th align="center" id="listCell0-0" scope="col" class="productListing-heading"><?php echo $this->__('Product Image') ?></th>
31
+ <th id="listCell0-1" scope="col" class="productListing-heading"><?php echo $this->__('Item Name') ?></a></th>
32
+ <?php if($this->helper('customer')->isLoggedIn()): ?>
33
+ <th align="right" id="listCell0-2" scope="col" class="productListing-heading"><?php echo $this->__('Price') ?></th>
34
+ <th align="right" id="listCell0-2" scope="col" class="productListing-heading"><?php echo $this->__('Qty') ?></th>
35
+ <th align="right" id="listCell0-2" scope="col" class="productListing-heading"><?php echo $this->__('Action') ?></th>
36
+ <?php endif; ?>
37
+ <?php if(!$this->helper('customer')->isLoggedIn() && ($quickorderguest == '1')):?>
38
+ <th align="right" id="listCell0-2" scope="col" class="productListing-heading"><?php echo $this->__('Price') ?></th>
39
+ <?php elseif (!$this->helper('customer')->isLoggedIn() && ($quickorder1 == '0')): ?>
40
+ <div class="pri"><p>"Login to view product price"</p></div>
41
+ <?php endif; ?>
42
+ <?php if(!$this->helper('customer')->isLoggedIn() && ($quickordercartguest == '1')): ?>
43
+ <th align="right" id="listCell0-2" scope="col" class="productListing-heading"><?php echo $this->__('Qty') ?></th>
44
+ <th align="right" id="listCell0-2" scope="col" class="productListing-heading"><?php echo $this->__('Action') ?></th>
45
+ <?php elseif (!$this->helper('customer')->isLoggedIn() && ($quickordercartguest == '0')): ?>
46
+ <div class="pri"><p><?php echo $this->__('Login to Add to cart') ?></p></div>
47
+ <?php endif; ?>
48
+ </tr>
49
+ <?php foreach ($_productCollection as $_product): ?>
50
+ <tr class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
51
+ <td align="center" class="productListing-data productListing-img">
52
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(50,50); ?>" width="50" height="50" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
53
+ </td>
54
+ <td class="productListing-data">
55
+ <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
56
+ <h3 class="product-name">
57
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_product->getName(); ?></a>
58
+ </h3>
59
+ <div class="listingDescription">
60
+ <a href="<?php echo $_product->getProductUrl() ?>" target="_blank" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('view more') ?></a>
61
+ </div>
62
+ </td>
63
+ <?php if($this->helper('customer')->isLoggedIn()): ?>
64
+ <td align="right" class="productListing-data">
65
+ <?php echo Mage::helper('core')->currency($_product->getFinalPrice(),true,false); ?>
66
+ </td>
67
+ <?php elseif (!$this->helper('customer')->isLoggedIn() &&($quickorderguest == '1')): ?>
68
+ <td align="right" class="productListing-data">
69
+ <?php echo Mage::helper('core')->currency($_product->getFinalPrice(),true,false); ?>
70
+ </td>
71
+ <?php endif; ?>
72
+ <?php if($this->helper('customer')->isLoggedIn()): ?>
73
+ <td align="right" class="productListing-data">
74
+ <input type="text" name="all[<?php echo $_product->getId(); ?>][qty]" id="qty" maxlength="12" value="1" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
75
+ </td>
76
+ <td align="right" class="productListing-data productListing-addto">
77
+ <input type="checkbox" class="checkbox" name="all[<?php echo $_product->getId(); ?>][checkbox]" value="1">
78
+ <input type="hidden" name="all[<?php echo $_product->getId(); ?>][product_id]" value="<?php echo $_product->getId(); ?>" />
79
+ </td>
80
+ <?php elseif (!$this->helper('customer')->isLoggedIn() && ($quickordercartguest == '1')): ?>
81
+ <td align="right" class="productListing-data">
82
+ <input type="text" name="all[<?php echo $_product->getId(); ?>][qty]" id="qty" maxlength="12" value="1" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
83
+ </td>
84
+ <td align="right" class="productListing-data productListing-addto">
85
+ <input type="checkbox" class="checkbox" name="all[<?php echo $_product->getId(); ?>][checkbox]" value="1">
86
+ <input type="hidden" name="all[<?php echo $_product->getId(); ?>][product_id]" value="<?php echo $_product->getId(); ?>" />
87
+ </td>
88
+ <?php endif ?>
89
+ </tr>
90
+ <?php endforeach; ?>
91
+ </tbody>
92
+ </table>
93
+ <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
94
+ <?php if($this->helper('customer')->isLoggedIn()){ ?>
95
+ <div style="margin-bottom: 5px;width: 100%;text-align: right;"><button type="submit" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" ><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></div>
96
+ <?php } ?>
97
+ </div>
98
+ </form>
99
+ <?php endif; ?>
100
+
app/etc/modules/SSTech_Quickorder.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <SSTech_Quickorder>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>0.0.1</version>
8
+ </SSTech_Quickorder>
9
+ </modules>
10
+ </config>
package.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>SSTech_Quickorder</name>
4
+ <version>0.0.1</version>
5
+ <stability>stable</stability>
6
+ <license>Open Source License</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Quick order which allow to add all products in quick time</summary>
10
+ <description>Quick order which allow to add all products in quick time&#xD;
11
+ Easy installation &#xD;
12
+ Shows link in top menu &#xD;
13
+ Shows all products </description>
14
+ <notes>stable version release</notes>
15
+ <authors><author><name>SSTech</name><user>SSTech</user><email>sandynareshg@gmail.com</email></author></authors>
16
+ <date>2014-07-12</date>
17
+ <time>08:35:03</time>
18
+ <contents><target name="mageetc"><dir name="modules"><file name="SSTech_Quickorder.xml" hash="fd389bc997ca647d3335b75065d0cb7e"/></dir></target><target name="magecommunity"><dir name="SSTech"><dir name="Quickorder"><dir name="Block"><file name="Quickorder.php" hash="5846a63deb5c93f418d3da8f89928e96"/></dir><dir name="Helper"><file name="Data.php" hash="1d5a1d91a099048a5172c4b49b487c1d"/></dir><dir name="controllers"><file name="IndexController.php" hash="ddb94d76715f63605b84f53e22c1564b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f6c0c174c731ce37cbbb9562203c55e6"/><file name="config.xml" hash="bacf6f686d97c32dae5d80ed9208469f"/><file name="system.xml" hash="abf1ecc6264061ab291c8cb0e8c7095b"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="quickorder"><file name="quickorder.phtml" hash="ac59de7c633ac4382ef7bb35132a2813"/></dir></dir><dir name="layout"><file name="quickorder.xml" hash="77adfcab10640f29b9e2d32c31612e8a"/></dir></dir></dir></dir></target></contents>
19
+ <compatible/>
20
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
21
+ </package>