Jalak_Zeroprice - Version 1.1.0

Version Notes

1.0.0
- First Release

1.1.0
- Update for support Magento version 1.9.0.1
- Fix bug in product group
- Fix bug for dynamic theme (custom theme)

Download this release

Release Info

Developer I Gusti Agung Mahendra Putra
Extension Jalak_Zeroprice
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.0 to 1.1.0

app/code/community/Jalak/Zeroprice/Block/Rewrite/Catalog/Product/Price.php CHANGED
@@ -29,7 +29,8 @@ class Jalak_Zeroprice_Block_Rewrite_Catalog_Product_Price extends Mage_Catalog_B
29
  protected function _toHtml()
30
  {
31
  $helper = Mage::helper('jalak_zeroprice');
32
- if ($helper->isEnabled() && !($this->getProduct()->price > $helper->priceValue()))
 
33
  return '';
34
 
35
  return parent::_toHtml();
29
  protected function _toHtml()
30
  {
31
  $helper = Mage::helper('jalak_zeroprice');
32
+
33
+ if ($helper->isEnabled() && $this->getProduct()->price < $helper->priceValue())
34
  return '';
35
 
36
  return parent::_toHtml();
app/code/community/Jalak/Zeroprice/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <config>
4
  <modules>
5
  <Jalak_Zeroprice>
6
- <version>1.0.0</version>
7
  </Jalak_Zeroprice>
8
  </modules>
9
  <global>
@@ -23,14 +23,6 @@
23
  </catalog>
24
  </blocks>
25
  <resources>
26
- <!-- <jalak_zeroprice_setup>
27
- <setup>
28
- <module>Jalak_Zeroprice</module>
29
- </setup>
30
- <connection>
31
- <use>core_setup</use>
32
- </connection>
33
- </jalak_zeroprice_setup>-->
34
  <jalak_zeroprice_write>
35
  <connection>
36
  <use>core_write</use>
3
  <config>
4
  <modules>
5
  <Jalak_Zeroprice>
6
+ <version>1.1.0</version>
7
  </Jalak_Zeroprice>
8
  </modules>
9
  <global>
23
  </catalog>
24
  </blocks>
25
  <resources>
 
 
 
 
 
 
 
 
26
  <jalak_zeroprice_write>
27
  <connection>
28
  <use>core_write</use>
app/design/frontend/base/default/layout/jalak_zeroprice.xml CHANGED
@@ -1,5 +1,16 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <layout version="0.1.0">
 
 
 
 
 
 
 
 
 
 
 
3
  <catalog_product_view>
4
  <reference name="product.info.addtocart">
5
  <action method="setTemplate">
@@ -8,14 +19,6 @@
8
  </reference>
9
  </catalog_product_view>
10
 
11
- <review_product_list>
12
- <reference name="product.info.addtocart">
13
- <action method="setTemplate">
14
- <name>jalak_zeroprice/catalog/product/view/addtocart.phtml</name>
15
- </action>
16
- </reference>
17
- </review_product_list>
18
-
19
  <catalog_category_default>
20
  <reference name="product_list">
21
  <action method="setTemplate">
@@ -39,4 +42,20 @@
39
  </action>
40
  </reference>
41
  </catalogsearch_result_index>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  </layout>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <layout version="0.1.0">
3
+ <default>
4
+ <reference name="catalog_product_price_template">
5
+ <action method="addPriceBlockType"><type>simple</type><block>catalog/product_price</block><template>jalak_zeroprice/catalog/product/price.phtml</template></action>
6
+ <action method="addPriceBlockType"><type>grouped</type><block>catalog/product_price</block><template>jalak_zeroprice/catalog/product/price.phtml</template></action>
7
+ <action method="addPriceBlockType"><type>configurable</type><block>catalog/product_price</block><template>jalak_zeroprice/catalog/product/price.phtml</template></action>
8
+ <action method="addPriceBlockType"><type>virtual</type><block>catalog/product_price</block><template>jalak_zeroprice/catalog/product/price.phtml</template></action>
9
+ <action method="addPriceBlockType"><type>bundled</type><block>catalog/product_price</block><template>jalak_zeroprice/catalog/product/price.phtml</template></action>
10
+ <!-- duplicate for each product type you need to handle i.e. change the value of the <type> node" -->
11
+ </reference>
12
+ </default>
13
+
14
  <catalog_product_view>
15
  <reference name="product.info.addtocart">
16
  <action method="setTemplate">
19
  </reference>
20
  </catalog_product_view>
21
 
 
 
 
 
 
 
 
 
22
  <catalog_category_default>
23
  <reference name="product_list">
24
  <action method="setTemplate">
42
  </action>
43
  </reference>
44
  </catalogsearch_result_index>
45
+
46
+ <review_product_list>
47
+ <reference name="product.info.addtocart">
48
+ <action method="setTemplate">
49
+ <name>jalak_zeroprice/catalog/product/view/addtocart.phtml</name>
50
+ </action>
51
+ </reference>
52
+ </review_product_list>
53
+
54
+ <PRODUCT_TYPE_grouped>
55
+ <reference name="product.info.grouped">
56
+ <action method="setTemplate">
57
+ <template>jalak_zeroprice/catalog/product/view/type/grouped.phtml</template>
58
+ </action>
59
+ </reference>
60
+ </PRODUCT_TYPE_grouped>
61
  </layout>
app/design/frontend/base/default/template/jalak_zeroprice/catalog/product/price.phtml ADDED
@@ -0,0 +1,421 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Jalak
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
+ *
12
+ * @category Jalak
13
+ * @package Jalak_Zeroprice
14
+ * @author Hendrathings <hendrathings@gmail.com>
15
+ */
16
+ ?>
17
+ <?php
18
+ /**
19
+ * Template for displaying product price in different places (products grid, product view page etc)
20
+ *
21
+ * @see Mage_Catalog_Block_Product_Abstract
22
+ */
23
+ ?>
24
+ <?php
25
+ $_coreHelper = $this->helper('core');
26
+ $_weeeHelper = $this->helper('weee');
27
+ $_taxHelper = $this->helper('tax');
28
+ /* @var $_coreHelper Mage_Core_Helper_Data */
29
+ /* @var $_weeeHelper Mage_Weee_Helper_Data */
30
+ /* @var $_taxHelper Mage_Tax_Helper_Data */
31
+
32
+ $_product = $this->getProduct();
33
+ $_storeId = $_product->getStoreId();
34
+ $_id = $_product->getId();
35
+ $_weeeSeparator = '';
36
+ $_simplePricesTax = ($_taxHelper->displayPriceIncludingTax() || $_taxHelper->displayBothPrices());
37
+ $_minimalPriceValue = $_product->getMinimalPrice();
38
+ $_minimalPrice = $_taxHelper->getPrice($_product, $_minimalPriceValue, $_simplePricesTax);
39
+ ?>
40
+
41
+ <?php if (!$_product->isGrouped()): ?>
42
+ <?php $_weeeTaxAmount = $_weeeHelper->getAmountForDisplay($_product); ?>
43
+ <?php if ($_weeeHelper->typeOfDisplay($_product, array(Mage_Weee_Model_Tax::DISPLAY_INCL_DESCR, Mage_Weee_Model_Tax::DISPLAY_EXCL_DESCR_INCL, 4))): ?>
44
+ <?php $_weeeTaxAmount = $_weeeHelper->getAmount($_product); ?>
45
+ <?php $_weeeTaxAttributes = $_weeeHelper->getProductWeeeAttributesForDisplay($_product); ?>
46
+ <?php endif; ?>
47
+ <?php $_weeeTaxAmountInclTaxes = $_weeeTaxAmount; ?>
48
+ <?php if ($_weeeHelper->isTaxable() && !$_taxHelper->priceIncludesTax($_storeId)): ?>
49
+ <?php $_attributes = $_weeeHelper->getProductWeeeAttributesForRenderer($_product, null, null, null, true); ?>
50
+ <?php $_weeeTaxAmountInclTaxes = $_weeeHelper->getAmountInclTaxes($_attributes); ?>
51
+ <?php endif; ?>
52
+
53
+ <div class="price-box">
54
+ <?php $_price = $_taxHelper->getPrice($_product, $_product->getPrice()) ?>
55
+ <?php $_regularPrice = $_taxHelper->getPrice($_product, $_product->getPrice(), $_simplePricesTax) ?>
56
+ <?php $_finalPrice = $_taxHelper->getPrice($_product, $_product->getFinalPrice()) ?>
57
+ <?php $_finalPriceInclTax = $_taxHelper->getPrice($_product, $_product->getFinalPrice(), true) ?>
58
+ <?php $_weeeDisplayType = $_weeeHelper->getPriceDisplayType(); ?>
59
+ <?php if ($_finalPrice >= $_price): ?>
60
+ <?php if ($_taxHelper->displayBothPrices()): ?>
61
+ <?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)): // including ?>
62
+ <span class="price-excluding-tax">
63
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
64
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
65
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, false) ?>
66
+ </span>
67
+ </span>
68
+ <span class="price-including-tax">
69
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
70
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
71
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
72
+ </span>
73
+ </span>
74
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?>
75
+ <span class="price-excluding-tax">
76
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
77
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
78
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, false) ?>
79
+ </span>
80
+ </span>
81
+ <span class="price-including-tax">
82
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
83
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
84
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
85
+ </span>
86
+ <span class="weee">(
87
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
88
+ <?php echo $_weeeSeparator; ?>
89
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
90
+ <?php $_weeeSeparator = ' + '; ?>
91
+ <?php endforeach; ?>
92
+ )</span>
93
+ </span>
94
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?>
95
+ <span class="price-excluding-tax">
96
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
97
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
98
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, false) ?>
99
+ </span>
100
+ </span>
101
+ <span class="price-including-tax">
102
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
103
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
104
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
105
+ </span>
106
+ <span class="weee">(
107
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
108
+ <?php echo $_weeeSeparator; ?>
109
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?>
110
+ <?php $_weeeSeparator = ' + '; ?>
111
+ <?php endforeach; ?>
112
+ )</span>
113
+ </span>
114
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?>
115
+ <span class="price-excluding-tax">
116
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
117
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
118
+ <?php echo $_coreHelper->currency($_price, true, false) ?>
119
+ </span>
120
+ </span>
121
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
122
+ <span class="weee">
123
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
124
+ </span>
125
+ <?php endforeach; ?>
126
+ <span class="price-including-tax">
127
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
128
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
129
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
130
+ </span>
131
+ </span>
132
+ <?php else: ?>
133
+ <span class="price-excluding-tax">
134
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
135
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
136
+ <?php if ($_finalPrice == $_price): ?>
137
+ <?php echo $_coreHelper->currency($_price, true, false) ?>
138
+ <?php else: ?>
139
+ <?php echo $_coreHelper->currency($_finalPrice, true, false) ?>
140
+ <?php endif; ?>
141
+ </span>
142
+ </span>
143
+ <span class="price-including-tax">
144
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
145
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
146
+ <?php echo $_coreHelper->currency($_finalPriceInclTax, true, false) ?>
147
+ </span>
148
+ </span>
149
+ <?php endif; ?>
150
+ <?php else: ?>
151
+ <?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)): // including ?>
152
+ <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
153
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, true) ?>
154
+ </span>
155
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?>
156
+ <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
157
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, true) ?>
158
+ </span>
159
+ <span class="weee">(
160
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
161
+ <?php echo $_weeeSeparator; ?>
162
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
163
+ <?php $_weeeSeparator = ' + '; ?>
164
+ <?php endforeach; ?>
165
+ )</span>
166
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?>
167
+ <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
168
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, true) ?>
169
+ </span>
170
+ <span class="weee">(
171
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
172
+ <?php echo $_weeeSeparator; ?>
173
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?>
174
+ <?php $_weeeSeparator = ' + '; ?>
175
+ <?php endforeach; ?>
176
+ )</span>
177
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?>
178
+ <span class="regular-price"><?php echo $_coreHelper->currency($_price, true, true) ?></span><br />
179
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
180
+ <span class="weee">
181
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
182
+ </span>
183
+ <?php endforeach; ?>
184
+ <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
185
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, true) ?>
186
+ </span>
187
+ <?php else: ?>
188
+ <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
189
+ <?php if ($_finalPrice == $_price): ?>
190
+ <?php echo $_coreHelper->currency($_price, true, true) ?>
191
+ <?php else: ?>
192
+ <?php echo $_coreHelper->currency($_finalPrice, true, true) ?>
193
+ <?php endif; ?>
194
+ </span>
195
+ <?php endif; ?>
196
+ <?php endif; ?>
197
+ <?php else: /* if ($_finalPrice == $_price): */ ?>
198
+ <?php $_originalWeeeTaxAmount = $_weeeHelper->getOriginalAmount($_product); ?>
199
+
200
+ <?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)): // including ?>
201
+ <p class="old-price">
202
+ <span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
203
+ <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
204
+ <?php echo $_coreHelper->currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>
205
+ </span>
206
+ </p>
207
+
208
+ <?php if ($_taxHelper->displayBothPrices()): ?>
209
+ <p class="special-price">
210
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
211
+ <span class="price-excluding-tax">
212
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
213
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
214
+ <?php echo $_coreHelper->currency($_finalPrice + $_weeeTaxAmount, true, false) ?>
215
+ </span>
216
+ </span>
217
+ <span class="price-including-tax">
218
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
219
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
220
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
221
+ </span>
222
+ </span>
223
+ </p>
224
+ <?php else: ?>
225
+ <p class="special-price">
226
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
227
+ <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
228
+ <?php echo $_coreHelper->currency($_finalPrice + $_weeeTaxAmountInclTaxes, true, false) ?>
229
+ </span>
230
+ </p>
231
+ <?php endif; ?>
232
+
233
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?>
234
+ <p class="old-price">
235
+ <span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
236
+ <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
237
+ <?php echo $_coreHelper->currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>
238
+ </span>
239
+ </p>
240
+
241
+ <p class="special-price">
242
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
243
+ <span class="price-excluding-tax">
244
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
245
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
246
+ <?php echo $_coreHelper->currency($_finalPrice + $_weeeTaxAmount, true, false) ?>
247
+ </span>
248
+ </span>
249
+ <span class="weee">(
250
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
251
+ <?php echo $_weeeSeparator; ?>
252
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
253
+ <?php $_weeeSeparator = ' + '; ?>
254
+ <?php endforeach; ?>
255
+ )</span>
256
+ <span class="price-including-tax">
257
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
258
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
259
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
260
+ </span>
261
+ </span>
262
+ </p>
263
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?>
264
+ <p class="old-price">
265
+ <span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
266
+ <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
267
+ <?php echo $_coreHelper->currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>
268
+ </span>
269
+ </p>
270
+
271
+ <p class="special-price">
272
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
273
+ <span class="price-excluding-tax">
274
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
275
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
276
+ <?php echo $_coreHelper->currency($_finalPrice + $_weeeTaxAmount, true, false) ?>
277
+ </span>
278
+ </span>
279
+ <span class="weee">(
280
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
281
+ <?php echo $_weeeSeparator; ?>
282
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?>
283
+ <?php $_weeeSeparator = ' + '; ?>
284
+ <?php endforeach; ?>
285
+ )</span>
286
+ <span class="price-including-tax">
287
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
288
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
289
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
290
+ </span>
291
+ </span>
292
+ </p>
293
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?>
294
+ <p class="old-price">
295
+ <span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
296
+ <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
297
+ <?php echo $_coreHelper->currency($_regularPrice, true, false) ?>
298
+ </span>
299
+ </p>
300
+
301
+ <p class="special-price">
302
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
303
+ <span class="price-excluding-tax">
304
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
305
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
306
+ <?php echo $_coreHelper->currency($_finalPrice, true, false) ?>
307
+ </span>
308
+ </span>
309
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
310
+ <span class="weee">
311
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
312
+ </span>
313
+ <?php endforeach; ?>
314
+ <span class="price-including-tax">
315
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
316
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
317
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
318
+ </span>
319
+ </span>
320
+ </p>
321
+ <?php else: // excl. ?>
322
+ <p class="old-price">
323
+ <span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
324
+ <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
325
+ <?php echo $_coreHelper->currency($_regularPrice, true, false) ?>
326
+ </span>
327
+ </p>
328
+
329
+ <?php if ($_taxHelper->displayBothPrices()): ?>
330
+ <p class="special-price">
331
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
332
+ <span class="price-excluding-tax">
333
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
334
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
335
+ <?php echo $_coreHelper->currency($_finalPrice, true, false) ?>
336
+ </span>
337
+ </span>
338
+ <span class="price-including-tax">
339
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
340
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
341
+ <?php echo $_coreHelper->currency($_finalPriceInclTax, true, false) ?>
342
+ </span>
343
+ </span>
344
+ </p>
345
+ <?php else: ?>
346
+ <p class="special-price">
347
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
348
+ <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
349
+ <?php echo $_coreHelper->currency($_finalPrice, true, false) ?>
350
+ </span>
351
+ </p>
352
+ <?php endif; ?>
353
+ <?php endif; ?>
354
+
355
+ <?php endif; /* if ($_finalPrice == $_price): */ ?>
356
+
357
+ <?php if ($this->getDisplayMinimalPrice() && $_minimalPriceValue && $_minimalPriceValue < $_product->getFinalPrice()): ?>
358
+
359
+ <?php $_minimalPriceDisplayValue = $_minimalPrice; ?>
360
+ <?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, array(0, 1, 4))): ?>
361
+ <?php $_minimalPriceDisplayValue = $_minimalPrice + $_weeeTaxAmount; ?>
362
+ <?php endif; ?>
363
+
364
+ <?php if ($this->getUseLinkForAsLowAs()): ?>
365
+ <a href="<?php echo $_product->getProductUrl(); ?>" class="minimal-price-link">
366
+ <?php else: ?>
367
+ <span class="minimal-price-link">
368
+ <?php endif ?>
369
+ <span class="label"><?php echo $this->__('As low as:') ?></span>
370
+ <span class="price" id="product-minimal-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
371
+ <?php echo $_coreHelper->currency($_minimalPriceDisplayValue, true, false) ?>
372
+ </span>
373
+ <?php if ($this->getUseLinkForAsLowAs()): ?>
374
+ </a>
375
+ <?php else: ?>
376
+ </span>
377
+ <?php endif ?>
378
+ <?php endif; /* if ($this->getDisplayMinimalPrice() && $_minimalPrice && $_minimalPrice < $_finalPrice): */ ?>
379
+ </div>
380
+
381
+ <?php else: /* if (!$_product->isGrouped()): */ ?>
382
+ <?php
383
+ $_exclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue);
384
+ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, true);
385
+ $_zeroPriceHelper = Mage::helper('jalak_zeroprice');
386
+ ?>
387
+ <?php if ($this->getDisplayMinimalPrice() && $_minimalPriceValue): ?>
388
+ <div class="price-box">
389
+ <?php if ($_minimalPriceValue > $_zeroPriceHelper->priceValue()): ?>
390
+ <p class="minimal-price">
391
+ <span class="price-label"><?php echo $this->__('Starting at:') ?></span>
392
+ <?php if ($_taxHelper->displayBothPrices()): ?>
393
+ <span class="price-excluding-tax">
394
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
395
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
396
+ <?php echo $_coreHelper->currency($_exclTax, true, false) ?>
397
+ </span>
398
+ </span>
399
+ <span class="price-including-tax">
400
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
401
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
402
+ <?php echo $_coreHelper->currency($_inclTax, true, false) ?>
403
+ </span>
404
+ </span>
405
+ <?php else: ?>
406
+ <?php
407
+ $_showPrice = $_inclTax;
408
+ if (!$_taxHelper->displayPriceIncludingTax())
409
+ {
410
+ $_showPrice = $_exclTax;
411
+ }
412
+ ?>
413
+ <span class="price" id="product-minimal-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
414
+ <?php echo $_coreHelper->currency($_showPrice, true, false) ?>
415
+ </span>
416
+ <?php endif; ?>
417
+ </p>
418
+ <?php endif; ?>
419
+ </div>
420
+ <?php endif; /* if ($this->getDisplayMinimalPrice() && $_minimalPrice): */ ?>
421
+ <?php endif; /* if (!$_product->isGrouped()): */ ?>
app/design/frontend/base/default/template/jalak_zeroprice/catalog/product/view/addtocart.phtml CHANGED
@@ -36,7 +36,7 @@ $_zeroPriceHelper = Mage::helper('jalak_zeroprice');
36
  <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
