Rcg_Custombundle - Version 1.0.0

Version Notes

Added options to remove price and stock quantity.

Download this release

Release Info

Developer Magento Core Team
Extension Rcg_Custombundle
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Rcg/Custombundle/Block/Catalog/Product/View/Type/Bundle/Option.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Bundle
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ /**
29
+ * Bundle option renderer
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Bundle
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Rcg_Custombundle_Block_Catalog_Product_View_Type_Bundle_Option extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select
36
+
37
+ {
38
+
39
+
40
+ public function getSelectionTitlePrice ($_selection, $includeContainer = true)
41
+ {
42
+
43
+ if ( Mage::getStoreConfig('RCG_options/custombundle/active')) {
44
+ $separator1 = '';
45
+ $separator2 = '';
46
+ $separator3 = '';
47
+ $attribute1 = '';
48
+ $attribute2 = '';
49
+ $attribute3 = '';
50
+
51
+
52
+ $attvalue1 = Mage::getStoreConfig('RCG_options/custombundle/attrib1');
53
+ $attvalue2 = Mage::getStoreConfig('RCG_options/custombundle_cc/attrib2');
54
+ $attvalue3 = Mage::getStoreConfig('RCG_options/custombundle_cc/attrib3');
55
+ $separator0 = Mage::getStoreConfig('RCG_options/custombundle/separator0');
56
+ $separator1 = Mage::getStoreConfig('RCG_options/custombundle/separator1');
57
+ $separator2 = Mage::getStoreConfig('RCG_options/custombundle/separator2');
58
+ $separator3 = Mage::getStoreConfig('RCG_options/custombundle_cc/separator3');
59
+ $separator3 = Mage::getStoreConfig('RCG_options/custombundle/separator3');
60
+ $showprice = Mage::getStoreConfig('RCG_options/custombundle/showprice');
61
+ $showstockqty = Mage::getStoreConfig('RCG_options/custombundle/showstockqty');
62
+ $pricesymbol = Mage::getStoreConfig('RCG_options/custombundle/pricesymbol');
63
+
64
+
65
+
66
+
67
+
68
+ $_selection->load($_selection->getId()) ;
69
+
70
+ if($attvalue1) {$attribute1 = $_selection->getResource()->getAttribute($attvalue1)->getFrontend()->getValue($_selection);};
71
+
72
+ if($attvalue2) {$attribute2 = $_selection->getResource()->getAttribute($attvalue2)->getFrontend()->getValue($_selection);};
73
+
74
+ if($attvalue3) {$attribute3 = $_selection->getResource()->getAttribute($attvalue3)->getFrontend()->getValue($_selection);};
75
+
76
+
77
+ $_SelectionStockQty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_selection)->getQty();
78
+ $price = $this->getProduct()->getPriceModel()->getSelectionPreFinalPrice($this->getProduct(), $_selection);
79
+
80
+
81
+ $rtrn = $_selection->getSelectionQty()*1 . $separator0 . ' '
82
+ .$separator1 .$attribute1
83
+ .$separator2 .$attribute2
84
+ .$separator3 .$attribute3
85
+ .' &nbsp; '
86
+ .($showstockqty ? Mage::getModel('cataloginventory/stock_item')->loadByProduct($_selection)->getQty():'')
87
+
88
+ . ($includeContainer ? '<span class="price-notice">':'') . $pricesymbol
89
+ . ($showprice ? $this->formatPriceString($price, $includeContainer) : '')
90
+ . ($includeContainer ? '</span>':'');
91
+
92
+ return $rtrn;
93
+
94
+ } else {
95
+ return parent::getSelectionTitlePrice($_selection, false) ;
96
+ }
97
+
98
+ }
99
+
100
+
101
+
102
+
103
+ }
app/code/community/Rcg/Custombundle/Block/Catalog/Product/View/Type/Bundle/Select.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Bundle
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ /**
29
+ * Bundle option renderer
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Bundle
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Rcgear_Custombundle_Block_Catalog_Product_View_Type_Bundle_Select extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select
36
+
37
+ {
38
+
39
+
40
+ public function getSelectionQtyTitlePrice ($_selection, $includeContainer = true)
41
+ {
42
+ $price = $this->getProduct()->getPriceModel()->getSelectionPreFinalPrice($this->getProduct(), $_selection);
43
+ return $_selection->getSelectionQty()*1 . ' yyy ' . ' ' . $_selection->getName() .$_selection->getkoos() .' &nbsp; ' .
44
+ ($includeContainer ? '<span class="price-notice">':'') . '+' .
45
+ $this->formatPriceString($price, $includeContainer) . ($includeContainer ? '</span>':'');
46
+ }
47
+
48
+
49
+
50
+
51
+ }
app/code/community/Rcg/Custombundle/Helper/Data.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Bundle
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Bundle helper
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Bundle
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Rcg_Custombundle_Helper_Data extends Mage_Core_Helper_Abstract
35
+ {
36
+
37
+ }
app/code/community/Rcg/Custombundle/Model/Price.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Rcg_Custombundle_Model_Price extends Mage_Catalog_Model_Product_Type_Price
3
+ {
4
+ public function getFinalPrice($qty=null, $product)
5
+ {
6
+ return 50.00;
7
+ }
8
+ }
9
+
10
+ ?>
app/code/community/Rcg/Custombundle/etc/config.xml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Rcg_Custombundle>
5
+ <version>0.1.0</version>
6
+ </Rcg_Custombundle>
7
+ </modules>
8
+
9
+ <global>
10
+
11
+ <models>
12
+ <catalog>
13
+ <rewrite>
14
+ <product_type_pricew>Rcg_Custombundle_Model_Price</product_type_pricew>
15
+
16
+ </rewrite>
17
+ </catalog>
18
+ </models>
19
+ <!-- Mage_Catalog_Model_Product_Type_Price -->
20
+
21
+
22
+ <blocks>
23
+ <bundle>
24
+ <rewrite>
25
+ <!-- Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option -->
26
+ <catalog_product_view_type_bundle_option_select>Rcg_Custombundle_Block_Catalog_Product_View_Type_Bundle_Option</catalog_product_view_type_bundle_option_select>
27
+ </rewrite>
28
+
29
+
30
+ </bundle>
31
+
32
+ </blocks>
33
+
34
+
35
+ <helpers>
36
+ <custombundle>
37
+ <class>Rcg_Custombundle_Helper</class>
38
+ </custombundle>
39
+ </helpers>
40
+
41
+ </global>
42
+
43
+
44
+
45
+ <adminhtml>
46
+ <acl>
47
+ <resources>
48
+ <admin>
49
+ <children>
50
+ <system>
51
+ <children>
52
+ <config>
53
+ <children>
54
+ <RCG_options>
55
+ <title>RCG Bundle Options</title>
56
+ </RCG_options>
57
+ </children>
58
+ </config>
59
+ </children>
60
+ </system>
61
+ </children>
62
+ </admin>
63
+ </resources>
64
+ </acl>
65
+ </adminhtml>
66
+
67
+
68
+ </config>
69
+
70
+
app/code/community/Rcg/Custombundle/etc/system.xml ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Payments
17
+ * @package Rc Gear Netcash
18
+ * @copyright Copyright (c) 2008 W&C Information Consultants CC (http://www.wcic.co.za)
19
+ */
20
+ -->
21
+ <config>
22
+ <tabs>
23
+ <RCG translate="label" module="custombundle">
24
+ <label>RCG</label>
25
+ <sort_order>0000000</sort_order>
26
+ </RCG>
27
+ </tabs>
28
+
29
+ <sections>
30
+ <RCG_options translate="label" module="custombundle">
31
+ <label>Custom bundle</label>
32
+ <tab>RCG</tab>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>0000000</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ <groups>
39
+ <custombundle translate="label" module="custombundle">
40
+ <label>RcGear CustomBundle</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>1</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+
47
+
48
+ <fields>
49
+ <active translate="label">
50
+ <label>Enabled</label>
51
+ <frontend_type>select</frontend_type>
52
+ <source_model>adminhtml/system_config_source_yesno</source_model>
53
+ <sort_order>1</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>1</show_in_store>
57
+ </active>
58
+ <attrib1 translate="label">
59
+ <label>Attribute1</label>
60
+ <frontend_type>text</frontend_type>
61
+ <sort_order>10</sort_order>
62
+ <show_in_default>1</show_in_default>
63
+ <show_in_website>1</show_in_website>
64
+ <show_in_store>1</show_in_store>
65
+ </attrib1>
66
+ <attrib2 translate="label">
67
+ <label>Attribute2</label>
68
+ <frontend_type>text</frontend_type>
69
+ <sort_order>20</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ </attrib2>
74
+ <attrib3 translate="label">
75
+ <label>Attribute3</label>
76
+ <frontend_type>text</frontend_type>
77
+ <sort_order>30</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>1</show_in_store>
81
+ </attrib3>
82
+ <separator0 translate="label">
83
+ <label>Separator0</label>
84
+ <frontend_type>text</frontend_type>
85
+ <sort_order>39</sort_order>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>1</show_in_store>
89
+ </separator0>
90
+
91
+ <separator1 translate="label">
92
+ <label>Separator1</label>
93
+ <frontend_type>text</frontend_type>
94
+ <sort_order>40</sort_order>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ <show_in_store>1</show_in_store>
98
+ </separator1>
99
+ <separator2 translate="label">
100
+ <label>Separator2</label>
101
+ <frontend_type>text</frontend_type>
102
+ <sort_order>50</sort_order>
103
+ <show_in_default>1</show_in_default>
104
+ <show_in_website>1</show_in_website>
105
+ <show_in_store>1</show_in_store>
106
+ </separator2>
107
+ <separator3 translate="label">
108
+ <label>Separator3</label>
109
+ <frontend_type>text</frontend_type>
110
+ <sort_order>60</sort_order>
111
+ <show_in_default>1</show_in_default>
112
+ <show_in_website>1</show_in_website>
113
+ <show_in_store>1</show_in_store>
114
+ </separator3>
115
+ <pricesymbol>
116
+ <label>Price Symbol</label>
117
+ <frontend_type>text</frontend_type>
118
+ <sort_order>70</sort_order>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>1</show_in_website>
121
+ <show_in_store>1</show_in_store>
122
+ </pricesymbol>
123
+ <showstockqty translate="label">
124
+ <label>Show Stock Qty</label>
125
+ <frontend_type>select</frontend_type>
126
+ <source_model>adminhtml/system_config_source_yesno</source_model>
127
+ <sort_order>1</sort_order>
128
+ <show_in_default>1</show_in_default>
129
+ <show_in_website>1</show_in_website>
130
+ <show_in_store>1</show_in_store>
131
+ </showstockqty>
132
+ <showprice translate="label">
133
+ <label>Show Price</label>
134
+ <frontend_type>select</frontend_type>
135
+ <source_model>adminhtml/system_config_source_yesno</source_model>
136
+ <sort_order>1</sort_order>
137
+ <show_in_default>1</show_in_default>
138
+ <show_in_website>1</show_in_website>
139
+ <show_in_store>1</show_in_store>
140
+ </showprice>
141
+
142
+
143
+
144
+ </fields>
145
+ </custombundle>
146
+ </groups>
147
+ </RCG_options>
148
+ </sections>
149
+ </config>
app/etc/modules/Rcg_Custombundle.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Payments
17
+ * @package RcGear Netcash
18
+ * @copyright Copyright (c) 2008 W&C Information Consultants CC (http://www.wcic.co.za)
19
+ */
20
+ -->
21
+ <config>
22
+ <modules>
23
+ <Rcg_Custombundle>
24
+ <active>true</active>
25
+ <codePool>community</codePool>
26
+ </Rcg_Custombundle>
27
+ </modules>
28
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Rcg_Custombundle</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Show custom attribute in bundle products drop down menu</summary>
10
+ <description>Show custom attribute in bundle products drop down menu</description>
11
+ <notes>Added options to remove price and stock quantity.</notes>
12
+ <authors><author><name>admin</name><user>auto-converted</user><email>admin@rcgear.co.za</email></author></authors>
13
+ <date>2010-06-29</date>
14
+ <time>11:23:09</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Rcg_Custombundle.xml" hash="9a3656f736eb453d2c8007c6416e4755"/></dir></target><target name="magecommunity"><dir name="Rcg"><dir name="Custombundle"><dir name="Block"><dir name="Catalog"><dir name="Product"><dir name="View"><dir name="Type"><dir name="Bundle"><file name="Option.php" hash="ee99120d21b3ea54252a05a17b47b48c"/><file name="Select.php" hash="8a2a61da290ced56ecaffaa6dfc7ef1e"/></dir></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="c74f55f61c7f4101c5295e49e0a271bf"/><file name="system.xml" hash="d38e2c55678059b964214b3af0c5f56c"/></dir><dir name="Helper"><file name="Data.php" hash="814c86d10a31e59763da1383f2569538"/></dir><dir name="Model"><file name="Price.php" hash="baec5e2cb80448f0910ae17281899c76"/></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>