Advertisement
Guest User

tier

a guest
Aug 4th, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.35 KB | None | 0 0
  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) 2014 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. * @see Mage_Catalog_Block_Product_View
  31. */
  32. $_product = $this->getProduct();
  33. $_tierPrices = $this->getTierPrices();
  34. $_finalPriceInclTax = $this->helper('tax')->getPrice($_product, $_product->getFinalPrice(), true);
  35.  
  36. /** @var $_catalogHelper Mage_Catalog_Helper_Data */
  37. $_catalogHelper = Mage::helper('catalog');
  38.  
  39. $_weeeTaxAmount = Mage::helper('weee')->getAmountForDisplay($_product);
  40. if (Mage::helper('weee')->typeOfDisplay($_product, array(1,2,4))) {
  41. $_weeeTaxAttributes = Mage::helper('weee')->getProductWeeeAttributesForDisplay($_product);
  42. }
  43.  
  44. ?>
  45. <?php if (count($_tierPrices) > 0): ?>
  46. <ul class="<?php echo ($this->getInGrouped() ? 'tier-prices-grouped product-pricing-grouped' : 'tier-prices product-pricing'); ?>">
  47. <?php if ($this->getInGrouped()): ?>
  48. <?php $_tierPrices = $this->getTierPrices($_product); ?>
  49. <?php endif; ?>
  50. <?php Mage::helper('weee')->processTierPrices($_product, $_tierPrices); ?>
  51. <?php foreach ($_tierPrices as $_index => $_price): ?>
  52. <li class="tier-price tier-<?php echo $_index; ?>">
  53. <?php if ($_catalogHelper->canApplyMsrp($_product)): ?>
  54. <?php if ($this->getInGrouped()): ?>
  55. <?php echo $this->__('Buy %1$s for', $_price['price_qty']) ?>:
  56. <?php else: ?>
  57. <?php echo $this->__('Buy %1$s', $_price['price_qty']) ?>
  58. <?php endif; ?>
  59. <?php else: ?>
  60.  
  61. <?php if ($this->helper('tax')->displayBothPrices()): ?>
  62. <?php if (Mage::helper('weee')->typeOfDisplay($_product, 0)): ?>
  63. <?php echo $this->__('Buy %1$s for %2$s (%3$s incl. tax) each', $_price['price_qty'], $_price['formated_price_incl_weee_only'], $_price['formated_price_incl_weee']) ?>
  64. <?php elseif(Mage::helper('weee')->typeOfDisplay($_product, 1)): ?>
  65. <?php echo $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']); ?>
  66. <?php if ($_weeeTaxAttributes): ?>
  67. (<small>
  68. <?php echo $this->__('%1$s incl tax.', $_price['formated_price_incl_weee']); ?>
  69. <?php $separator = ' + '; foreach ($_weeeTaxAttributes as $_attribute): ?>
  70. <?php echo $separator; ?>
  71. <?php echo $_attribute->getName(); ?>: <?php echo Mage::helper('core')->currency($_attribute->getAmount()); ?>
  72. <?php endforeach; ?>
  73. </small>)
  74. <?php endif; ?>
  75. <?php echo $this->__('each') ?>
  76. <?php elseif(Mage::helper('weee')->typeOfDisplay($_product, 4)): ?>
  77. <?php echo $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']); ?>
  78. <?php if ($_weeeTaxAttributes): ?>
  79. (<small>
  80. <?php echo $this->__('%1$s incl tax.', $_price['formated_price_incl_weee']); ?>
  81. <?php $separator = ' + '; foreach ($_weeeTaxAttributes as $_attribute): ?>
  82. <?php echo $separator; ?>
  83. <?php echo $_attribute->getName(); ?>: <?php echo Mage::helper('core')->currency($_attribute->getAmount()+$_attribute->getTaxAmount()); ?>
  84. <?php endforeach; ?>
  85. </small>)
  86. <?php endif; ?>
  87. <?php echo $this->__('each') ?>
  88. <?php elseif(Mage::helper('weee')->typeOfDisplay($_product, 2)): ?>
  89. <?php echo $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price']); ?>
  90. <?php if ($_weeeTaxAttributes): ?>
  91. (<small>
  92. <?php foreach ($_weeeTaxAttributes as $_attribute): ?>
  93. <?php echo $_attribute->getName(); ?>: <?php echo Mage::helper('core')->currency($_attribute->getAmount()); ?>
  94. <?php endforeach; ?>
  95. <?php echo $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee']); ?>
  96. </small>)
  97. <?php endif; ?>
  98. <?php echo $this->__('each') ?>
  99. <?php else: ?>
  100. <?php echo $this->__('Buy %1$s for %2$s (%3$s incl. tax) each', $_price['price_qty'], $_price['formated_price'], $_price['formated_price_incl_tax']) ?>
  101. <?php endif; ?>
  102. <?php else: ?>
  103. <?php if ($this->helper('tax')->displayPriceIncludingTax()): ?>
  104. <?php if (Mage::helper('weee')->typeOfDisplay($_product, 0)): ?>
  105. <?php echo $this->__('Buy %1$s for %2$s each', $_price['price_qty'], $_price['formated_price_incl_weee']) ?>
  106. <?php elseif(Mage::helper('weee')->typeOfDisplay($_product, 1)): ?>
  107. <?php echo $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee']); ?>
  108. <?php if ($_weeeTaxAttributes): ?>
  109. (<small>
  110. <?php $separator = ''; foreach ($_weeeTaxAttributes as $_attribute): ?>
  111. <?php echo $separator; ?>
  112. <?php echo $_attribute->getName(); ?>: <?php echo Mage::helper('core')->currency($_attribute->getAmount()); ?>
  113. <?php $separator = ' + '; endforeach; ?>
  114. </small>)
  115. <?php endif; ?>
  116. <?php echo $this->__('each') ?>
  117. <?php elseif(Mage::helper('weee')->typeOfDisplay($_product, 4)): ?>
  118. <?php echo $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee']); ?>
  119. <?php if ($_weeeTaxAttributes): ?>
  120. (<small>
  121. <?php $separator = ''; foreach ($_weeeTaxAttributes as $_attribute): ?>
  122. <?php echo $separator; ?>
  123. <?php echo $_attribute->getName(); ?>: <?php echo Mage::helper('core')->currency($_attribute->getAmount()+$_attribute->getTaxAmount()); ?>
  124. <?php $separator = ' + '; endforeach; ?>
  125. </small>)
  126. <?php endif; ?>
  127. <?php echo $this->__('each') ?>
  128. <?php elseif(Mage::helper('weee')->typeOfDisplay($_product, 2)): ?>
  129. <?php echo $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_tax']); ?>
  130. <?php if ($_weeeTaxAttributes): ?>
  131. (<small>
  132. <?php foreach ($_weeeTaxAttributes as $_attribute): ?>
  133. <?php echo $_attribute->getName(); ?>: <?php echo Mage::helper('core')->currency($_attribute->getAmount()); ?>
  134. <?php endforeach; ?>
  135. <?php echo $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee']); ?>
  136. </small>)
  137. <?php endif; ?>
  138. <?php echo $this->__('each') ?>
  139. <?php else: ?>
  140. <?php echo $this->__('Buy %1$s for %2$s each', $_price['price_qty'], $_price['formated_price_incl_tax']) ?>
  141. <?php endif; ?>
  142. <?php else: ?>
  143. <?php if (Mage::helper('weee')->typeOfDisplay($_product, 0)): ?>
  144. <?php echo $this->__('Buy %1$s for %2$s each', $_price['price_qty'], $_price['formated_price_incl_weee_only']) ?>
  145. <?php elseif(Mage::helper('weee')->typeOfDisplay($_product, 1)): ?>
  146. <?php echo $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']); ?>
  147. <?php if ($_weeeTaxAttributes): ?>
  148. (<small>
  149. <?php $separator = ''; foreach ($_weeeTaxAttributes as $_attribute): ?>
  150. <?php echo $separator; ?>
  151. <?php echo $_attribute->getName(); ?>: <?php echo Mage::helper('core')->currency($_attribute->getAmount()); ?>
  152. <?php $separator = ' + '; endforeach; ?>
  153. </small>)
  154. <?php endif; ?>
  155. <?php echo $this->__('each') ?>
  156. <?php elseif(Mage::helper('weee')->typeOfDisplay($_product, 4)): ?>
  157. <?php echo $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price_incl_weee_only']); ?>
  158. <?php if ($_weeeTaxAttributes): ?>
  159. (<small>
  160. <?php $separator = ''; foreach ($_weeeTaxAttributes as $_attribute): ?>
  161. <?php echo $separator; ?>
  162. <?php echo $_attribute->getName(); ?>: <?php echo Mage::helper('core')->currency($_attribute->getAmount()+$_attribute->getTaxAmount()); ?>
  163. <?php $separator = ' + '; endforeach; ?>
  164. </small>)
  165. <?php endif; ?>
  166. <?php echo $this->__('each') ?>
  167. <?php elseif(Mage::helper('weee')->typeOfDisplay($_product, 2)): ?>
  168. <?php echo $this->__('Buy %1$s for %2$s', $_price['price_qty'], $_price['formated_price']); ?>
  169. <?php if ($_weeeTaxAttributes): ?>
  170. (<small>
  171. <?php foreach ($_weeeTaxAttributes as $_attribute): ?>
  172. <?php echo $_attribute->getName(); ?>: <?php echo Mage::helper('core')->currency($_attribute->getAmount()); ?>
  173. <?php endforeach; ?>
  174. <?php echo $this->__('Total incl. Tax: %1$s', $_price['formated_price_incl_weee_only']); ?>
  175. </small>)
  176. <?php endif; ?>
  177. <?php echo $this->__('each') ?>
  178. <?php else: ?>
  179. <?php echo $this->__('Buy %1$s for %2$s each', $_price['price_qty'], $_price['formated_price']) ?>
  180. <?php endif; ?>
  181. <?php endif; ?>
  182. <?php endif; ?>
  183.  
  184. <?php endif; // Can apply MSRP ?>
  185.  
  186. <?php if (!$this->getInGrouped()): ?>
  187. <?php if(($_product->getPrice() == $_product->getFinalPrice() && $_product->getPrice() > $_price['price'])
  188. || ($_product->getPrice() != $_product->getFinalPrice() && $_product->getFinalPrice() > $_price['price'])): ?>
  189. <?php echo $this->__('and') ?>&nbsp;<strong class="benefit"><?php echo $this->__('save')?>&nbsp;<span class="percent tier-<?php echo $_index;?>"><?php echo $_price['savePercent']?></span>%
  190. <?php endif ?></strong>
  191. <?php endif; ?>
  192.  
  193. <?php if ($_catalogHelper->isShowPriceOnGesture($_product)):?>
  194. <?php $popupId = 'msrp-popup-' . $_product->getId() . $this->helper('core')->getRandomString(20); ?>
  195. <a href="#" id="<?php echo($popupId);?>"><?php echo $this->__('Click for price'); ?></a>
  196. <script type="text/javascript">
  197. <?php
  198. $addToCartUrl = $this->getProduct()->isSalable()
  199. ? $this->getAddToCartUrl($_product, array('qty' => $_price['price_qty']))
  200. : '';
  201. ?>
  202. <?php if (!$this->getInGrouped()): ?>
  203. var newLink = {
  204. url: "<?php echo $addToCartUrl; ?>",
  205. qty: "<?php echo $_price['price_qty']?>"
  206. };
  207. <?php else: ?>
  208. var newLink = {
  209. url: "<?php echo $addToCartUrl; ?>",
  210. notUseForm: true
  211. };
  212. <?php endif ?>
  213. Catalog.Map.addHelpLink(
  214. $('<?php echo $popupId ?>'),
  215. "<?php echo $_product->getName() ?>",
  216. <?php echo json_encode($_price['real_price_html']) ?>,
  217. "<?php echo $this->helper('core')->currency($_product->getMsrp(),true,false) ?>",
  218. newLink
  219. );
  220. </script>
  221. <?php else: ?>
  222. <span class="msrp-price-hide-message">
  223. <?php echo $_catalogHelper->getMsrpPriceMessage($_product) ?>
  224. </span>
  225. <?php endif; ?>
  226.  
  227.  
  228. </li>
  229.  
  230. <?php endforeach ?>
  231. </ul>
  232. <?php endif;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement