hkproductoption - Version 1.2.0.0

Version Notes

Latest version compatible

Download this release

Release Info

Developer Magento Core Team
Extension hkproductoption
Version 1.2.0.0
Comparing to
See all releases


Code changes from version 1.1.0.1 to 1.2.0.0

app/design/frontend/base/default/layout/customoption.xml CHANGED
@@ -10,22 +10,20 @@
10
  </reference>
11
  </customoption_index_index> -->
12
 
13
-
14
- <catalog_category_layered translate="label">
15
-
16
  <reference name="product_list">
17
  <action method="setTemplate">
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
 
10
  </reference>
11
  </customoption_index_index> -->
12
 
13
+ <catalog_category_default translate="label">
 
 
14
  <reference name="product_list">
15
  <action method="setTemplate">
16
  <template>customoption/index.phtml</template>
17
  </action>
18
  </reference>
19
+ </catalog_category_default>
20
+
21
+ <catalog_category_layered translate="label">
22
+ <reference name="product_list">
23
  <action method="setTemplate">
24
  <template>customoption/index.phtml</template>
25
  </action>
26
  </reference>
27
+ </catalog_category_layered>
28
  </layout>
29
 
app/design/frontend/base/default/template/customoption/index.phtml CHANGED
@@ -12,16 +12,16 @@
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,22 +35,21 @@
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,7 +65,7 @@
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>
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
+ <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;?>>
39
+ <div style='float: left; width: 100px;'>
40
+ <?php foreach($attVal as $optionKey => $optionVal)
41
+ {
42
+ $optStr.= "<select style='display:block; clear:both;' name='options[".$optionVal->getId()."]'>"; foreach($optionVal->getValues() as $valuesKey => $valuesVal)
43
+ {
44
+ $optStr.= "<option value='".$valuesVal->getId()."'>".$valuesVal->getTitle()."</option>";
45
+ }
46
+ $optStr.= "</select>";
47
+ }
48
+ echo($optStr );?>
 
49
 
50
+ <!--Replace "buttonImage.png" with any button image in your skin images -->
51
+ <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;">
52
+ </div>
53
  <?php else: ?>
54
  <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
55
  <?php endif; ?>
65
  <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
66
  <?php endif; ?>
67
  </ul>
68
+ </form>
69
  </div>
70
  </div>
71
  </li>
package.xml CHANGED
@@ -1,18 +1,18 @@
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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>hkproductoption</name>
4
+ <version>1.2.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>Latest version compatible</notes>
12
+ <authors><author><name>Hardik</name><user>auto-converted</user><email>hkpatel201@gmail.com</email></author></authors>
13
+ <date>2014-05-17</date>
14
+ <time>04:42:22</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="9b282dd02e6fc51f09f9552cc9ae6351"/></dir><dir name="template"><dir name="customoption"><file name="index.phtml" hash="1d06b6903a93b8cbec07e4671c53d9dd"/></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><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7</max></package></required></dependencies>
18
  </package>