Spranks_ConfigurableTierPrices - Version 1.0.1

Version Notes

Fixed problems when using individual options

Download this release

Release Info

Developer Simon Sprankel
Extension Spranks_ConfigurableTierPrices
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Spranks/ConfigurableTierPrices/Model/Product/Type/Configurable/Price.php CHANGED
@@ -48,17 +48,14 @@ class Spranks_ConfigurableTierPrices_Model_Product_Type_Configurable_Price exten
48
  $idQuantities = array();
49
  // go through all products in the quote
50
  foreach ($items as $item) {
51
- if ($item->getParentItem())
 
52
  continue;
53
- // get the simple products ID
54
- $productModel = Mage::getModel('catalog/product');
55
- $id = $productModel->getIdBySku($item->getSku());
56
- // get the parent IDs
57
- $configurableProductModel = Mage::getModel('catalog/product_type_configurable');
58
- $parentIdArray = $configurableProductModel->getParentIdsByChild($id);
59
- // map the parent ID with the quantities of the simple products
60
- foreach ($parentIdArray as $parent)
61
- $idQuantities[$parent][] = $item->getQty();
62
  }
63
  // compute the total quantity of items of the configurable product
64
  if (array_key_exists($product->getId(), $idQuantities)) {
48
  $idQuantities = array();
49
  // go through all products in the quote
50
  foreach ($items as $item) {
51
+ /** @var Mage_Sales_Model_Quote_Item $item */
52
+ if ($item->getParentItem()) {
53
  continue;
54
+ }
55
+ // this is the product ID of the parent!
56
+ $id = $item->getProductId();
57
+ // map the parent ID with the quantity of the simple product
58
+ $idQuantities[$id][] = $item->getQty();
 
 
 
 
59
  }
60
  // compute the total quantity of items of the configurable product
61
  if (array_key_exists($product->getId(), $idQuantities)) {
app/code/community/Spranks/ConfigurableTierPrices/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Spranks_ConfigurableTierPrices>
5
- <version>1.0.0</version>
6
  </Spranks_ConfigurableTierPrices>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Spranks_ConfigurableTierPrices>
5
+ <version>1.0.1</version>
6
  </Spranks_ConfigurableTierPrices>
7
  </modules>
8
  <global>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Spranks_ConfigurableTierPrices</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This module changes the way Magento calculates tier prices of configurable products.</summary>
10
  <description>This Magento module changes the way Magento calculates tier prices of configurable products. You can now add different variants of a configurable product to the cart and you will get the tier price for the total quantity of all variants in the cart.</description>
11
- <notes>Fixed wrong price display on detail page</notes>
12
  <authors><author><name>Simon Sprankel</name><user>spranks</user><email>simonsprankel@gmail.com</email></author></authors>
13
- <date>2014-03-12</date>
14
- <time>13:21:42</time>
15
- <contents><target name="magecommunity"><dir name="Spranks"><dir name="ConfigurableTierPrices"><dir name="Helper"><file name="Admin.php" hash="7ec6839ca9c1fa032d493eaba60e391a"/></dir><dir name="Model"><dir name="Product"><dir name="Type"><dir name="Configurable"><file name="Price.php" hash="c4abb3058d158f0ca8bf1483e3fb4bbc"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="570f31c351a32e5fccb69ccf7cf4c2ee"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Spranks_ConfigurableTierPrices.xml" hash="8a3f62990ce094cb7e7e6313b66d5d51"/></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>Spranks_ConfigurableTierPrices</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This module changes the way Magento calculates tier prices of configurable products.</summary>
10
  <description>This Magento module changes the way Magento calculates tier prices of configurable products. You can now add different variants of a configurable product to the cart and you will get the tier price for the total quantity of all variants in the cart.</description>
11
+ <notes>Fixed problems when using individual options</notes>
12
  <authors><author><name>Simon Sprankel</name><user>spranks</user><email>simonsprankel@gmail.com</email></author></authors>
13
+ <date>2014-06-19</date>
14
+ <time>07:11:36</time>
15
+ <contents><target name="magecommunity"><dir name="Spranks"><dir name="ConfigurableTierPrices"><dir name="Helper"><file name="Admin.php" hash="7ec6839ca9c1fa032d493eaba60e391a"/></dir><dir name="Model"><dir name="Product"><dir name="Type"><dir name="Configurable"><file name="Price.php" hash="e3573a3695f85627f41134a7f4bec32e"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="6e2341355ff596dc68fced04b4df7945"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Spranks_ConfigurableTierPrices.xml" hash="8a3f62990ce094cb7e7e6313b66d5d51"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>