Mage_Codi - Version 4.2.5

Version Notes

Please contact our support desk if you have any problems.

Download this release

Release Info

Developer Magento Core Team
Extension Mage_Codi
Version 4.2.5
Comparing to
See all releases


Code changes from version 4.2.4 to 4.2.5

app/code/community/Mage/CodiScript/Model/Files.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- // 2015-04-23
3
  class ConfiguredProductLine{
4
  public $optionIds = array();
5
  public $line = NULL;
@@ -1755,13 +1755,17 @@ ProdRPrice=".$ProdRPrice." ProdSPrice=".$ProdSPrice."
1755
  private function _getTierPrices( &$product ){
1756
  $res="";
1757
  $prices = $product->getFormatedTierPrice();
 
 
1758
  $rightstr = "";
1759
  if( is_array( $prices ) ){
1760
  $count = count( $prices );
1761
  if( $count > 0 ){
1762
- $prodFinalPrice=$this->includetaxes ?
1763
- $this->taxhelper->getPrice($product,$product->getFinalPrice(),true) :
1764
- $product->getFinalPrice();
 
 
1765
  $res='[TierPriceTable]#$$#'.$this->quantitylabel.'#$#'.$this->pricelabel.'#$#'.$this->savingslabel."=";
1766
  $i = 1;
1767
  foreach( $prices as $price ){
@@ -1781,9 +1785,67 @@ ProdRPrice=".$ProdRPrice." ProdSPrice=".$ProdSPrice."
1781
  $i++;
1782
  }
1783
  }
 
 
 
1784
  }
1785
  unset( $prices );
1786
- return $res.$rightstr;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1787
  }
1788
 
1789
  // Class=CatalogSection
1
  <?php
2
+ // 2015-04-27
3
  class ConfiguredProductLine{
4
  public $optionIds = array();
5
  public $line = NULL;
1755
  private function _getTierPrices( &$product ){
1756
  $res="";
1757
  $prices = $product->getFormatedTierPrice();
1758
+ if( $this->_DEBUG && isset( $prices ) ) echo "public tier prices: ".var_export( $prices, true )."
1759
+ ";
1760
  $rightstr = "";
1761
  if( is_array( $prices ) ){
1762
  $count = count( $prices );
1763
  if( $count > 0 ){
1764
+ $prodFinalPrice = $this->includetaxes ?
1765
+ $this->taxhelper->getPrice($product,$product->getData('price'),true) :
1766
+ $product->getData('price');
1767
+ if( $this->_DEBUG ) echo "prodFinalPrice: ".$prodFinalPrice."
1768
+ ";
1769
  $res='[TierPriceTable]#$$#'.$this->quantitylabel.'#$#'.$this->pricelabel.'#$#'.$this->savingslabel."=";
1770
  $i = 1;
1771
  foreach( $prices as $price ){
1785
  $i++;
1786
  }
1787
  }
1788
+ if( empty( $rightstr ) ){
1789
+ $res="";
1790
+ }
1791
  }
1792
  unset( $prices );
1793
+ if( $this->getgroupprices ){
1794
+ $pairs = array();
1795
+ if( !empty( $res ) ){
1796
+ $pairs[] = $res.$rightstr;
1797
+ }
1798
+ $prices = $product->getData('tier_price');
1799
+ if( $this->_DEBUG && isset( $prices ) ) echo "all tier prices: ".var_export( $prices, true )."
1800
+ ";
1801
+ foreach( $this->customerGroups as $gid => $gname ){
1802
+ if( $this->_DEBUG ) echo "group: ".$gid."=>".$gname."
1803
+ ";
1804
+ if( $gid == 0 ){
1805
+ continue;
1806
+ }
1807
+ $res="";
1808
+ $rightstr = "";
1809
+ $gprices = array();
1810
+ foreach( $prices as $price ){
1811
+ if( $price[ 'all_groups' ] == '1' || $price[ 'cust_group' ] == $gid ){
1812
+ $gprices[] = $price;
1813
+ }
1814
+ }
1815
+ $count = count( $gprices );
1816
+ if( $count > 0 ){
1817
+ if( !isset( $prodFinalPrice ) ){
1818
+ $prodFinalPrice = $this->includetaxes ?
1819
+ $this->taxhelper->getPrice($product,$product->getData('price'),true) :
1820
+ $product->getData('price');
1821
+ if( $this->_DEBUG ) echo "prodFinalPrice: ".$prodFinalPrice."
1822
+ ";
1823
+ }
1824
+ $res='[TierPriceTable_'.$gname.']#$$#'.$this->quantitylabel.'#$#'.$this->pricelabel.'#$#'.$this->savingslabel."=";
1825
+ $i = 1;
1826
+ foreach( $gprices as $price ){
1827
+ $price['price_qty'] = $price['price_qty'] * 1;
1828
+ $tierPrice = $this->includetaxes ?
1829
+ $this->taxhelper->getPrice($product,$price['price'],true) :
1830
+ $price['price'];
1831
+ if( $tierPrice < $prodFinalPrice ){
1832
+ $tierPrice = $this->_formatPrice( "".$tierPrice );
1833
+ $rightstr .= $price['price_qty'].'#$#';
1834
+ $rightstr.=$tierPrice.'#$#';
1835
+ if( $i == $count )
1836
+ $rightstr .= ceil(100 - (( 100/$prodFinalPrice ) * $tierPrice )).'%';
1837
+ else
1838
+ $rightstr .= ceil(100 - (( 100/$prodFinalPrice ) * $tierPrice )).'%#$$#';
1839
+ }
1840
+ $i++;
1841
+ }
1842
+ }
1843
+ if( !empty( $rightstr ) ){
1844
+ $pairs[] = $res.$rightstr;
1845
+ }
1846
+ }
1847
+ return count ( $pairs ) > 0 ? implode( "|", $pairs ) : FALSE;
1848
+ } else return $res.$rightstr;
1849
  }
1850
 
1851
  // Class=CatalogSection
app/code/community/Mage/CodiScript/controllers/IndexController.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- define("__VERSION__","2015-04-23");
3
  define("__SCRIPTNAME__",basename(__FILE__));
4
 
5
  class Mage_CodiScript_IndexController extends Mage_Core_Controller_Front_Action{
@@ -236,6 +236,12 @@ executed in ".( time() - $started_time )." sec.
236
  ";
237
  die();
238
  /* RELEASE NOTES
 
 
 
 
 
 
239
  * 2015-04-14
240
  * Added import of custom simple product options into items, if the option contains a SKU number
241
  *
1
  <?php
2
+ define("__VERSION__","2015-04-27");
3
  define("__SCRIPTNAME__",basename(__FILE__));
4
 
5
  class Mage_CodiScript_IndexController extends Mage_Core_Controller_Front_Action{
236
  ";
237
  die();
238
  /* RELEASE NOTES
239
+ * 2015-04-27
240
+ * Added rendering of group tier prices in case of "Get group prices" and "Publish tiered pricing" both checked
241
+ *
242
+ * 2015-04-23
243
+ * Minor fixes
244
+ *
245
  * 2015-04-14
246
  * Added import of custom simple product options into items, if the option contains a SKU number
247
  *
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Codi</name>
4
- <version>4.2.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Extension to connect to the Catalog-on-Demand service for making print catalogs, brochures, and flyers.</description>
11
  <notes>Please contact our support desk if you have any problems.</notes>
12
  <authors><author><name>catalogondemand</name><user>auto-converted</user><email>timh@catalog-on-demand.com</email></author></authors>
13
- <date>2015-04-23</date>
14
- <time>12:51:22</time>
15
- <contents><target name="magecommunity"><dir name="Mage"><dir name="CodiScript"><dir name="Helper"><file name="Data.php" hash="3f99660cb06a9dc09f024b9993d43a3f"/></dir><dir name="Model"><file name="Files.php" hash="7595112641a42c16ff1b0485d90d96f7"/></dir><dir name="controllers"><file name="IndexController.php" hash="502cea8cbdda65a765c787057d70f0f3"/></dir><dir name="etc"><file name="adminhtml.xml" hash="40ab0bd86928c5ba175988926a9f6aee"/><file name="config.xml" hash="b960e9bd106f0c94559baa2bc5761e18"/><file name="system.xml" hash="1b5e5b18bfdce6b85e304fb4ef877274"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_CodiScript.xml" hash="f0502cac7918fc798b3b02d3d4b7e7fd"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="codiscript.xml" hash="066f99333a6054e11943a75413f65ff0"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="codi"><file name="password_validation.js" hash="7223aeed118bb5774c73f951460ae0b0"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mage_CodiScript.csv" hash="183fc591065ced83f878a4c3e23f854c"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Codi</name>
4
+ <version>4.2.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>Extension to connect to the Catalog-on-Demand service for making print catalogs, brochures, and flyers.</description>
11
  <notes>Please contact our support desk if you have any problems.</notes>
12
  <authors><author><name>catalogondemand</name><user>auto-converted</user><email>timh@catalog-on-demand.com</email></author></authors>
13
+ <date>2015-04-27</date>
14
+ <time>22:05:59</time>
15
+ <contents><target name="magecommunity"><dir name="Mage"><dir name="CodiScript"><dir name="Helper"><file name="Data.php" hash="3f99660cb06a9dc09f024b9993d43a3f"/></dir><dir name="Model"><file name="Files.php" hash="c7a925b0fed1463285100af77190b475"/></dir><dir name="controllers"><file name="IndexController.php" hash="6fe00f8f97ee8389036194d96b3ad028"/></dir><dir name="etc"><file name="adminhtml.xml" hash="40ab0bd86928c5ba175988926a9f6aee"/><file name="config.xml" hash="b960e9bd106f0c94559baa2bc5761e18"/><file name="system.xml" hash="1b5e5b18bfdce6b85e304fb4ef877274"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_CodiScript.xml" hash="f0502cac7918fc798b3b02d3d4b7e7fd"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="codiscript.xml" hash="066f99333a6054e11943a75413f65ff0"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="codi"><file name="password_validation.js" hash="7223aeed118bb5774c73f951460ae0b0"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mage_CodiScript.csv" hash="183fc591065ced83f878a4c3e23f854c"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>