37
  <?php endif; ?>
38
  <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
39
- <?php echo $this->getChildHtml('', true, true) ?>
40
  </div>
41
  <?php endif; ?>
42
  <?php endif; ?>
36
  <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
37
  <?php endif; ?>
38
  <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
39
+ <?php echo $this->getChildHtml('', true, true) ?>
40
  </div>
41
  <?php endif; ?>
42
  <?php endif; ?>
app/design/frontend/base/default/template/jalak_zeroprice/catalog/product/view/type/grouped.phtml ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-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 design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ /**
27
+ * Grouped product data template
28
+ *
29
+ * @see Mage_Catalog_Block_Product_View_Media
30
+ * @see Mage_Catalog_Block_Product_View_Type_Grouped
31
+ */
32
+ ?>
33
+ <?php $_zeroPriceHelper = Mage::helper('jalak_zeroprice'); ?>
34
+ <?php $this->setPreconfiguredValue(); ?>
35
+ <?php $_product = $this->getProduct(); ?>
36
+ <?php $_associatedProducts = $this->getAssociatedProducts(); ?>
37
+ <?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
38
+ <?php if ($_product->isAvailable() && $_hasAssociatedProducts): ?>
39
+ <p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
40
+ <?php else: ?>
41
+ <p class="availability out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>
42
+ <?php endif; ?>
43
+ <?php echo $this->getChildHtml('product_type_data_extra') ?>
44
+ <table class="data-table grouped-items-table" id="super-product-table">
45
+ <col />
46
+ <col />
47
+ <col width="1" />
48
+ <thead>
49
+ <tr>
50
+ <th><?php echo $this->__('Product Name') ?></th>
51
+ <?php if ($this->getCanShowProductPrice($_product)): ?>
52
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
53
+ <?php endif; ?>
54
+ <?php if ($_product->isSaleable()): ?>
55
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
56
+ <?php endif; ?>
57
+ </tr>
58
+ </thead>
59
+ <tbody>
60
+ <?php if ($_hasAssociatedProducts): ?>
61
+ <?php foreach ($_associatedProducts as $_item): ?>
62
+ <?php $_finalPriceInclTax = $this->helper('tax')->getPrice($_item, $_item->getFinalPrice(), true) ?>
63
+ <tr>
64
+ <td><?php echo $this->htmlEscape($_item->getName()) ?></td>
65
+ <?php if ($this->getCanShowProductPrice($_product)): ?>
66
+ <td class="a-right">
67
+ <?php if ($this->getCanShowProductPrice($_item)): ?>
68
+ <?php echo $this->getPriceHtml($_item, true) ?>
69
+ <?php echo $this->getTierPriceHtml($_item) ?>
70
+ <?php endif; ?>
71
+ </td>
72
+ <?php endif; ?>
73
+ <?php if ($_product->isSaleable()): ?>
74
+ <td class="a-center">
75
+ <?php if ($_item->isSaleable()) : ?>
76
+ <?php if ($_item->price > $_zeroPriceHelper->priceValue()): ?>
77
+ <input type="text" name="super_group[<?php echo $_item->getId() ?>]" maxlength="12" value="<?php echo $_item->getQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
78
+ <?php endif; ?>
79
+ <?php else: ?>
80
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
81
+ <?php endif; ?>
82
+ </td>
83
+ <?php endif; ?>
84
+ </tr>
85
+ <?php endforeach; ?>
86
+ <?php else: ?>
87
+ <tr>
88
+ <td colspan="<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>"><?php echo $this->__('No options of this product are available.') ?></td>
89
+ </tr>
90
+ <?php endif; ?>
91
+ </tbody>
92
+ </table>
93
+ <script type="text/javascript">decorateTable('super-product-table')</script>
package.xml CHANGED
@@ -1,18 +1,24 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Jalak_Zeroprice</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Hide price product and add to cart button with condition price value.</summary>
10
  <description>Hide price product and add to cart button with condition price value.</description>
