Jefferson_Promocaotabs - Version 0.1.1

Version Notes

Technologies used to build the module: php, jquery, html, css, Bootstrap, modules compatible with Magento version 1.7 onward

Download this release

Release Info

Developer Jefferson Batista Porto
Extension Jefferson_Promocaotabs
Version 0.1.1
Comparing to
See all releases


Code changes from version 0.1.0 to 0.1.1

app/code/community/Jefferson/Promocaotabs/Model/Promocaotabs.php CHANGED
@@ -35,13 +35,21 @@
35
 
36
  public function getDataProducts($categoryCurrent){
37
 
38
- $this->_product = Mage::getModel('catalog/product')
 
 
39
  ->getCollection()
40
  ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
41
- ->addAttributeToSelect('*')
42
- ->addAttributeToFilter('set_promotion', array('in'=>"1"))
43
- ->addAttributeToFilter('category_id', array('in'=> array( $categoryCurrent)))
44
- ->load();
 
 
 
 
 
 
45
 
46
  foreach($this->_product as $this->item);
47
 
@@ -59,7 +67,7 @@
59
  public function getCategoryName($category)
60
  {
61
 
62
- $this->category = Mage::getModel('catalog/category')
63
  ->load($category);
64
  $cat = $this->category->getTitleCustomTabs();
65
  if(!empty($cat)){
35
 
36
  public function getDataProducts($categoryCurrent){
37
 
38
+ $storeId = Mage::app()->getStore()->getStoreId();
39
+
40
+ $this->_product = Mage::getSingleton('catalog/product')
41
  ->getCollection()
42
  ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
43
+ ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
44
+ ->addFieldToFilter(array(
45
+ array('attribute'=>'set_promotion','in'=> '1'),
46
+ ))
47
+ ->addFieldToFilter(array(
48
+ array('attribute'=>'category_id','in'=> array($categoryCurrent)),
49
+ ))
50
+ ->addStoreFilter($storeId);
51
+
52
+ $this->_product->getSelect()->group('e.entity_id');
53
 
54
  foreach($this->_product as $this->item);
55
 
67
  public function getCategoryName($category)
68
  {
69
 
70
+ $this->category = Mage::getSingleton('catalog/category')
71
  ->load($category);
72
  $cat = $this->category->getTitleCustomTabs();
73
  if(!empty($cat)){
app/code/community/Jefferson/Promocaotabs/Model/System/Config/Source/Category.php CHANGED
@@ -23,7 +23,7 @@ class Jefferson_Promocaotabs_Model_System_Config_Source_Category extends Mage_Ad
23
  {
24
  public function toOptionArray($addEmpty = true)
25
  {
26
- $collection = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('*');
27
 
28
  $options = array();
29
  /*if ($addEmpty) {
23
  {
24
  public function toOptionArray($addEmpty = true)
25
  {
26
+ $collection = Mage::getSingleton('catalog/category')->getCollection()->addAttributeToSelect('*');
27
 
28
  $options = array();
29
  /*if ($addEmpty) {
app/code/community/Jefferson/Promocaotabs/etc/config.xml CHANGED
@@ -23,7 +23,7 @@
23
 
24
  <modules>
25
  <Jefferson_Promocaotabs>
26
- <versioon>0.1.0</versioon>
27
  </Jefferson_Promocaotabs>
28
  </modules>
29
 
23
 
24
  <modules>
25
  <Jefferson_Promocaotabs>
26
+ <versioon>0.1.1</versioon>
27
  </Jefferson_Promocaotabs>
28
  </modules>
29
 
app/code/community/Jefferson/Promocaotabs/sql/jefferson_promocaotabs_setup/upgrade-0.1.1.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ $installer->startSetup();
5
+ $installer->endSetup();
6
+ ?>
app/design/frontend/base/default/layout/promocaofeaturedhome.xml CHANGED
@@ -49,7 +49,11 @@
49
 
50
  <cms_index_index>
51
  <reference name="content">
52
- <block type="promocaotabs/promocaotabs" name="promocaotabshome" template="promocaotabs/promocaotabshome.phtml" before="" />
 
 
 
 
53
  </reference>
54
  </cms_index_index>
55
 
49
 
50
  <cms_index_index>
51
  <reference name="content">
52
+ <block type="promocaotabs/promocaotabs" name="promocaotabshome" before="">
53
+ <action method="setTemplate" ifconfig="catalog/jefferson_promocaotabs/enable">
54
+ <template>promocaotabs/promocaotabshome.phtml</template>
55
+ </action>
56
+ </block>
57
  </reference>
58
  </cms_index_index>
59
 
app/design/frontend/base/default/template/promocaotabs/promocaotabshome.phtml CHANGED
@@ -35,8 +35,6 @@
35
  $getImgSize = $this->getImgSize();
36
  $cat = $this->getCatsArray();
37
  $qtyCat = $this->getCategoryQty();
38
- $enabled = $this->getActive();
39
- if($enabled == 1):
40
  ?>
41
  <div class="container-fluid container-tabs-jefferson">
42
  <div class="row-fluid">
@@ -75,11 +73,34 @@
75
 
76
  <a href="<?php echo $item->getProductUrl() ?>"
77
  title="<?php echo $this->stripTags($this->getImageLabel($item, 'small_image'), null, true) ?>" class="product-image">
78
- <img src="<?php echo $this->helper('catalog/image')->init($item, 'small_image')->keepFrame(false)->resize($getImgSize); ?>" />
79
  </a>
80
 
81
  <div class="container_info_bx">
82
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  <a href="<?php echo $item->getProductUrl() ?>"
84
  title="<?php echo $this->stripTags($this->getImageLabel($item, 'small_image'), null, true) ?>"
85
  class="product-image">
@@ -94,11 +115,9 @@
94
  <?php echo $this->__($this->getLabelBtn()); ?>
95
  </a>
96
 
97
- <?php if($item->getSpecialPrice() > 0 ): ?>
98
- <span class="perc">
99
- <?php echo $this->getPerc($item->getPrice(), $item->getSpecialPrice() ); ?>
100
- </span>
101
- <?php endif; ?>
102
 
103
  <div class="product-secondary">
104
 
@@ -151,4 +170,3 @@
151
 
152
  </div>
153
  </div>
154
- <?php endif; ?>
35
  $getImgSize = $this->getImgSize();
36
  $cat = $this->getCatsArray();
37
  $qtyCat = $this->getCategoryQty();
 
 
38
  ?>
39
  <div class="container-fluid container-tabs-jefferson">
40
  <div class="row-fluid">
73
 
74
  <a href="<?php echo $item->getProductUrl() ?>"
75
  title="<?php echo $this->stripTags($this->getImageLabel($item, 'small_image'), null, true) ?>" class="product-image">
76
+ <img src="<?php echo $this->helper('catalog/image')->init($item, 'small_image')->keepFrame(true)->resize($getImgSize,$getImgSize); ?>" />
77
  </a>
78
 
79
  <div class="container_info_bx">
80
+ <?php
81
+ $today = strtotime(date('Y-m-d'));
82
+
83
+ $specialPriceFromDate = $item->getSpecialFromDate();
84
+
85
+ $specialPriceToDate = $item->getSpecialToDate();
86
+ ?>
87
+
88
+ <?php if($item->getSpecialPrice() > 0 ):
89
+
90
+ if($today >= strtotime($specialPriceFromDate) && $today <= strtotime($specialPriceToDate)
91
+ || $today >= strtotime( $specialPriceFromDate) && is_null($specialPriceToDate)):
92
+
93
+ ?>
94
+
95
+ <span class="perc">
96
+ <?php echo $this->getPerc($item->getPrice(), $item->getSpecialPrice() ); ?>
97
+ </span>
98
+
99
+ <?php
100
+ endif;
101
+ endif;
102
+ ?>
103
+
104
  <a href="<?php echo $item->getProductUrl() ?>"
105
  title="<?php echo $this->stripTags($this->getImageLabel($item, 'small_image'), null, true) ?>"
106
  class="product-image">
115
  <?php echo $this->__($this->getLabelBtn()); ?>
116
  </a>
117
 
118
+
119
+
120
+
 
 
121
 
122
  <div class="product-secondary">
123
 
170
 
171
  </div>
172
  </div>
 
app/locale/pt_BR/Jefferson_Promocaotabs.csv ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ "Enable Module","Ativar módulo"
2
+ "Enable visualization of the discount","Habilitar visualização do desconto"
3
+ "Enter the quantity of products to be listed in the tabs.","Digite a quantidade produtos que serão listado nas tabs."
4
+ "Number of rows","Quantidade de linhas"
5
+ "Select the categories","Selecione as categorias"
6
+ "Category","Categoria"
7
+ "Image size","Tamanho da imagem"
8
+ "Products in tabs on the home","Produtos em tabs na home"
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Jefferson_Promocaotabs</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">Open Software License v. 3.0 (OSL-3.0)</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>This module allows it to be placed in tabs on the home products or elsewhere via static block, this module should be used to that you want to customize your store to improve the marketing of the store.</description>
11
  <notes>Technologies used to build the module: php, jquery, html, css, Bootstrap, modules compatible with Magento version 1.7 onward</notes>
12
  <authors><author><name>Jefferson Batista Porto</name><user>fdsa451</user><email>jefferson.b.porto@gmail.com</email></author></authors>
13
- <date>2015-07-23</date>
14
- <time>23:45:52</time>
15
- <contents><target name="magecommunity"><dir name="Jefferson"><dir name="Promocaotabs"><dir name="Block"><file name="Promocaotabs.php" hash="9b8ddf139575bd5515f65373aa6b00ed"/></dir><dir name="Helper"><file name="Data.php" hash="4c1198d0c0ae7b8d408d8cfc2408e870"/></dir><dir name="Model"><file name="Promocaotabs.php" hash="a9c1adb9312746680564b459e9a16e46"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Category.php" hash="9b126e1c45bff5474bfb05750c5b11b2"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="ddeea7de69079d069df607e1b3817d64"/></dir><dir name="etc"><file name="config.xml" hash="53804037a1db06ce6cea6abfa019a0e9"/><file name="system.xml" hash="c917037526a41755b672d961b69fabf6"/></dir><dir name="sql"><dir name="jefferson_promocaotabs_setup"><file name="install-0.1.0.php" hash="d7f17f2d43052ed91d1eb15ed66f7335"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Jefferson_Promocaotabs.xml" hash="280a6361902cbb632bad726e056706e1"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="promocaofeaturedhome.xml" hash="cfac063f3f450fece997c3558b03f52e"/></dir><dir name="template"><dir name="promocaotabs"><file name="promocaotabshome.phtml" hash="68caeaacd24cdf8f80bf4d650487dc33"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="jefferson"><dir name="Promocaotabs"><dir name="css"><file name="style.css" hash="ece0f9cc5fd7ea1d346eec4e9f6b026a"/></dir><dir name="js"><file name="jquery.js" hash="11468602df014a21b203dc9bcd84d369"/><file name="script.js" hash="2cf9e80cead684dea89276fd06281e41"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Jefferson_Promocaotabs</name>
4
+ <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">Open Software License v. 3.0 (OSL-3.0)</license>
7
  <channel>community</channel>
10
  <description>This module allows it to be placed in tabs on the home products or elsewhere via static block, this module should be used to that you want to customize your store to improve the marketing of the store.</description>
11
  <notes>Technologies used to build the module: php, jquery, html, css, Bootstrap, modules compatible with Magento version 1.7 onward</notes>
12
  <authors><author><name>Jefferson Batista Porto</name><user>fdsa451</user><email>jefferson.b.porto@gmail.com</email></author></authors>
13
+ <date>2015-08-17</date>
14
+ <time>02:12:39</time>
15
+ <contents><target name="magecommunity"><dir name="Jefferson"><dir name="Promocaotabs"><dir name="Block"><file name="Promocaotabs.php" hash="9b8ddf139575bd5515f65373aa6b00ed"/></dir><dir name="Helper"><file name="Data.php" hash="4c1198d0c0ae7b8d408d8cfc2408e870"/></dir><dir name="Model"><file name="Promocaotabs.php" hash="e7b9e3e96c9da8d9ea341a1fcdfa51b7"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Category.php" hash="d46efaac873c9b561cb3efff9d12630f"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="ddeea7de69079d069df607e1b3817d64"/></dir><dir name="etc"><file name="config.xml" hash="13940793d361b5729cc1a0e9ce6b407f"/><file name="system.xml" hash="c917037526a41755b672d961b69fabf6"/></dir><dir name="sql"><dir name="jefferson_promocaotabs_setup"><file name="install-0.1.0.php" hash="d7f17f2d43052ed91d1eb15ed66f7335"/><file name="upgrade-0.1.1.php" hash="f1dea537eea9d2d8639c7e513b3cc5f1"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Jefferson_Promocaotabs.xml" hash="280a6361902cbb632bad726e056706e1"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="promocaofeaturedhome.xml" hash="0c34afd3e05a0a6dbdc86e0a7468330a"/></dir><dir name="template"><dir name="promocaotabs"><file name="promocaotabshome.phtml" hash="c7226a3af1f876cee6581afcf59e3bc9"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="jefferson"><dir name="Promocaotabs"><dir name="css"><file name="style.css" hash="ece0f9cc5fd7ea1d346eec4e9f6b026a"/></dir><dir name="js"><file name="jquery.js" hash="11468602df014a21b203dc9bcd84d369"/><file name="script.js" hash="2cf9e80cead684dea89276fd06281e41"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="pt_BR"><file name="Jefferson_Promocaotabs.csv" hash="cfb571e11d11af98bfe046ad16a1a6f8"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>