hkproductoption - Version 1.1.0.1

Version Notes

Fixed problem in some magento version. Also fixed grid view and list view option not working problem.

Download this release

Release Info

Developer Hardik
Extension hkproductoption
Version 1.1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.1.0.1

app/code/{local → community}/HK/Customoption/Helper/Data.php RENAMED
File without changes
app/code/{local → community}/HK/Customoption/etc/config.xml RENAMED
File without changes
app/design/frontend/base/default/layout/customoption.xml CHANGED
@@ -18,8 +18,14 @@
18
  <template>customoption/index.phtml</template>
19
  </action>
20
  </reference>
21
-
22
-
23
- </catalog_category_layered>
 
 
 
 
 
 
24
  </layout>
25
 
18
  <template>customoption/index.phtml</template>
19
  </action>
20
  </reference>
21
+ </catalog_category_layered>
22
+
23
+ <catalog_category_default translate="label">
24
+ <reference name="product_list">
25
+ <action method="setTemplate">
26
+ <template>customoption/index.phtml</template>
27
+ </action>
28
+ </reference>
29
+ </catalog_category_default>
30
  </layout>
31
 
app/design/frontend/base/default/template/customoption/index.phtml CHANGED
@@ -12,6 +12,16 @@
12
  <?php $_iterator = 0; ?>
13
  <ol class="products-list" id="products-list">
14
  <?php foreach ($_productCollection as $_product): ?>
 
 
 
 
 
 
 
 
 
 
15
  <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
16
  <?php // Product Image ?>
17
  <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(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
@@ -25,7 +35,22 @@
25
  <?php endif; ?>
26
  <?php echo $this->getPriceHtml($_product, true) ?>
27
  <?php if($_product->isSaleable()): ?>
28
- <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  <?php else: ?>
30
  <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
31
  <?php endif; ?>
@@ -41,6 +66,7 @@
41
  <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
42
  <?php endif; ?>
43
  </ul>
 
44
  </div>
45
  </div>
46
  </li>
12
  <?php $_iterator = 0; ?>
13
  <ol class="products-list" id="products-list">
14
  <?php foreach ($_productCollection as $_product): ?>
15
+
16
+ <?php
17
+ $productSku = $_product->getSku();
18
+ $product = Mage::getModel('catalog/product');
19
+ $productId = $product->getIdBySku( $productSku );
20
+ $product = Mage::getModel("catalog/product")->load($productId);
21
+ $attVal = $product->getOptions();
22
+ $optStr = "";
23
+ ?>
24
+
25
  <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
26
  <?php // Product Image ?>
27
  <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(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
35
  <?php endif; ?>
36
  <?php echo $this->getPriceHtml($_product, true) ?>
37
  <?php if($_product->isSaleable()): ?>
38
+
39
+ <form action="<?php echo $this->helper('checkout/cart')->getAddUrl($_product)?>" method="post" id= "product_addtocart_form" <?php if($_product->getOptions()):?> enctype="multipart/form-data"<?php endif;?>>
40
+ <div style='float: left; width: 100px;'>
41
+ <?php foreach($attVal as $optionKey => $optionVal)
42
+ {
43
+ $optStr.= "<select style='display:block; clear:both;' name='options[".$optionVal->getId()."]'>"; foreach($optionVal->getValues() as $valuesKey => $valuesVal)
44
+ {
45
+ $optStr.= "<option value='".$valuesVal->getId()."'>".$valuesVal->getTitle()."</option>";
46
+ }
47
+ $optStr.= "</select>";
48
+ }
49
+ echo($optStr );?>
50
+
51
+ <!--Replace "buttonImage.png" with any button image in your skin images -->
52
+ <input type="image" value="Add to cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product)?>')" style="background: none repeat scroll 0px 0px rgb(241, 130, 0); border: 1px solid rgb(222, 84, 0); color: rgb(255, 255, 255); height: 19px; text-align: center; white-space: nowrap; width: 65px; font: bold 12px/19px Arial,Helvetica,sans-serif; padding: 1px 8px;">
53
+ </div>
54
  <?php else: ?>
55
  <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
56
  <?php endif; ?>
66
  <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
67
  <?php endif; ?>
68
  </ul>
69
+ </form>
70
  </div>
71
  </div>
72
  </li>
app/etc/modules/HK_Customoption.xml CHANGED
@@ -3,7 +3,7 @@
3
  <modules>
4
  <HK_Customoption>
5
  <active>true</active>
6
- <codePool>local</codePool>
7
  <version>0.1.0</version>
8
  </HK_Customoption>
9
  </modules>
3
  <modules>
4
  <HK_Customoption>
5
  <active>true</active>
6
+ <codePool>community</codePool>
7
  <version>0.1.0</version>
8
  </HK_Customoption>
9
  </modules>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>hkproductoption</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OLS v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Custom option on product list page.</summary>
10
- <description>Now you can display your product custom option on product list page. Also you can add your product direct from list page with selected custom option.</description>
11
- <notes>First realesed</notes>
12
- <authors><author><name>Hardik</name><user>khpatel201</user><email>hkpatel201@gmail.com</email></author></authors>
13
- <date>2014-05-12</date>
14
- <time>12:16:35</time>
15
- <contents><target name="magelocal"><dir name="HK"><dir name="Customoption"><dir name="Helper"><file name="Data.php" hash="cc3422ad60cb708471da7901b4484612"/></dir><dir name="etc"><file name="config.xml" hash="391a253a65ce75cc4fb3cc6c388bce36"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="customoption.xml" hash="fc53465e39a0632691ad8d5a4ab5cb47"/></dir><dir name="template"><dir name="customoption"><file name="index.phtml" hash="0857b1eee0a924b4eb1cef61f7fbd823"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="HK_Customoption.xml" hash="05f73078c797d3f7579809e63c77d329"/></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>hkproductoption</name>
4
+ <version>1.1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OLS v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Custom option on product list page</summary>
10
+ <description>Using this extension you can display your product custom option on product list page</description>
11
+ <notes>Fixed problem in some magento version. Also fixed grid view and list view option not working problem.</notes>
12
+ <authors><author><name>Hardik Patel</name><user>khpatel201</user><email>hkpatel201@gmail.com</email></author></authors>
13
+ <date>2014-05-16</date>
14
+ <time>15:14:49</time>
15
+ <contents><target name="magecommunity"><dir name="HK"><dir name="Customoption"><dir name="Helper"><file name="Data.php" hash="cc3422ad60cb708471da7901b4484612"/></dir><dir name="etc"><file name="config.xml" hash="391a253a65ce75cc4fb3cc6c388bce36"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="customoption.xml" hash="66ff876b8e6368a8d2b5ab0aa482fa64"/></dir><dir name="template"><dir name="customoption"><file name="index.phtml" hash="8708dc2be2a167f0340bec6b4557205c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="HK_Customoption.xml" hash="a0b44dbff7e1cfafde4e264c70af43d8"/></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>community</channel><min>1.6.0.0</min><max>1.7</max></package></required></dependencies>
18
  </package>