PreviousNext - Version 1.0.1

Version Notes

Previous Next ProductPrevious Next Product

Download this release

Release Info

Developer Fehérdi Lóránd
Extension PreviousNext
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Heaven7/Previousnext/Helper/Data.php CHANGED
@@ -6,14 +6,15 @@ class Heaven7_Previousnext_Helper_Data extends Mage_Core_Helper_Abstract
6
  */
7
  public function getPreviousProduct()
8
  {
9
- $prodId = Mage::registry('current_product')->getId();
10
- $positions = Mage::getSingleton('core/session')->getInchooFilteredCategoryProductCollection();
11
- if (!$positions && method_exists(Mage::registry('current_category'), 'getProductsPosition')) {
12
- $positions = array_reverse(array_keys(Mage::registry('current_category')->getProductsPosition()));
 
13
  } else{
14
  return false;
15
  }
16
- $cpk = @array_search($prodId, $positions);
17
  $slice = array_reverse(array_slice($positions, 0, $cpk));
18
  foreach ($slice as $productId) {
19
  $product = Mage::getModel('catalog/product')
@@ -29,14 +30,15 @@ class Heaven7_Previousnext_Helper_Data extends Mage_Core_Helper_Abstract
29
  */
30
  public function getNextProduct()
31
  {
32
- $prodId = Mage::registry('current_product')->getId();
33
- $positions = Mage::getSingleton('core/session')->getInchooFilteredCategoryProductCollection();
34
- if (!$positions && method_exists(Mage::registry('current_category'), 'getProductsPosition')) {
35
- $positions = array_reverse(array_keys(Mage::registry('current_category')->getProductsPosition()));
36
- } else{
37
- return false;
38
- }
39
- $cpk = @array_search($prodId, $positions);
 
40
  $slice = array_slice($positions, $cpk + 1, count($positions));
41
  foreach ($slice as $productId) {
42
  $product = Mage::getModel('catalog/product')
6
  */
7
  public function getPreviousProduct()
8
  {
9
+ $product_id = Mage::registry('current_product')->getId();
10
+ if (method_exists(Mage::registry('current_category'), 'getId')
11
+ && method_exists(Mage::getResourceModel('catalog/category'), 'getProductsPosition')) {
12
+ $category = new Varien_Object(array('id'=>Mage::registry('current_category')->getId()));
13
+ $positions = array_reverse(array_keys(Mage::getResourceModel('catalog/category')->getProductsPosition($category)));
14
  } else{
15
  return false;
16
  }
17
+ $cpk = @array_search($product_id, $positions);
18
  $slice = array_reverse(array_slice($positions, 0, $cpk));
19
  foreach ($slice as $productId) {
20
  $product = Mage::getModel('catalog/product')
30
  */
31
  public function getNextProduct()
32
  {
33
+ $product_id = Mage::registry('current_product')->getId();
34
+ if (method_exists(Mage::registry('current_category'), 'getId')
35
+ && method_exists(Mage::getResourceModel('catalog/category'), 'getProductsPosition')) {
36
+ $category = new Varien_Object(array('id'=>Mage::registry('current_category')->getId()));
37
+ $positions = array_reverse(array_keys(Mage::getResourceModel('catalog/category')->getProductsPosition($category)));
38
+ } else{
39
+ return false;
40
+ }
41
+ $cpk = @array_search($product_id, $positions);
42
  $slice = array_slice($positions, $cpk + 1, count($positions));
43
  foreach ($slice as $productId) {
44
  $product = Mage::getModel('catalog/product')
app/code/community/Heaven7/Previousnext/Model/Openin.php CHANGED
@@ -5,7 +5,6 @@
5
  *
6
  * @author Fehérdi Lóránd <feherdi.lorand@gmail.com>
7
  */
8
-
9
  class Heaven7_Previousnext_Model_Openin{
10
 
11
  public function toOptionArray(){
5
  *
6
  * @author Fehérdi Lóránd <feherdi.lorand@gmail.com>
7
  */
 
8
  class Heaven7_Previousnext_Model_Openin{
9
 
10
  public function toOptionArray(){
app/code/community/Heaven7/Previousnext/Model/Position.php CHANGED
@@ -1,23 +1,10 @@
1
  <?php
2
  /**
3
- * Magento
 
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
- * 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
- * @category Mage
16
- * @package Mage_Paygate
17
- * @copyright Copyright (c) 2004-2007 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
18
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
-
21
  class Heaven7_Previousnext_Model_Position
22
  {
23
  public function toOptionArray()
1
  <?php
2
  /**
3
+ * Date: 2013.01.03.
4
+ * Time: 9:27
5
  *
6
+ * @author Fehérdi Lóránd <feherdi.lorand@gmail.com>
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  */
 
8
  class Heaven7_Previousnext_Model_Position
9
  {
10
  public function toOptionArray()
app/code/community/Heaven7/Previousnext/Model/Type.php CHANGED
@@ -5,7 +5,6 @@
5
  *
6
  * @author Fehérdi Lóránd <feherdi.lorand@gmail.com>
7
  */
8
-
9
  class Heaven7_Previousnext_Model_Type{
10
 
11
  public function toOptionArray(){
5
  *
6
  * @author Fehérdi Lóránd <feherdi.lorand@gmail.com>
7
  */
 
8
  class Heaven7_Previousnext_Model_Type{
9
 
10
  public function toOptionArray(){
app/code/community/Heaven7/Previousnext/etc/config.xml CHANGED
@@ -51,7 +51,7 @@
51
  <config>
52
  <children>
53
  <heaven7_previousnext>
54
- <title>Heaven7 Previous Next Product</title>
55
  </heaven7_previousnext>
56
  </children>
57
  </config>
@@ -65,7 +65,7 @@
65
  <modules>
66
  <Heaven7_Previousnext>
67
  <files>
68
- <default>Heaven7_Previousnext.csv</default>
69
  </files>
70
  </Heaven7_Previousnext>
71
  </modules>
51
  <config>
52
  <children>
53
  <heaven7_previousnext>
54
+ <title>Heaven7 Extended Previous Next Product</title>
55
  </heaven7_previousnext>
56
  </children>
57
  </config>
65
  <modules>
66
  <Heaven7_Previousnext>
67
  <files>
68
+ <default>Heaven7_Extendedpreviousnext.csv</default>
69
  </files>
70
  </Heaven7_Previousnext>
71
  </modules>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>PreviousNext</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Previous Next Product</description>
11
  <notes>Previous Next ProductPrevious Next Product</notes>
12
  <authors><author><name>Feh&#xE9;rdi L&#xF3;r&#xE1;nd</name><user>heaven7</user><email>feherdi.lorand@gmail.com</email></author></authors>
13
- <date>2013-10-14</date>
14
- <time>13:29:59</time>
15
- <contents><target name="magecommunity"><dir name="Heaven7"><dir name="Previousnext"><dir name="Helper"><file name="Data.php" hash="05b4b3c9ea6209e6f0500897987f47f3"/></dir><dir name="Model"><file name="Openin.php" hash="7d83853bd96c001279667069438596d7"/><file name="Position.php" hash="6f435b44930226935a07ee8c08623ead"/><file name="Type.php" hash="02d68d253a249868191038255bbb1973"/></dir><dir name="etc"><file name="config.xml" hash="8fdd7aa266ba11893947df3eee6c37e6"/><file name="system.xml" hash="a21fb319e79747cfa9f0103eea864459"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Heaven7_Previousnext.xml" hash="6ebd2c103f87a107d82f8e2279e2c32f"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="previousnext.xml" hash="bc5a441414a1f7014a38ec7fa8fe1c5b"/></dir><dir name="template"><dir name="previousnext"><file name="after.phtml" hash="34f15518d6093cd929498dc9d6eedad1"/><file name="before.phtml" hash="0ddf413e422e3859471ff633ec25e80a"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="previousnext.css" hash="f5e4264af369c3c98b364e6b7106d1e2"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>5.4.8</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>PreviousNext</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
10
  <description>Previous Next Product</description>
11
  <notes>Previous Next ProductPrevious Next Product</notes>
12
  <authors><author><name>Feh&#xE9;rdi L&#xF3;r&#xE1;nd</name><user>heaven7</user><email>feherdi.lorand@gmail.com</email></author></authors>
13
+ <date>2013-11-06</date>
14
+ <time>12:58:22</time>
15
+ <contents><target name="magecommunity"><dir name="Heaven7"><dir name="Previousnext"><dir name="Helper"><file name="Data.php" hash="0d97462e7d8122d4849963f8cfdf9dc2"/></dir><dir name="Model"><file name="Openin.php" hash="05d17f65330492c0305d00d2589439eb"/><file name="Position.php" hash="1e937f6eda132f5b82afac349cf81d58"/><file name="Type.php" hash="f03b75fb803c61ed7e8276618d05cb73"/></dir><dir name="etc"><file name="config.xml" hash="4315a092177683b32664affcf95bbc22"/><file name="system.xml" hash="a21fb319e79747cfa9f0103eea864459"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Heaven7_Previousnext.xml" hash="6ebd2c103f87a107d82f8e2279e2c32f"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="previousnext.xml" hash="bc5a441414a1f7014a38ec7fa8fe1c5b"/></dir><dir name="template"><dir name="previousnext"><file name="after.phtml" hash="34f15518d6093cd929498dc9d6eedad1"/><file name="before.phtml" hash="0ddf413e422e3859471ff633ec25e80a"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="previousnext.css" hash="f5e4264af369c3c98b364e6b7106d1e2"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>5.4.8</max></php></required></dependencies>
18
  </package>