Custom_Price - Version 1.0.2

Version Notes

release new version

Download this release

Release Info

Developer Abhay
Extension Custom_Price
Version 1.0.2
Comparing to
See all releases


Code changes from version 1.0.1 to 1.0.2

app/code/local/Custom/Price/Block/Price.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Custom_Price_Block_Price extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getPrice()
10
+ {
11
+ if (!$this->hasData('price')) {
12
+ $this->setData('price', Mage::registry('price'));
13
+ }
14
+ return $this->getData('price');
15
+
16
+ }
17
+ }
app/code/local/Custom/Price/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Custom_Price_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Custom/Price/Model/Mysql4/Price.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Custom_Price_Model_Mysql4_Price extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the price_id refers to the key field in your database table.
8
+ $this->_init('price/price', 'price_id');
9
+ }
10
+ }
app/code/local/Custom/Price/Model/Mysql4/Price/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Custom_Price_Model_Mysql4_Price_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('price/price');
9
+ }
10
+ }
app/code/local/Custom/Price/Model/Observer.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Custom_Price_Model_Observer
3
+ {
4
+ public function modifyPrice(Varien_Event_Observer $obs)
5
+ {
6
+ // Get the quote item
7
+ $item = $obs->getQuoteItem();
8
+ // Ensure we have the parent item, if it has one
9
+ // $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
10
+ // Load the custom price
11
+ // $_item = $obs->getItem();
12
+ $_product= Mage::getSingleton('catalog/product')->load($item->getProductId());
13
+ $weight= $_product->getResource()->getAttribute('weight')->getFrontend()->getValue($_product);
14
+ //$reg = $_product->getResource()->getAttribute('price')->getFrontend()->getValue($_product);
15
+ $golden_price = Mage::getStoreConfig('mysection/mygroup/myfield');
16
+ $demo = $weight*$golden_price;
17
+ $price = $demo;
18
+ // Set the custom price
19
+ $item->setCustomPrice($price);
20
+ $item->setOriginalCustomPrice($price);
21
+ // Enable super mode on the product.
22
+ $item->getProduct()->setIsSuperMode(true);
23
+ }
24
+
25
+
26
+ }
27
+ ?>
app/code/local/Custom/Price/Model/Price.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Custom_Price_Model_Price extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('price/price');
9
+ }
10
+ }
app/code/local/Custom/Price/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Custom_Price_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('price')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('price')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/local/Custom/Price/controllers/IndexController.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Custom_Price_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }
9
+
10
+ public function cartAction()
11
+ {
12
+ $this->loadLayout();
13
+ $this->renderLayout();
14
+ }
15
+ }
app/code/local/Custom/Price/etc/config.xml ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <mysection>
4
+ <mygroup>
5
+ <myfield>My Default Value</myfield>
6
+ </mygroup>
7
+ </mysection>
8
+ <modules>
9
+ <Custom_Price>
10
+ <version>0.1.0</version>
11
+ </Custom_Price>
12
+ </modules>
13
+ <frontend>
14
+ <routers>
15
+ <price>
16
+ <use>standard</use>
17
+ <args>
18
+ <module>Custom_Price</module>
19
+ <frontName>price</frontName>
20
+ </args>
21
+ </price>
22
+ </routers>
23
+ <events>
24
+ <checkout_cart_product_add_after>
25
+ <observers>
26
+ <unique_event_name>
27
+ <class>price/observer</class>
28
+ <method>modifyPrice</method>
29
+ </unique_event_name>
30
+ </observers>
31
+ </checkout_cart_product_add_after>
32
+ </events>
33
+ <layout>
34
+ <updates>
35
+ <price>
36
+ <file>price.xml</file>
37
+ </price>
38
+ </updates>
39
+ </layout>
40
+ </frontend>
41
+ <admin>
42
+ <routers>
43
+ <price>
44
+ <use>admin</use>
45
+ <args>
46
+ <module>Custom_Price</module>
47
+ <frontName>price</frontName>
48
+ </args>
49
+ </price>
50
+ </routers>
51
+ </admin>
52
+ <adminhtml>
53
+
54
+ <acl>
55
+ <resources>
56
+ <admin> <!--This is acl based on URL. If you see URL it would be /admin/system_config/ -->
57
+ <children>
58
+ <system>
59
+ <children>
60
+ <config>
61
+ <children>
62
+ <mysection translate="title" module="price"> <!-- This is name of the section created by us -->
63
+ <title>my Section ACL</title> <!-- Title as shown in User->Roles->Permissions Window -->
64
+ <sort_order>99</sort_order>
65
+ </mysection>
66
+ </children>
67
+ </config>
68
+ </children>
69
+ </system>
70
+ </children>
71
+ </admin>
72
+ </resources>
73
+ </acl>
74
+ - See more at: http://www.excellencemagentoblog.com/magento-part8-series-systemxml#sthash.kWfAp3BK.dpuf
75
+ <layout>
76
+ <updates>
77
+ <price>
78
+ <file>price.xml</file>
79
+ </price>
80
+ </updates>
81
+ </layout>
82
+ </adminhtml>
83
+ <global>
84
+ <models>
85
+ <price>
86
+ <class>Custom_Price_Model</class>
87
+ <resourceModel>price_mysql4</resourceModel>
88
+ </price>
89
+ <price_mysql4>
90
+ <class>Custom_Price_Model_Mysql4</class>
91
+ <entities>
92
+ <price>
93
+ <table>price</table>
94
+ </price>
95
+ </entities>
96
+ </price_mysql4>
97
+ </models>
98
+ <resources>
99
+ <price_setup>
100
+ <setup>
101
+ <module>Custom_Price</module>
102
+ </setup>
103
+ <connection>
104
+ <use>core_setup</use>
105
+ </connection>
106
+ </price_setup>
107
+ <price_write>
108
+ <connection>
109
+ <use>core_write</use>
110
+ </connection>
111
+ </price_write>
112
+ <price_read>
113
+ <connection>
114
+ <use>core_read</use>
115
+ </connection>
116
+ </price_read>
117
+ </resources>
118
+ <blocks>
119
+ <price>
120
+ <class>Custom_Price_Block</class>
121
+ </price>
122
+ </blocks>
123
+ <helpers>
124
+ <price>
125
+ <class>Custom_Price_Helper</class>
126
+ </price>
127
+ </helpers>
128
+ </global>
129
+ </config>
app/code/local/Custom/Price/etc/system.xml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections>
4
+ <mysection translate="label" module="price">
5
+ <label>Goldern Price</label>
6
+ <tab>catalog</tab>
7
+ <frontend_type>text</frontend_type>
8
+ <sort_order>110</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>1</show_in_store>
12
+ <groups>
13
+ <mygroup translate="label" module="price">
14
+ <label>Golden Price Value</label>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>99</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <fields>
21
+ <myfield translate="label comment">
22
+ <label>Enter Price</label>
23
+ <frontend_type>text</frontend_type>
24
+ <sort_order>1</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ </myfield>
29
+ </fields>
30
+ </mygroup>
31
+ </groups>
32
+ </mysection>
33
+ </sections>
34
+ </config>
app/code/local/Custom/Price/sql/price_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {$this->getTable('price')};
10
+ CREATE TABLE {$this->getTable('price')} (
11
+ `price_id` int(11) unsigned NOT NULL auto_increment,
12
+ `title` varchar(255) NOT NULL default '',
13
+ `filename` varchar(255) NOT NULL default '',
14
+ `content` text NOT NULL default '',
15
+ `status` smallint(6) NOT NULL default '0',
16
+ `created_time` datetime NULL,
17
+ `update_time` datetime NULL,
18
+ PRIMARY KEY (`price_id`)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
+
21
+ ");
22
+
23
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/price.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <price_adminhtml_price_index>
4
+ <reference name="content">
5
+ <block type="price/adminhtml_price" name="price" />
6
+ </reference>
7
+ </price_adminhtml_price_index>
8
+ </layout>
app/design/frontend/default/default/layout/custom.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <custom_index_index>
6
+ <reference name="content">
7
+ <block type="custom/custom" name="custom" template="custom/custom.phtml" />
8
+ </reference>
9
+ </custom_index_index>
10
+ </layout>
app/design/frontend/default/default/template/catalog/product/list.phtml ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <?php
28
+ /**
29
+ * Product list template
30
+ *
31
+ * @see Mage_Catalog_Block_Product_List
32
+ */
33
+ ?>
34
+ <?php
35
+ $_productCollection=$this->getLoadedProductCollection();
36
+ $_helper = $this->helper('catalog/output');
37
+ ?>
38
+ <?php if(!$_productCollection->count()): ?>
39
+ <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
40
+ <?php else: ?>
41
+ <div class="category-products">
42
+ <?php echo $this->getToolbarHtml() ?>
43
+ <?php // List mode ?>
44
+ <?php if($this->getMode()!='grid'): ?>
45
+ <?php $_iterator = 0; ?>
46
+ <ol class="products-list" id="products-list">
47
+ <?php foreach ($_productCollection as $_product): ?>
48
+ <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
49
+ <?php // Product Image ?>
50
+ <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>
51
+ <?php // Product description ?>
52
+ <div class="product-shop">
53
+ <div class="f-fix">
54
+ <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
55
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
56
+ <?php if($_product->getRatingSummary()): ?>
57
+ <?php echo $this->getReviewsSummaryHtml($_product) ?>
58
+ <?php endif; ?>
59
+ <?php //echo $this->getPriceHtml($_product, true) ?>
60
+ <?php $weight = $_product->getResource()->getAttribute('weight')->getFrontend()->getValue($_product);
61
+ $golden_price = Mage::getStoreConfig('mysection/mygroup/myfield');
62
+ $demo = $weight*$golden_price;
63
+ echo $demo;
64
+ ?>
65
+ <?php if($_product->isSaleable()): ?>
66
+ <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>
67
+ <?php else: ?>
68
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
69
+ <?php endif; ?>
70
+ <div class="desc std">
71
+ <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
72
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
73
+ </div>
74
+ <ul class="add-to-links">
75
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
76
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
77
+ <?php endif; ?>
78
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
79
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
80
+ <?php endif; ?>
81
+ </ul>
82
+ </div>
83
+ </div>
84
+ </li>
85
+ <?php endforeach; ?>
86
+ </ol>
87
+ <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
88
+
89
+ <?php else: ?>
90
+
91
+ <?php // Grid Mode ?>
92
+
93
+ <?php $_collectionSize = $_productCollection->count() ?>
94
+ <?php $_columnCount = $this->getColumnCount(); ?>
95
+ <?php $i=0; foreach ($_productCollection as $_product): ?>
96
+ <?php if ($i++%$_columnCount==0): ?>
97
+ <ul class="products-grid">
98
+ <?php endif ?>
99
+ <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
100
+ <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>
101
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
102
+ <?php if($_product->getRatingSummary()): ?>
103
+ <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
104
+ <?php endif; ?>
105
+ <?php $weight = $_product->getResource()->getAttribute('weight')->getFrontend()->getValue($_product);
106
+ $golden_price = Mage::getStoreConfig('mysection/mygroup/myfield');
107
+ $demo = $weight*$golden_price;
108
+ echo $demo;
109
+ ?>
110
+
111
+
112
+
113
+ <div class="actions">
114
+ <?php if($_product->isSaleable()): ?>
115
+ <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>
116
+ <?php else: ?>
117
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
118
+ <?php endif; ?>
119
+ <ul class="add-to-links">
120
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
121
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
122
+ <?php endif; ?>
123
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
124
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
125
+ <?php endif; ?>
126
+ </ul>
127
+ </div>
128
+ </li>
129
+ <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
130
+ </ul>
131
+ <?php endif ?>
132
+ <?php endforeach ?>
133
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
134
+ <?php endif; ?>
135
+
136
+ <div class="toolbar-bottom">
137
+ <?php echo $this->getToolbarHtml() ?>
138
+ </div>
139
+ </div>
140
+ <?php endif; ?>
app/design/frontend/default/default/template/catalog/product/price.phtml ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
28
+ <?php
29
+ /**
30
+ * Template for displaying product price in different places (products grid, product view page etc)
31
+ *
32
+ * @see Mage_Catalog_Block_Product_Abstract
33
+ */
34
+ ?>
35
+ <?php
36
+ $_coreHelper = $this->helper('core');
37
+ $_weeeHelper = $this->helper('weee');
38
+ $_taxHelper = $this->helper('tax');
39
+ /* @var $_coreHelper Mage_Core_Helper_Data */
40
+ /* @var $_weeeHelper Mage_Weee_Helper_Data */
41
+ /* @var $_taxHelper Mage_Tax_Helper_Data */
42
+
43
+ $_product = $this->getProduct();
44
+ $_storeId = $_product->getStoreId();
45
+ $_id = $_product->getId();
46
+ $_weeeSeparator = '';
47
+ $weight= $_product->getResource()->getAttribute('weight')->getFrontend()->getValue($_product);
48
+ $golden_price = Mage::getStoreConfig('mysection/mygroup/myfield');
49
+ $_simplePricesTax = ($_taxHelper->displayPriceIncludingTax() || $_taxHelper->displayBothPrices());
50
+ $_minimalPriceValue1 = $_product->getMinimalPrice();
51
+ $_minimalPriceValue = $weight*$golden_price;
52
+ $_minimalPrice1 = $_taxHelper->getPrice($_product, $_minimalPriceValue, $_simplePricesTax);
53
+ $_minimalPrice = $weight*$golden_price;
54
+ ?>
55
+
56
+ <?php if (!$_product->isGrouped()): ?>
57
+ <?php $_weeeTaxAmount = $_weeeHelper->getAmountForDisplay($_product); ?>
58
+ <?php if ($_weeeHelper->typeOfDisplay($_product, array(Mage_Weee_Model_Tax::DISPLAY_INCL_DESCR, Mage_Weee_Model_Tax::DISPLAY_EXCL_DESCR_INCL, 4))): ?>
59
+ <?php $_weeeTaxAmount = $_weeeHelper->getAmount($_product); ?>
60
+ <?php $_weeeTaxAttributes = $_weeeHelper->getProductWeeeAttributesForDisplay($_product); ?>
61
+ <?php endif; ?>
62
+ <?php $_weeeTaxAmountInclTaxes = $_weeeTaxAmount; ?>
63
+ <?php if ($_weeeHelper->isTaxable() && !$_taxHelper->priceIncludesTax($_storeId)): ?>
64
+ <?php $_attributes = $_weeeHelper->getProductWeeeAttributesForRenderer($_product, null, null, null, true); ?>
65
+ <?php $_weeeTaxAmountInclTaxes = $_weeeHelper->getAmountInclTaxes($_attributes); ?>
66
+ <?php endif; ?>
67
+
68
+ <div class="price-box">
69
+ <?php $_price1 = $_taxHelper->getPrice($_product, $_product->getPrice());
70
+
71
+ $_price= $weight*$golden_price;
72
+ ?>
73
+
74
+
75
+ <?php $_regularPrice1 = $_taxHelper->getPrice($_product, $_product->getPrice(), $_simplePricesTax);
76
+ $_regularPrice = $weight*$golden_price;
77
+
78
+ ?>
79
+ <?php $_finalPrice1 = $_taxHelper->getPrice($_product, $_product->getFinalPrice());
80
+ $_finalPrice = $weight*$golden_price;
81
+
82
+ ?>
83
+ <?php $_finalPriceInclTax1 = $_taxHelper->getPrice($_product, $_product->getFinalPrice(), true);
84
+ $_finalPriceInclTax =$weight*$golden_price;
85
+ ?>
86
+ <?php $_weeeDisplayType = $_weeeHelper->getPriceDisplayType(); ?>
87
+ <?php if ($_finalPrice >= $_price): ?>
88
+ <?php if ($_taxHelper->displayBothPrices()): ?>
89
+ <?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)): // including ?>
90
+ <span class="price-excluding-tax">
91
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
92
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
93
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, false) ?>
94
+ </span>
95
+ </span>
96
+ <span class="price-including-tax">
97
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
98
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
99
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
100
+ </span>
101
+ </span>
102
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?>
103
+ <span class="price-excluding-tax">
104
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
105
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
106
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, false) ?>
107
+ </span>
108
+ </span>
109
+ <span class="price-including-tax">
110
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
111
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
112
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
113
+ </span>
114
+ <span class="weee">(
115
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
116
+ <?php echo $_weeeSeparator; ?>
117
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
118
+ <?php $_weeeSeparator = ' + '; ?>
119
+ <?php endforeach; ?>
120
+ )</span>
121
+ </span>
122
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?>
123
+ <span class="price-excluding-tax">
124
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
125
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
126
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, false) ?>
127
+ </span>
128
+ </span>
129
+ <span class="price-including-tax">
130
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
131
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
132
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
133
+ </span>
134
+ <span class="weee">(
135
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
136
+ <?php echo $_weeeSeparator; ?>
137
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?>
138
+ <?php $_weeeSeparator = ' + '; ?>
139
+ <?php endforeach; ?>
140
+ )</span>
141
+ </span>
142
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?>
143
+ <span class="price-excluding-tax">
144
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
145
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
146
+ <?php echo $_coreHelper->currency($_price, true, false) ?>
147
+ </span>
148
+ </span>
149
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
150
+ <span class="weee">
151
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
152
+ </span>
153
+ <?php endforeach; ?>
154
+ <span class="price-including-tax">
155
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
156
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
157
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
158
+ </span>
159
+ </span>
160
+ <?php else: ?>
161
+ <span class="price-excluding-tax">
162
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
163
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
164
+ <?php if ($_finalPrice == $_price): ?>
165
+ <?php echo $_coreHelper->currency($_price, true, false) ?>
166
+ <?php else: ?>
167
+ <?php echo $_coreHelper->currency($_finalPrice, true, false) ?>
168
+ <?php endif; ?>
169
+ </span>
170
+ </span>
171
+ <span class="price-including-tax">
172
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
173
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
174
+ <?php echo $_coreHelper->currency($_finalPriceInclTax, true, false) ?>
175
+ </span>
176
+ </span>
177
+ <?php endif; ?>
178
+ <?php else: ?>
179
+ <?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)): // including ?>
180
+ <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
181
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, true) ?>
182
+ </span>
183
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?>
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
+ <span class="weee">(
188
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
189
+ <?php echo $_weeeSeparator; ?>
190
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
191
+ <?php $_weeeSeparator = ' + '; ?>
192
+ <?php endforeach; ?>
193
+ )</span>
194
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?>
195
+ <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
196
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, true) ?>
197
+ </span>
198
+ <span class="weee">(
199
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
200
+ <?php echo $_weeeSeparator; ?>
201
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?>
202
+ <?php $_weeeSeparator = ' + '; ?>
203
+ <?php endforeach; ?>
204
+ )</span>
205
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?>
206
+ <span class="regular-price"><?php echo $_coreHelper->currency($_price,true,true) ?></span><br />
207
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
208
+ <span class="weee">
209
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
210
+ </span>
211
+ <?php endforeach; ?>
212
+ <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
213
+ <?php echo $_coreHelper->currency($_price + $_weeeTaxAmount, true, true) ?>
214
+ </span>
215
+ <?php else: ?>
216
+ <span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
217
+ <?php if ($_finalPrice == $_price): ?>
218
+ <?php echo $_coreHelper->currency($_price, true, true) ?>
219
+ <?php else: ?>
220
+ <?php echo $_coreHelper->currency($_finalPrice, true, true) ?>
221
+ <?php endif; ?>
222
+ </span>
223
+ <?php endif; ?>
224
+ <?php endif; ?>
225
+ <?php else: /* if ($_finalPrice == $_price): */ ?>
226
+ <?php $_originalWeeeTaxAmount = $_weeeHelper->getOriginalAmount($_product); ?>
227
+
228
+ <?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)): // including ?>
229
+ <p class="old-price">
230
+ <span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
231
+ <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
232
+ <?php echo $_coreHelper->currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>
233
+ </span>
234
+ </p>
235
+
236
+ <?php if ($_taxHelper->displayBothPrices()): ?>
237
+ <p class="special-price">
238
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
239
+ <span class="price-excluding-tax">
240
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
241
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
242
+ <?php echo $_coreHelper->currency($_finalPrice + $_weeeTaxAmount, true, false) ?>
243
+ </span>
244
+ </span>
245
+ <span class="price-including-tax">
246
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
247
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
248
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
249
+ </span>
250
+ </span>
251
+ </p>
252
+ <?php else: ?>
253
+ <p class="special-price">
254
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
255
+ <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
256
+ <?php echo $_coreHelper->currency($_finalPrice + $_weeeTaxAmountInclTaxes, true, false) ?>
257
+ </span>
258
+ </p>
259
+ <?php endif; ?>
260
+
261
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?>
262
+ <p class="old-price">
263
+ <span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
264
+ <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
265
+ <?php echo $_coreHelper->currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>
266
+ </span>
267
+ </p>
268
+
269
+ <p class="special-price">
270
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
271
+ <span class="price-excluding-tax">
272
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
273
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
274
+ <?php echo $_coreHelper->currency($_finalPrice + $_weeeTaxAmount, true, false) ?>
275
+ </span>
276
+ </span>
277
+ <span class="weee">(
278
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
279
+ <?php echo $_weeeSeparator; ?>
280
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
281
+ <?php $_weeeSeparator = ' + '; ?>
282
+ <?php endforeach; ?>
283
+ )</span>
284
+ <span class="price-including-tax">
285
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
286
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
287
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
288
+ </span>
289
+ </span>
290
+ </p>
291
+ <?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?>
292
+ <p class="old-price">
293
+ <span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
294
+ <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
295
+ <?php echo $_coreHelper->currency($_regularPrice + $_originalWeeeTaxAmount, true, false) ?>
296
+ </span>
297
+ </p>
298
+
299
+ <p class="special-price">
300
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
301
+ <span class="price-excluding-tax">
302
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
303
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
304
+ <?php echo $_coreHelper->currency($_finalPrice + $_weeeTaxAmount, true, false) ?>
305
+ </span>
306
+ </span>
307
+ <span class="weee">(
308
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
309
+ <?php echo $_weeeSeparator; ?>
310
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?>
311
+ <?php $_weeeSeparator = ' + '; ?>
312
+ <?php endforeach; ?>
313
+ )</span>
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 elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?>
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
+ <p class="special-price">
330
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
331
+ <span class="price-excluding-tax">
332
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
333
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
334
+ <?php echo $_coreHelper->currency($_finalPrice, true, false) ?>
335
+ </span>
336
+ </span>
337
+ <?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
338
+ <span class="weee">
339
+ <?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
340
+ </span>
341
+ <?php endforeach; ?>
342
+ <span class="price-including-tax">
343
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
344
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
345
+ <?php echo $_coreHelper->currency($_finalPriceInclTax + $_weeeTaxAmountInclTaxes, true, false) ?>
346
+ </span>
347
+ </span>
348
+ </p>
349
+ <?php else: // excl. ?>
350
+ <p class="old-price">
351
+ <span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
352
+ <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
353
+ <?php echo $_coreHelper->currency($_regularPrice, true, false) ?>
354
+ </span>
355
+ </p>
356
+
357
+ <?php if ($_taxHelper->displayBothPrices()): ?>
358
+ <p class="special-price">
359
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
360
+ <span class="price-excluding-tax">
361
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
362
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
363
+ <?php echo $_coreHelper->currency($_finalPrice, true, false) ?>
364
+ </span>
365
+ </span>
366
+ <span class="price-including-tax">
367
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
368
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
369
+ <?php echo $_coreHelper->currency($_finalPriceInclTax, true, false) ?>
370
+ </span>
371
+ </span>
372
+ </p>
373
+ <?php else: ?>
374
+ <p class="special-price">
375
+ <span class="price-label"><?php echo $this->__('Special Price:') ?></span>
376
+ <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
377
+ <?php echo $_coreHelper->currency($_finalPrice, true, false) ?>
378
+ </span>
379
+ </p>
380
+ <?php endif; ?>
381
+ <?php endif; ?>
382
+
383
+ <?php endif; /* if ($_finalPrice == $_price): */ ?>
384
+
385
+ <?php if ($this->getDisplayMinimalPrice() && $_minimalPriceValue && $_minimalPriceValue < $_product->getFinalPrice()): ?>
386
+
387
+ <?php $_minimalPriceDisplayValue = $_minimalPrice; ?>
388
+ <?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, array(0, 1, 4))): ?>
389
+ <?php $_minimalPriceDisplayValue = $_minimalPrice + $_weeeTaxAmount; ?>
390
+ <?php endif; ?>
391
+
392
+ <?php if ($this->getUseLinkForAsLowAs()):?>
393
+ <a href="<?php echo $_product->getProductUrl(); ?>" class="minimal-price-link">
394
+ <?php else:?>
395
+ <span class="minimal-price-link">
396
+ <?php endif?>
397
+ <span class="label"><?php echo $this->__('As low as:') ?></span>
398
+ <span class="price" id="product-minimal-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
399
+ <?php echo $_coreHelper->currency($_minimalPriceDisplayValue, true, false) ?>
400
+ </span>
401
+ <?php if ($this->getUseLinkForAsLowAs()):?>
402
+ </a>
403
+ <?php else:?>
404
+ </span>
405
+ <?php endif?>
406
+ <?php endif; /* if ($this->getDisplayMinimalPrice() && $_minimalPrice && $_minimalPrice < $_finalPrice): */ ?>
407
+ </div>
408
+
409
+ <?php else: /* if (!$_product->isGrouped()): */ ?>
410
+ <?php
411
+ $_exclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue);
412
+ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, true);
413
+ ?>
414
+ <?php if ($this->getDisplayMinimalPrice() && $_minimalPriceValue): ?>
415
+ <div class="price-box">
416
+ <p class="minimal-price">
417
+ <span class="price-label"><?php echo $this->__('Starting at:') ?></span>
418
+ <?php if ($_taxHelper->displayBothPrices()): ?>
419
+ <span class="price-excluding-tax">
420
+ <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
421
+ <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
422
+ <?php echo $_coreHelper->currency($_exclTax, true, false) ?>
423
+ </span>
424
+ </span>
425
+ <span class="price-including-tax">
426
+ <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
427
+ <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
428
+ <?php echo $_coreHelper->currency($_inclTax, true, false) ?>
429
+ </span>
430
+ </span>
431
+ <?php else: ?>
432
+ <?php
433
+ $_showPrice = $_inclTax;
434
+ if (!$_taxHelper->displayPriceIncludingTax()) {
435
+ $_showPrice = $_exclTax;
436
+ }
437
+ ?>
438
+ <span class="price" id="product-minimal-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
439
+ <?php echo $_coreHelper->currency($_showPrice, true, false) ?>
440
+ </span>
441
+ <?php endif; ?>
442
+ </p>
443
+ </div>
444
+ <?php endif; /* if ($this->getDisplayMinimalPrice() && $_minimalPrice): */ ?>
445
+ <?php endif; /* if (!$_product->isGrouped()): */ ?>
app/design/frontend/default/default/template/custom/custom.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="content_part">
2
+ <div class="std"><p>
3
+
4
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
5
+ <script src="http://www.galleri-artexpo.dk/skin/frontend/default/gallery_art/js/carouFredSel-6.1.0-packed.js" language="javascript" type="text/javascript"></script>
6
+ <script language="javascript" type="text/javascript">
7
+ var $nc1 = $.noConflict();
8
+ $nc1(function() {
9
+ // Variable number of visible items with variable sizes
10
+ $nc1('#foo3').carouFredSel({
11
+ width: 719,
12
+ height: 125,
13
+ prev: '#prev3',
14
+ next: '#next3',
15
+ auto: false
16
+ });
17
+ });
18
+ </script></p>
19
+
20
+ <div class="row1">
21
+ <?php $collection = Mage::getModel('custom/custom')->getCollection();
22
+ foreach($collection as $coll): ?>
23
+ <a href="<?php echo $coll->getLink() ?>">
24
+ <div class="col1">
25
+ <img alt="" src="<?php echo Mage::getBaseUrl('media').'blockimage/'.$coll->getFilename(); ?>">
26
+ <div class="detail">
27
+ <h2><?php $coll->getTitle() ?></h2>
28
+ <?php echo $coll->getContent(); ?>
29
+ </div>
30
+ <div class="more"><img alt="" src="http://www.galleri-artexpo.dk/skin/frontend/default/gallery_art/images/arrow_white.png"></div>
31
+ </div>
32
+ </a>
33
+ <?php endforeach ; ?>
34
+ </div>
35
+
36
+
37
+
package.xml CHANGED
@@ -1,18 +1,24 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Custom_Price</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Golden price module set product price as per their weight </summary>
10
- <description>Golden price module set product price as per their weight this extension is very usefull for those project which product price decide based on their weight for example online shopping site for golden item etc this extension is developed by magento developer abhay khatariya for more details please visit http://abhaykhatariya.blogspot.in/ or contact abhay khatariya </description>
11
- <notes>version 1.0.1</notes>
 
 
 
 
 
 
12
  <authors><author><name>Abhay</name><user>abhay5683</user><email>abhay5683@gmail.com</email></author></authors>