11
- <notes>1.0.0 First Release</notes>
 
 
 
 
 
 
12
  <authors><author><name>I Gusti Agung Mahendra Putra</name><user>hendrathings</user><email>hendrathings@gmail.com</email></author></authors>
13
- <date>2014-04-25</date>
14
- <time>08:26:45</time>
15
- <contents><target name="magecommunity"><dir name="Jalak"><dir name="Zeroprice"><dir name="Block"><dir name="Rewrite"><dir name="Catalog"><dir name="Product"><file name="Price.php" hash="7d069d6c940c648aebc2e72256a47d95"/></dir></dir></dir></dir><file name="Exception.php" hash="fd6361fe33f604679d24fefeabb52d44"/><dir name="Helper"><file name="Data.php" hash="0c155c0e4c3bf45dc5bac6d2082548df"/></dir><dir name="etc"><file name="adminhtml.xml" hash="54bd1269e41f914cf8536fe54c5eec9d"/><file name="config.xml" hash="a40772b0261631d9294fecc62454f395"/><file name="system.xml" hash="ad0cf62b02eacbe06fdc690e179d0573"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="jalak_zeroprice.xml" hash="dc543646b7dba81031fce0f034031188"/></dir><dir name="template"><dir name="jalak_zeroprice"><dir name="catalog"><dir name="product"><file name="list.phtml" hash="c3c0b133f2a8d294798de5b166e1b067"/><dir name="view"><file name="addtocart.phtml" hash="f968d55e75894f650a195c1665ddb72e"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Jalak_Zeroprice.xml" hash="65ac2e77d3938c0cff55cf1c8cfe9370"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>comunity</channel><min>1.5.0.0</min><max>1.8.0.0</max></package></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Jalak_Zeroprice</name>
4
+ <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Hide price product and add to cart button with condition price value.</summary>
10
  <description>Hide price product and add to cart button with condition price value.</description>