13
- <date>2013-12-16</date>
14
- <time>08:04:27</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="Custom_Price.xml" hash="b35cd6000780b323703514dfe9497e7f"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>5.4.10</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7.0.2</max></package></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Custom_Price</name>
4
+ <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Golden price module set product price as per their weight </summary>
10
+ <description>Golden price module set product price as per their weight &#xD;
11
+ this extension is very usefull for those project which product price decide based on their weight&#xD;
12
+ for example online shopping site for golden item etc&#xD;
13
+ this extension is developed by magento developer abhay khatariya&#xD;
14
+ for more details please visit http://abhaykhatariya.blogspot.in/&#xD;
15
+ or contact abhay khatariya&#xD;
16
+ </description>
17
+ <notes>release new version</notes>
18
  <authors><author><name>Abhay</name><user>abhay5683</user><email>abhay5683@gmail.com</email></author></authors>
19
+ <date>2013-12-17</date>
20
+ <time>06:50:01</time>
21
+ <contents><target name="magelocal"><dir name="Custom"><dir name="Price"><dir name="Block"><file name="Price.php" hash="32fbffae154875a4d077a70208252e25"/></dir><dir name="Helper"><file name="Data.php" hash="fcb0d53069a6c2439cb7c3d7e1329f95"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Price"><file name="Collection.php" hash="85db8de8d5344db73667d2dbc5689caf"/></dir><file name="Price.php" hash="76bf0b59d55536f521120bfa6e09529f"/></dir><file name="Observer.php" hash="e438c11b5323214e137834323fb9f20b"/><file name="Price.php" hash="1e2fab6dea7552218e1ec364293af3dd"/><file name="Status.php" hash="cd8871e88999444c4159f55df70c966e"/></dir><dir name="controllers"><file name="IndexController.php" hash="a7631aa54f30e0def5a1a7879b19e196"/></dir><dir name="etc"><file name="config.xml" hash="d1e5f7f44e9ac7c1dcb7ca6ee4571501"/><file name="system.xml" hash="0d2a4aab6ea538af79b52ba67620f1ed"/></dir><dir name="sql"><dir name="price_setup"><file name="mysql4-install-0.1.0.php" hash="14c27da2a7e413b668ffc5771376fb05"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Custom_Price.xml" hash="b35cd6000780b323703514dfe9497e7f"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="price.xml" hash="ff1e8d9ba192823ccad1deaceaaaf05a"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="custom.xml" hash="403bdbbaee3c131e9d8a1bb382938cab"/></dir><dir name="template"><dir name="custom"><file name="custom.phtml" hash="726c96cdb57d48108b9d6ade4a0f5a0c"/></dir><dir name="catalog"><dir name="product"><file name="list.phtml" hash="29306cd297c1649fadb0c447f3abcee6"/><file name="price.phtml" hash="14eadd29de7c9f93abcc4555792d9eb0"/></dir></dir></dir></dir></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.1.0</min><max>5.4.10</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7.0.2</max></package></required></dependencies>
24
  </package>