11
+ <notes>1.0.0&#xD;
12
+ - First Release&#xD;
13
+ &#xD;
14
+ 1.1.0&#xD;
15
+ - Update for support Magento version 1.9.0.1&#xD;
16
+ - Fix bug in product group&#xD;
17
+ - Fix bug for dynamic theme (custom theme)</notes>
18
  <authors><author><name>I Gusti Agung Mahendra Putra</name><user>hendrathings</user><email>hendrathings@gmail.com</email></author></authors>
19
+ <date>2014-08-01</date>
20
+ <time>17:35:39</time>
21
+ <contents><target name="magecommunity"><dir name="Jalak"><dir name="Zeroprice"><dir name="Block"><dir name="Rewrite"><dir name="Catalog"><dir name="Product"><file name="Price.php" hash="1649d641b071baee23f92b264c511cff"/></dir></dir></dir></dir><file name="Exception.php" hash="fd6361fe33f604679d24fefeabb52d44"/><dir name="Helper"><file name="Data.php" hash="0c155c0e4c3bf45dc5bac6d2082548df"/></dir><dir name="etc"><file name="adminhtml.xml" hash="54bd1269e41f914cf8536fe54c5eec9d"/><file name="config.xml" hash="6dca987541c5fc8e60746ffc404e68dd"/><file name="system.xml" hash="ad0cf62b02eacbe06fdc690e179d0573"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="jalak_zeroprice.xml" hash="ba2e5e658669ed8273cfaf036598c88e"/></dir><dir name="template"><dir name="jalak_zeroprice"><dir name="catalog"><dir name="product"><file name="list.phtml" hash="c3c0b133f2a8d294798de5b166e1b067"/><file name="price.phtml" hash="c161ac94f0cfbc8c7c2dfbdffc19bf0e"/><dir name="view"><file name="addtocart.phtml" hash="2f18367d7d0f38b46924c2d825854d81"/><dir name="type"><file name="grouped.phtml" hash="65499b8cbd8e45041f361761ce09cb14"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Jalak_Zeroprice.xml" hash="65ac2e77d3938c0cff55cf1c8cfe9370"/></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>comunity</channel><min>1.5.0.0</min><max>1.8.0.0</max></package></required></dependencies>
24
  </package>